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); } }
private void SettingsForm_FormClosed(object sender, FormClosedEventArgs e) { try { CommonFunctions.SelectProductLine(CommonFunctions.SelectedProductLineIndex, false); } catch (Exception ex) { CommonFunctions.ShowErrorDialog("SettingsForm.SettingsForm_FormClosed()", ex); } }
private void cmbBoxProductLines_SelectedIndexChanged(object sender, EventArgs e) { try { //if (cmbBoxProductLines.SelectedIndex + 1 == CommonFunctions.SelectedProductLineIndex) return; CommonFunctions.SelectProductLine(Int32.Parse((cmbBoxProductLines.SelectedIndex + 1).ToString()), true); LoadSettings(); } catch (Exception ex) { CommonFunctions.ShowErrorDialog("SettingsForm.cmbBoxProductLines_SelectedIndexChanged()", ex); } }
private void toolStripComboBoxProductLine_SelectedIndexChanged(object sender, EventArgs e) { try { if (toolStripComboBoxProductLine.SelectedIndex + 1 == CommonFunctions.SelectedProductLineIndex) { return; } if (MdiChildren.Length > 0) { toolStripComboBoxProductLine.SelectedIndex = CommonFunctions.SelectedProductLineIndex - 1; MessageBox.Show(this, "Cannot change Product Line, while working in Current Product Line.\nClose other windows to select another Product Line.", "Product Line", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } MasterSheetSelected = false; toolStripOrderMasterPath.Text = ""; if (toolStripComboBoxProductLine.SelectedItem.ToString().Equals("<Create New>")) { ManageProductLineForm ObjManageProductLineForm = new ManageProductLineForm(); ShowChildForm(ObjManageProductLineForm); ObjManageProductLineForm.FormClosed += new FormClosedEventHandler(ObjManageProductLineForm_FormClosed); } else { CommonFunctions.SelectProductLine(Int32.Parse((toolStripComboBoxProductLine.SelectedIndex + 1).ToString())); MessageBox.Show(this, "Product Line changed to " + toolStripComboBoxProductLine.SelectedItem, "Product Line", MessageBoxButtons.OK, MessageBoxIcon.Information); statusStrip.Focus(); } } catch (Exception ex) { CommonFunctions.ShowErrorDialog("MainForm.toolStripComboBoxProductLine_SelectedIndexChanged()", ex); } }