private void AcceptAndPersistDataChanges() { maskingSource.WriteXmlSchema(MaskingSourceSchemaFileName); maskingSource.WriteXml(MaskingSourceFileName); maskingSource.AcceptChanges(); MessageBox.Show("The action(s) has been performed successfully.", Constants.MessageBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void SetDefaultMaskingSourceSchema(MaskingSource maskingSource) { if (File.Exists(MaskingSourceFileName)) { File.Delete(MaskingSourceFileName); } try { // Workflow DataRow drWF = dtWorkflow.NewRow(); drWF["WorkflowId"] = "1"; drWF["WorkflowVal"] = "Default"; dtWorkflow.Rows.Add(drWF); // Product DataRow drPN = dtProduct.NewRow(); drPN["ProductId"] = "1"; drPN["ProductVal"] = "Default"; dtProduct.Rows.Add(drPN); } catch (Exception ex) { throw; } //Configuration - 1 for TXT -Rec Type = 0 DataRow drMS = dtSource.NewRow(); drMS["SourceId"] = "1"; drMS["ConfigurationName"] = "Print ImageSD Configuration "; drMS["RecordType"] = "N/A"; drMS["FileExtensionTargets"] = "TXT"; drMS["SubType"] = "GEFLEET"; drMS["FileExtnType"] = FileExtnType.PrintImageSD.ToString(); dtSource.Rows.Add(drMS); DataRow drMC = dtConfiguration.NewRow(); drMC["SourceId"] = "1"; drMC["ConfigurationId"] = "1"; drMC["SettingName"] = "AccountNo"; drMC["PageNumber"] = "2"; drMC["RowNo"] = "8"; drMC["StartPos"] = "119"; drMC["FieldLength"] = "10"; drMC["Workflow"] = "Default"; drMC["Product"] = "Default"; dtConfiguration.Rows.Add(drMC); drMC = dtConfiguration.NewRow(); drMC["SourceId"] = "1"; drMC["ConfigurationId"] = "2"; drMC["SettingName"] = "AddressLine1"; drMC["PageNumber"] = "1"; drMC["RowNo"] = "18"; drMC["StartPos"] = "14"; drMC["FieldLength"] = "30"; drMC["Workflow"] = "Default"; drMC["Product"] = "Default"; dtConfiguration.Rows.Add(drMC); drMC = dtConfiguration.NewRow(); drMC["SourceId"] = "1"; drMC["ConfigurationId"] = "3"; drMC["SettingName"] = "Address Lines"; drMC["PageNumber"] = "1"; drMC["RowNo"] = "20,22,24,26"; drMC["StartPos"] = "14"; drMC["FieldLength"] = "30"; drMC["Workflow"] = "Default"; drMC["Product"] = "Default"; dtConfiguration.Rows.Add(drMC); maskingSource.WriteXmlSchema(MaskingSourceSchemaFileName); maskingSource.WriteXml(MaskingSourceFileName); maskingSource.AcceptChanges(); maskingSource.Clear(); }