private void LoadDetailsFromOrderMaster() { try { ProductLine CurrProductLine = CommonFunctions.ListProductLines[CommonFunctions.SelectedProductLineIndex]; DataTable dtProductMaster = CommonFunctions.ReturnDataTableFromExcelWorksheet("ItemMaster", CommonFunctions.MasterFilePath, "*"); DataTable dtPriceGroupMaster = CommonFunctions.ReturnDataTableFromExcelWorksheet("PriceGroupMaster", CommonFunctions.MasterFilePath, "*"); DataTable dtHSNMaster = CommonFunctions.ReturnDataTableFromExcelWorksheet("HSNMaster", CommonFunctions.MasterFilePath, "*"); CurrProductLine.LoadProductMaster(dtProductMaster, dtPriceGroupMaster, dtHSNMaster); lblStatus.Text = "Completed loading Product details"; ReportProgressFunc(25); DataTable dtDiscountGroupMaster = CommonFunctions.ReturnDataTableFromExcelWorksheet("DiscountGroupMaster", CommonFunctions.MasterFilePath, "*"); DataTable dtSellerMaster = CommonFunctions.ReturnDataTableFromExcelWorksheet("SellerMaster", CommonFunctions.MasterFilePath, "*"); CurrProductLine.LoadSellerMaster(dtSellerMaster, dtDiscountGroupMaster); lblStatus.Text = "Completed loading Seller details"; ReportProgressFunc(50); DataTable dtVendorMaster = CommonFunctions.ReturnDataTableFromExcelWorksheet("VendorMaster", CommonFunctions.MasterFilePath, "*"); CurrProductLine.LoadVendorMaster(dtVendorMaster, dtDiscountGroupMaster); lblStatus.Text = "Completed loading Vendor details"; ReportProgressFunc(75); CommonFunctions.SelectProductLine(CommonFunctions.SelectedProductLineIndex); ReportProgressFunc(100); lblStatus.Text = "Completed loading details from OrderMaster file"; MessageBox.Show(this, "Completed loading details from OrderMaster file", "Order Master", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { CommonFunctions.ShowErrorDialog("OrderMasterForm.LoadDetailsFromOrderMaster()", ex); } }
public static void AddNewProductLine(String Name, Int32 UseSettingsOfProductLineIndex) { try { XmlNode ProductLineNode = ListProductLines[UseSettingsOfProductLineIndex].ProductLineNode.CloneNode(true); ProductLine ObjProductLine = new ProductLine(); XMLFileUtils.SetAttributeValue(ProductLineNode, "Name", Name); ObjProductLine.LoadDetailsFromNode(ProductLineNode); ListProductLines.Add(ObjProductLine); ProductLinesNode.AppendChild(ProductLineNode); } catch (Exception ex) { ShowErrorDialog("CommonFunctions.AddNewProductLine()", ex); } }
public static void LoadSettingsFile() { try { if (!File.Exists(SettingsFilePath)) { File.Copy(AppDomain.CurrentDomain.BaseDirectory + @"\Settings.xml", SettingsFilePath, false); } SettingXmlDoc = new XmlDocument(); SettingXmlDoc.Load(SettingsFilePath); XmlNode SettingsNode; XMLFileUtils.GetChildNode(SettingXmlDoc, "Settings", out SettingsNode); XmlNode ApplicationNode; XMLFileUtils.GetChildNode(SettingsNode, "Application", out ApplicationNode); ObjApplicationSettings = new ApplicationSettings(); ObjApplicationSettings.ReadSettingsFromNode(ApplicationNode); ListProductLines.Clear(); XMLFileUtils.GetChildNode(SettingsNode, "ProductLines", out ProductLinesNode); foreach (XmlNode item in ProductLinesNode.ChildNodes) { if (item.NodeType == XmlNodeType.CDATA || item.NodeType == XmlNodeType.Comment) { continue; } ProductLine ObjProductLine = new ProductLine(); if (ObjProductLine.LoadDetailsFromNode(item)) { ListProductLines.Add(ObjProductLine); } } SelectProductLine(SelectedProductLineIndex); SettingXmlDoc.NodeChanged += new XmlNodeChangedEventHandler(SettingXmlDoc_NodeChanged); } catch (Exception ex) { ShowErrorDialog("CommonFunctions.LoadSettingsFile()", ex); } }
private void SettingsForm_Load(object sender, EventArgs e) { //Load cmbBoxPeriodUnits cmbBoxPeriodUnits.Items.Clear(); cmbBoxPeriodUnits.Items.Add("Days"); cmbBoxPeriodUnits.Items.Add("Weeks"); cmbBoxPeriodUnits.Items.Add("Months"); cmbBoxPeriodUnits.Items.Add("Years"); cmbBoxPeriodUnits.SelectedIndex = 0; //Load ProductLines from CommonFunctions Module cmbBoxProductLines.Items.Clear(); for (int i = 1; i < CommonFunctions.ListProductLines.Count; i++) { ProductLine ObjProductLine = CommonFunctions.ListProductLines[i]; cmbBoxProductLines.Items.Add(ObjProductLine.Name); } cmbBoxProductLines.SelectedIndex = CommonFunctions.SelectedProductLineIndex - 1; }
void LoadProductLines() { try { //Load toolStripComboBoxProductLine from CommonFunctions.ListProductLines toolStripComboBoxProductLine.Items.Clear(); for (int i = 1; i < CommonFunctions.ListProductLines.Count; i++) { ProductLine ObjProductLine = CommonFunctions.ListProductLines[i]; toolStripComboBoxProductLine.Items.Add(ObjProductLine.Name); } toolStripComboBoxProductLine.Items.Add("<Create New>"); toolStripComboBoxProductLine.SelectedIndex = CommonFunctions.SelectedProductLineIndex - 1; } catch (Exception ex) { CommonFunctions.ShowErrorDialog("MainForm.LoadProductLines()", ex); } }