using System; using System.Xml; using System.IO; using System.ComponentModel; namespace AyaNova.PlugIn.ImportExportCSV { /// /// Persistence store for user options etc /// [Serializable] public class IECSVData { #region fields #region Client private bool _ClientPostalAddress = false; private bool _ClientPhysicalAddress = false; private bool _ClientContact = false; private bool _ClientContactNotes = false; private bool _ClientPhoneNumbers = false; private bool _ClientEmail = false; private bool _ClientWebSite = false; private bool _ClientAccountNumber = false; private bool _ClientNotes = false; private bool _ClientTechNotes = false; private bool _ClientPopupNotes = false; //case 1737 private bool _ClientGroup = false; private bool _ClientDispatchZone = false; private bool _ClientRegion = false; #endregion client #region Part private bool _PartName = false; private bool _PartAlternativeWholesaler = false; private bool _PartCategoryID = false; private bool _PartCost = false; private bool _PartManufacturer = false; private bool _PartNotes = false; private bool _PartRetail = false; private bool _PartTrackSerialNumber = false; private bool _PartUnitOfMeasureID = false; private bool _PartUPC = false; private bool _PartWholesaler = false; #endregion Part #region Unit private bool _UnitClientID = false; private bool _UnitModelID = false; private bool _UnitNotes = false; private bool _UnitPurchasedFromVendor = false; private bool _UnitReceipt = false; private bool _UnitPurchasedDate = false; private bool _UnitDescription = false; private bool _UnitMetered = false; //case 1739 private bool _UnitWarrantyLength = false; #endregion unit #region Rate private bool _RateDescription = false; private bool _RateAccountNumber = false; private bool _RateCost = false; private bool _RateCharge = false; private bool _RateContractRate = false; private bool _RateType = false; private bool _RateUnitChargeDescription = false; private bool _RateClientGroup = false; private bool _RateRegion = false; #endregion Rate //case 1588 //save last mappings to restore later #region mappings private string _ClientLastMapping = ""; private string _PartLastMapping = ""; private string _UnitLastMapping = ""; private string _AssemblyLastMapping = ""; //case 2072 private string _WorkorderStatusLastMapping = ""; private string _WorkorderCategoryLastMapping = ""; private string _WorkorderItemTypeLastMapping = ""; private string _UnitServiceTypeLastMapping = ""; private string _PriorityLastMapping = ""; private string _PartCategoryLastMapping = ""; private string _RateLastMapping = ""; #endregion public bool IsDirty = false; #endregion #region Properties #region Client [Browsable(false)] public bool ClientUpdate { get { return _ClientPostalAddress || _ClientPhysicalAddress || _ClientContact || _ClientContactNotes || _ClientPhoneNumbers || _ClientEmail || _ClientWebSite || _ClientAccountNumber || _ClientNotes || _ClientTechNotes || _ClientPopupNotes || _ClientGroup || _ClientDispatchZone || _ClientRegion; } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Client import")] public bool ClientPostalAddress { get { return _ClientPostalAddress; } set { if (_ClientPostalAddress != value) { _ClientPostalAddress = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Client import")] public bool ClientPhysicalAddress { get { return _ClientPhysicalAddress; } set { if (_ClientPhysicalAddress != value) { _ClientPhysicalAddress = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Client import")] public bool ClientContact { get { return _ClientContact; } set { if (_ClientContact != value) { _ClientContact = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Client import")] public bool ClientContactNotes { get { return _ClientContactNotes; } set { if (_ClientContactNotes != value) { _ClientContactNotes = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Client import")] public bool ClientPhoneNumbers { get { return _ClientPhoneNumbers; } set { if (_ClientPhoneNumbers != value) { _ClientPhoneNumbers = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Client import")] public bool ClientEmail { get { return _ClientEmail; } set { if (_ClientEmail != value) { _ClientEmail = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Client import")] public bool ClientWebSite { get { return _ClientWebSite; } set { if (_ClientWebSite != value) { _ClientWebSite = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Client import")] public bool ClientAccountNumber { get { return _ClientAccountNumber; } set { if (_ClientAccountNumber != value) { _ClientAccountNumber = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Client import")] public bool ClientNotes { get { return _ClientNotes; } set { if (_ClientNotes != value) { _ClientNotes = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Client import")] public bool ClientTechNotes { get { return _ClientTechNotes; } set { if (_ClientTechNotes != value) { _ClientTechNotes = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Client import")] public bool ClientPopupNotes { get { return _ClientPopupNotes; } set { if (_ClientPopupNotes != value) { _ClientPopupNotes = value; IsDirty = true; } } } //case 1737 [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Client import")] public bool ClientGroup { get { return _ClientGroup; } set { if (_ClientGroup != value) { _ClientGroup = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Client import")] public bool ClientDispatchZone { get { return _ClientDispatchZone; } set { if (_ClientDispatchZone != value) { _ClientDispatchZone = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Client import")] public bool ClientRegion { get { return _ClientRegion; } set { if (_ClientRegion != value) { _ClientRegion = value; IsDirty = true; } } } #endregion client #region Part [Browsable(false)] public bool PartUpdate { get { return _PartName || _PartAlternativeWholesaler || _PartCategoryID || _PartCost || _PartManufacturer || _PartNotes || _PartRetail || _PartTrackSerialNumber || _PartUnitOfMeasureID || _PartUPC || _PartWholesaler; } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Part import")] public bool PartName { get { return _PartName; } set { if (_PartName != value) { _PartName = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Part import")] public bool PartAlternativeWholesaler { get { return _PartAlternativeWholesaler; } set { if (_PartAlternativeWholesaler != value) { _PartAlternativeWholesaler = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Part import")] public bool PartCategoryID { get { return _PartCategoryID; } set { if (_PartCategoryID != value) { _PartCategoryID = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Part import")] public bool PartCost { get { return _PartCost; } set { if (_PartCost != value) { _PartCost = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Part import")] public bool PartManufacturer { get { return _PartManufacturer; } set { if (_PartManufacturer != value) { _PartManufacturer = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Part import")] public bool PartNotes { get { return _PartNotes; } set { if (_PartNotes != value) { _PartNotes = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Part import")] public bool PartRetail { get { return _PartRetail; } set { if (_PartRetail != value) { _PartRetail = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Part import")] public bool PartTrackSerialNumber { get { return _PartTrackSerialNumber; } set { if (_PartTrackSerialNumber != value) { _PartTrackSerialNumber = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Part import")] public bool PartUnitOfMeasureID { get { return _PartUnitOfMeasureID; } set { if (_PartUnitOfMeasureID != value) { _PartUnitOfMeasureID = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Part import")] public bool PartUPC { get { return _PartUPC; } set { if (_PartUPC != value) { _PartUPC = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Part import")] public bool PartWholesaler { get { return _PartWholesaler; } set { if (_PartWholesaler != value) { _PartWholesaler = value; IsDirty = true; } } } #endregion Part #region Unit [Browsable(false)] public bool UnitUpdate { get { return _UnitClientID || _UnitModelID || _UnitNotes || _UnitPurchasedFromVendor || _UnitReceipt || _UnitPurchasedDate || _UnitDescription || _UnitMetered || _UnitWarrantyLength; } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Unit import")] public bool UnitClientID { get { return _UnitClientID; } set { if (_UnitClientID != value) { _UnitClientID = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Unit import")] public bool UnitModelID { get { return _UnitModelID; } set { if (_UnitModelID != value) { _UnitModelID = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Unit import")] public bool UnitNotes { get { return _UnitNotes; } set { if (_UnitNotes != value) { _UnitNotes = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Unit import")] public bool UnitPurchasedFromVendor { get { return _UnitPurchasedFromVendor; } set { if (_UnitPurchasedFromVendor != value) { _UnitPurchasedFromVendor = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Unit import")] public bool UnitReceipt { get { return _UnitReceipt; } set { if (_UnitReceipt != value) { _UnitReceipt = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Unit import")] public bool UnitPurchasedDate { get { return _UnitPurchasedDate; } set { if (_UnitPurchasedDate != value) { _UnitPurchasedDate = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Unit import")] public bool UnitDescription { get { return _UnitDescription; } set { if (_UnitDescription != value) { _UnitDescription = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Unit import")] public bool UnitMetered { get { return _UnitMetered; } set { if (_UnitMetered != value) { _UnitMetered = value; IsDirty = true; } } } //case 1739 [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Unit import")] public bool UnitWarrantyLength { get { return _UnitWarrantyLength; } set { if (_UnitWarrantyLength != value) { _UnitWarrantyLength = value; IsDirty = true; } } } #endregion Unit #region Rate [Browsable(false)] public bool RateUpdate { get { return _RateDescription || _RateAccountNumber || _RateCost || _RateCharge || _RateContractRate || _RateType || _RateUnitChargeDescription || _RateAccountNumber || _RateClientGroup || _RateRegion; } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Rate import")] public bool RateDescription { get { return _RateDescription; } set { if (_RateDescription != value) { _RateDescription = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Rate import")] public bool RateAccountNumber { get { return _RateAccountNumber; } set { if (_RateAccountNumber != value) { _RateAccountNumber = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Rate import")] public bool RateCost { get { return _RateCost; } set { if (_RateCost != value) { _RateCost = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Rate import")] public bool RateCharge { get { return _RateCharge; } set { if (_RateCharge != value) { _RateCharge = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Rate import")] public bool RateContractRate { get { return _RateContractRate; } set { if (_RateContractRate != value) { _RateContractRate = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Rate import")] public bool RateType { get { return _RateType; } set { if (_RateType != value) { _RateType = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Rate import")] public bool RateUnitChargeDescription { get { return _RateUnitChargeDescription; } set { if (_RateUnitChargeDescription != value) { _RateUnitChargeDescription = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Rate import")] public bool RateClientGroup { get { return _RateClientGroup; } set { if (_RateClientGroup != value) { _RateClientGroup = value; IsDirty = true; } } } [DescriptionAttribute("True=overwrite this field if duplicate record, false=do not overwrite on duplicate"), DefaultValueAttribute(false), CategoryAttribute("Rate import")] public bool RateRegion { get { return _RateRegion; } set { if (_RateRegion != value) { _RateRegion = value; IsDirty = true; } } } #endregion Rate #region Mappings case 1588 [Browsable(false)] public string ClientLastMapping { get { return _ClientLastMapping; } set { if (_ClientLastMapping != value) _ClientLastMapping = value; IsDirty = true; } } [Browsable(false)] public string PartLastMapping { get { return _PartLastMapping; } set { if (_PartLastMapping != value) _PartLastMapping = value; IsDirty = true; } } [Browsable(false)] public string UnitLastMapping { get { return _UnitLastMapping; } set { if (_UnitLastMapping != value) _UnitLastMapping = value; IsDirty = true; } } [Browsable(false)] public string AssemblyLastMapping { get { return _AssemblyLastMapping; } set { if (_AssemblyLastMapping != value) _AssemblyLastMapping = value; IsDirty = true; } } //case 2072 [Browsable(false)] public string WorkorderStatusLastMapping { get { return _WorkorderStatusLastMapping; } set { if (_WorkorderStatusLastMapping != value) _WorkorderStatusLastMapping = value; IsDirty = true; } } [Browsable(false)] public string WorkorderCategoryLastMapping { get { return _WorkorderCategoryLastMapping; } set { if (_WorkorderCategoryLastMapping != value) _WorkorderCategoryLastMapping = value; IsDirty = true; } } [Browsable(false)] public string WorkorderItemTypeLastMapping { get { return _WorkorderItemTypeLastMapping; } set { if (_WorkorderItemTypeLastMapping != value) _WorkorderItemTypeLastMapping = value; IsDirty = true; } } [Browsable(false)] public string UnitServiceTypeLastMapping { get { return _UnitServiceTypeLastMapping; } set { if (_UnitServiceTypeLastMapping != value) _UnitServiceTypeLastMapping = value; IsDirty = true; } } [Browsable(false)] public string PriorityLastMapping { get { return _PriorityLastMapping; } set { if (_PriorityLastMapping != value) _PriorityLastMapping = value; IsDirty = true; } } [Browsable(false)] public string PartCategoryLastMapping { get { return _PartCategoryLastMapping; } set { if (_PartCategoryLastMapping != value) _PartCategoryLastMapping = value; IsDirty = true; } } [Browsable(false)] public string RateLastMapping { get { return _RateLastMapping; } set { if (_RateLastMapping != value) _RateLastMapping = value; IsDirty = true; } } #endregion case 1588 #endregion props public IECSVData() { // // TODO: Add constructor logic here // } #region XML in/out /// /// Set - Sets the fields in this object based on the contents of the xml string /// Get - Get's the fields of this object in the format of an xml string /// [BrowsableAttribute(false)] public string XMLData { get { System.Text.StringBuilder sb = new System.Text.StringBuilder(); System.Xml.XmlTextWriter w = new System.Xml.XmlTextWriter(new StringWriter(sb)); w.Formatting = System.Xml.Formatting.Indented; w.WriteStartDocument(true); w.WriteStartElement("ImportExportCSVSettings"); #region Client // w.WriteElementString("ClientUpdate", XmlConvert.ToString(_ClientUpdate)); w.WriteElementString("ClientPostalAddress", XmlConvert.ToString(_ClientPostalAddress)); w.WriteElementString("ClientPhysicalAddress", XmlConvert.ToString(_ClientPhysicalAddress)); w.WriteElementString("ClientContact", XmlConvert.ToString(_ClientContact)); w.WriteElementString("ClientContactNotes", XmlConvert.ToString(_ClientContactNotes)); w.WriteElementString("ClientPhoneNumbers", XmlConvert.ToString(_ClientPhoneNumbers)); w.WriteElementString("ClientEmail", XmlConvert.ToString(_ClientEmail)); w.WriteElementString("ClientWebSite", XmlConvert.ToString(_ClientWebSite)); w.WriteElementString("ClientAccountNumber", XmlConvert.ToString(_ClientAccountNumber)); w.WriteElementString("ClientNotes", XmlConvert.ToString(_ClientNotes)); w.WriteElementString("ClientTechNotes", XmlConvert.ToString(_ClientTechNotes)); w.WriteElementString("ClientPopupNotes", XmlConvert.ToString(_ClientPopupNotes)); //case 1737 w.WriteElementString("ClientGroup", XmlConvert.ToString(_ClientGroup)); w.WriteElementString("ClientDispatchZone", XmlConvert.ToString(_ClientDispatchZone)); w.WriteElementString("ClientRegion", XmlConvert.ToString(_ClientRegion)); #endregion client #region Part w.WriteElementString("PartName", XmlConvert.ToString(_PartName)); w.WriteElementString("PartAlternativeWholesaler", XmlConvert.ToString(_PartAlternativeWholesaler)); w.WriteElementString("PartCategoryID", XmlConvert.ToString(_PartCategoryID)); w.WriteElementString("PartCost", XmlConvert.ToString(_PartCost)); w.WriteElementString("PartManufacturer", XmlConvert.ToString(_PartManufacturer)); w.WriteElementString("PartNotes", XmlConvert.ToString(_PartNotes)); w.WriteElementString("PartRetail", XmlConvert.ToString(_PartRetail)); w.WriteElementString("PartTrackSerialNumber", XmlConvert.ToString(_PartTrackSerialNumber)); w.WriteElementString("PartUnitOfMeasureID", XmlConvert.ToString(_PartUnitOfMeasureID)); w.WriteElementString("PartUPC", XmlConvert.ToString(_PartUPC)); w.WriteElementString("PartWholesaler", XmlConvert.ToString(_PartWholesaler)); //w.WriteElementString("PartUpdate", XmlConvert.ToString(_PartUpdate)); #endregion Part #region Unit //w.WriteElementString("UnitUpdate", XmlConvert.ToString(_UnitUpdate)); w.WriteElementString("UnitClientID", XmlConvert.ToString(_UnitClientID)); w.WriteElementString("UnitModelID", XmlConvert.ToString(_UnitModelID)); w.WriteElementString("UnitNotes", XmlConvert.ToString(_UnitNotes)); w.WriteElementString("UnitPurchasedFromVendor", XmlConvert.ToString(_UnitPurchasedFromVendor)); w.WriteElementString("UnitReceipt", XmlConvert.ToString(_UnitReceipt)); w.WriteElementString("UnitPurchasedDate", XmlConvert.ToString(_UnitPurchasedDate)); w.WriteElementString("UnitDescription", XmlConvert.ToString(_UnitDescription)); w.WriteElementString("UnitMetered", XmlConvert.ToString(_UnitMetered)); //case 1739 w.WriteElementString("UnitWarrantyLength", XmlConvert.ToString(_UnitWarrantyLength)); #endregion unit //case 2072 #region Rate w.WriteElementString("RateDescription", XmlConvert.ToString(_RateDescription)); w.WriteElementString("RateAccountNumber", XmlConvert.ToString(_RateAccountNumber)); w.WriteElementString("RateCost", XmlConvert.ToString(_RateCost)); w.WriteElementString("RateCharge", XmlConvert.ToString(_RateCharge)); w.WriteElementString("RateContractRate", XmlConvert.ToString(_RateContractRate)); w.WriteElementString("RateType", XmlConvert.ToString(_RateType)); w.WriteElementString("RateUnitChargeDescription", XmlConvert.ToString(_RateUnitChargeDescription)); w.WriteElementString("RateAccountNumber", XmlConvert.ToString(_RateAccountNumber)); w.WriteElementString("RateClientGroup", XmlConvert.ToString(_RateClientGroup)); w.WriteElementString("RateRegion", XmlConvert.ToString(_RateRegion)); #endregion Rate #region Mappings w.WriteElementString("ClientLastMapping", _ClientLastMapping); w.WriteElementString("PartLastMapping", _PartLastMapping); w.WriteElementString("UnitLastMapping", _UnitLastMapping); w.WriteElementString("AssemblyLastMapping", _AssemblyLastMapping); //case 2072 w.WriteElementString("WorkorderStatusLastMapping", _WorkorderStatusLastMapping); w.WriteElementString("WorkorderCategoryLastMapping", _WorkorderCategoryLastMapping); w.WriteElementString("WorkorderItemTypeLastMapping", _WorkorderItemTypeLastMapping); w.WriteElementString("UnitServiceTypeLastMapping", _UnitServiceTypeLastMapping); w.WriteElementString("PriorityLastMapping", _PriorityLastMapping); w.WriteElementString("PartCategoryLastMapping", _PartCategoryLastMapping); w.WriteElementString("RateLastMapping", _RateLastMapping); #endregion mappings w.WriteEndElement(); w.WriteEndDocument(); w.Flush(); w.Close(); return sb.ToString(); } set { // Load the XML file. XmlDocument xmldoc = new XmlDocument(); try { xmldoc.LoadXml(value); } catch (Exception ex) { throw new ApplicationException("Error: exception in ImportExportCSVSettings::XMLData.set()->LoadXml:\r\n." + ex.Message, ex.InnerException); } #region Client //_ClientUpdate = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/ClientUpdate").InnerText); _ClientPostalAddress = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/ClientPostalAddress").InnerText); _ClientPhysicalAddress = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/ClientPhysicalAddress").InnerText); _ClientContact = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/ClientContact").InnerText); _ClientContactNotes = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/ClientContactNotes").InnerText); _ClientPhoneNumbers = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/ClientPhoneNumbers").InnerText); _ClientEmail = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/ClientEmail").InnerText); _ClientWebSite = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/ClientWebSite").InnerText); _ClientAccountNumber = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/ClientAccountNumber").InnerText); _ClientNotes = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/ClientNotes").InnerText); _ClientTechNotes = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/ClientTechNotes").InnerText); _ClientPopupNotes = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/ClientPopupNotes").InnerText); //case 1737 new fields if (xmldoc.SelectSingleNode("/ImportExportCSVSettings/ClientGroup") != null) { _ClientGroup = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/ClientGroup").InnerText); _ClientDispatchZone = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/ClientDispatchZone").InnerText); _ClientRegion = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/ClientRegion").InnerText); } #endregion client #region Part _PartName = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/PartName").InnerText); _PartAlternativeWholesaler = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/PartAlternativeWholesaler").InnerText); _PartCategoryID = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/PartCategoryID").InnerText); _PartCost = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/PartCost").InnerText); _PartManufacturer = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/PartManufacturer").InnerText); _PartNotes = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/PartNotes").InnerText); _PartRetail = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/PartRetail").InnerText); _PartTrackSerialNumber = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/PartTrackSerialNumber").InnerText); _PartUnitOfMeasureID = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/PartUnitOfMeasureID").InnerText); _PartUPC = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/PartUPC").InnerText); _PartWholesaler = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/PartWholesaler").InnerText); //_PartUpdate = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/PartUpdate").InnerText); #endregion Part #region Unit //_UnitUpdate = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/UnitUpdate").InnerText); _UnitClientID = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/UnitClientID").InnerText); _UnitModelID = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/UnitModelID").InnerText); _UnitNotes = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/UnitNotes").InnerText); _UnitPurchasedFromVendor = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/UnitPurchasedFromVendor").InnerText); _UnitReceipt = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/UnitReceipt").InnerText); _UnitPurchasedDate = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/UnitPurchasedDate").InnerText); _UnitDescription = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/UnitDescription").InnerText); _UnitMetered = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/UnitMetered").InnerText); //case 1737 new fields if (xmldoc.SelectSingleNode("/ImportExportCSVSettings/UnitWarrantyLength") != null) { _ClientGroup = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/ImportExportCSVSettings/UnitWarrantyLength").InnerText); } #endregion unit //FUTURE: items are going to have to check for presence of nodes before attempting to retrieve them #region Mappings case 1588 //These need to check for existence as they were added later in v7 update case 1588 if (xmldoc.SelectSingleNode("/ImportExportCSVSettings/ClientLastMapping") != null) _ClientLastMapping = xmldoc.SelectSingleNode("/ImportExportCSVSettings/ClientLastMapping").InnerText; else _ClientLastMapping = ""; if (xmldoc.SelectSingleNode("/ImportExportCSVSettings/PartLastMapping") != null) _PartLastMapping = xmldoc.SelectSingleNode("/ImportExportCSVSettings/PartLastMapping").InnerText; else _PartLastMapping = ""; if (xmldoc.SelectSingleNode("/ImportExportCSVSettings/UnitLastMapping") != null) _UnitLastMapping = xmldoc.SelectSingleNode("/ImportExportCSVSettings/UnitLastMapping").InnerText; else _UnitLastMapping = ""; if (xmldoc.SelectSingleNode("/ImportExportCSVSettings/AssemblyLastMapping") != null) _AssemblyLastMapping = xmldoc.SelectSingleNode("/ImportExportCSVSettings/AssemblyLastMapping").InnerText; else _AssemblyLastMapping = ""; //case 2072 if (xmldoc.SelectSingleNode("/ImportExportCSVSettings/RateLastMapping") != null) _RateLastMapping = xmldoc.SelectSingleNode("/ImportExportCSVSettings/RateLastMapping").InnerText; else _RateLastMapping = ""; //---------------------- if (xmldoc.SelectSingleNode("/ImportExportCSVSettings/WorkorderStatusLastMapping") != null) _WorkorderStatusLastMapping = xmldoc.SelectSingleNode("/ImportExportCSVSettings/WorkorderStatusLastMapping").InnerText; else _WorkorderStatusLastMapping = ""; //---------------------- if (xmldoc.SelectSingleNode("/ImportExportCSVSettings/WorkorderCategoryLastMapping") != null) _WorkorderCategoryLastMapping = xmldoc.SelectSingleNode("/ImportExportCSVSettings/WorkorderCategoryLastMapping").InnerText; else _WorkorderCategoryLastMapping = ""; //---------------------- if (xmldoc.SelectSingleNode("/ImportExportCSVSettings/WorkorderItemTypeLastMapping") != null) _WorkorderItemTypeLastMapping = xmldoc.SelectSingleNode("/ImportExportCSVSettings/WorkorderItemTypeLastMapping").InnerText; else _WorkorderItemTypeLastMapping = ""; //---------------------- if (xmldoc.SelectSingleNode("/ImportExportCSVSettings/UnitServiceTypeLastMapping") != null) _UnitServiceTypeLastMapping = xmldoc.SelectSingleNode("/ImportExportCSVSettings/UnitServiceTypeLastMapping").InnerText; else _UnitServiceTypeLastMapping = ""; //---------------------- if (xmldoc.SelectSingleNode("/ImportExportCSVSettings/PriorityLastMapping") != null) _PriorityLastMapping = xmldoc.SelectSingleNode("/ImportExportCSVSettings/PriorityLastMapping").InnerText; else _PriorityLastMapping = ""; //---------------------- if (xmldoc.SelectSingleNode("/ImportExportCSVSettings/PartCategoryLastMapping") != null) _PartCategoryLastMapping = xmldoc.SelectSingleNode("/ImportExportCSVSettings/PartCategoryLastMapping").InnerText; else _PartCategoryLastMapping = ""; //---------------------- #endregion mappings } } #endregion } }