Пример #1
0
 public static Boolean GetAttributeValue(XmlNode Node, String AttributeName, out String Value)
 {
     Value = "";
     try
     {
         foreach (XmlAttribute Attribute in Node.Attributes)
         {
             if (Attribute.Name.Equals(AttributeName, StringComparison.InvariantCultureIgnoreCase))
             {
                 if (String.IsNullOrEmpty(Attribute.Value))
                 {
                     return(false);
                 }
                 Value = Attribute.Value;
                 return(true);
             }
         }
         return(false);
     }
     catch (Exception ex)
     {
         CommonFunctions.ShowErrorDialog("XMLFileUtils.GetAttributeValue-String", ex);
         return(false);
     }
 }
Пример #2
0
        public SellerOrderSheetForm()
        {
            try
            {
                InitializeComponent();
                MasterFilePath          = CommonFunctions.MasterFilePath;
                txtBoxOutputFolder.Text = System.IO.Path.GetDirectoryName(MasterFilePath);

                ListColors = new List <Color>();
                ListColors.Add(Color.FromArgb(184, 204, 228));
                ListColors.Add(Color.FromArgb(218, 238, 243));
                ListColors.Add(Color.FromArgb(216, 228, 188));
                ListColors.Add(Color.FromArgb(228, 223, 236));
                ListColors.Add(Color.FromArgb(255, 255, 153));
                ListColors.Add(Color.FromArgb(224, 224, 224));
                ListColors.Add(Color.FromArgb(178, 255, 102));
                ListColors.Add(Color.FromArgb(255, 178, 102));
                ListColors.Add(Color.FromArgb(255, 153, 153));
                ListColors.Add(Color.FromArgb(51, 255, 153));

                CommonFunctions.ResetProgressBar();
            }
            catch (Exception ex)
            {
                CommonFunctions.ShowErrorDialog("SellerOrderSheetForm.ctor()", ex);
            }
        }
Пример #3
0
        public void LoadSettingsFromNode(XmlNode Node)
        {
            try
            {
                switch (Node.Name.ToUpper())
                {
                case "GENERAL":
                    GeneralSettings.ReadSettingsFromNode(Node);
                    break;

                case "INVOICE":
                    InvoiceSettings.ReadSettingsFromNode(Node, ReportType.INVOICE);
                    break;

                case "QUOTATION":
                    QuotationSettings.ReadSettingsFromNode(Node, ReportType.QUOTATION);
                    break;

                case "PURCHASEORDER":
                    PurchaseOrderSettings.ReadSettingsFromNode(Node, ReportType.PURCHASEORDER);
                    break;

                default: break;
                }
            }
            catch (Exception ex)
            {
                CommonFunctions.ShowErrorDialog("Settings.LoadSettingsFromNode()", ex);
            }
        }
Пример #4
0
        private void chkListBoxLine_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (chkListBoxLine.SelectedIndex == 0)
                {
                    CheckState checkstate = chkListBoxLine.GetItemCheckState(0);
                    if (PrevAllLinesCheckState != checkstate)
                    {
                        for (int i = 1; i < chkListBoxLine.Items.Count; i++)
                        {
                            chkListBoxLine.SetItemCheckState(i, checkstate);
                        }
                    }
                }
                else if (chkListBoxLine.GetItemCheckState(chkListBoxLine.SelectedIndex) == CheckState.Unchecked)
                {
                    chkListBoxLine.SetItemCheckState(0, CheckState.Unchecked);
                }
                else if (chkListBoxLine.CheckedItems.Count == chkListBoxLine.Items.Count - 1)
                {
                    chkListBoxLine.SetItemCheckState(0, CheckState.Checked);
                }

                PrevAllLinesCheckState = chkListBoxLine.GetItemCheckState(0);
            }
            catch (Exception ex)
            {
                CommonFunctions.ShowErrorDialog("VendorPurchaseOrderForm.chkListBoxLine_SelectedIndexChanged", ex);
            }
        }
Пример #5
0
        public void ReadSettingsFromNode(XmlNode Node)
        {
            try
            {
                SettingsNode = Node;

                String Value;
                XMLFileUtils.GetChildNodeValue(SettingsNode, "MainFormTitle", out MainFormTitleText);
                if (XMLFileUtils.GetChildNodeValue(SettingsNode, "ReportRowsFromTop", out Value))
                {
                    ReportRowsFromTop = Int32.Parse(Value);
                }
                if (XMLFileUtils.GetChildNodeValue(SettingsNode, "ReportAppendRowsAtBottom", out Value))
                {
                    ReportAppendRowsAtBottom = Int32.Parse(Value);
                }
                XMLFileUtils.GetChildNodeValue(SettingsNode, "LogoFileName", out LogoFileName);
                if (XMLFileUtils.GetChildNodeValue(SettingsNode, "LogoImageHeight", out Value))
                {
                    LogoImageHeight = Int32.Parse(Value);
                }
            }
            catch (Exception ex)
            {
                CommonFunctions.ShowErrorDialog("ApplicationSettings.ReadSettingsFromNode()", ex);
            }
        }
Пример #6
0
        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);
            }
        }
Пример #7
0
        private void CreateItemSummarySheet(DataRow[] drItems, Excel.Workbook xlWorkbook, ReportSettings CurrReportSettings)
        {
            try
            {
                lblStatus.Text = "Creating Item Summary Sheet";
                #region Print Item Summary Sheet
                Int32           SummaryStartRow    = 0;
                Double          Total              = 0;
                Excel.Worksheet xlSummaryWorkSheet = xlWorkbook.Worksheets.Add(xlWorkbook.Sheets[1]);
                xlSummaryWorkSheet.Name = "Item Summary";
                xlSummaryWorkSheet.Cells[SummaryStartRow + 1, 1].Value = "Sl.No.";
                xlSummaryWorkSheet.Cells[SummaryStartRow + 1, 2].Value = "Stock Name";
                xlSummaryWorkSheet.Cells[SummaryStartRow + 1, 3].Value = "Vendor Name";
                xlSummaryWorkSheet.Cells[SummaryStartRow + 1, 4].Value = "Quantity";
                xlSummaryWorkSheet.Cells[SummaryStartRow + 1, 5].Value = "Price";
                xlSummaryWorkSheet.Cells[SummaryStartRow + 1, 6].Value = "Total";
                Excel.Range xlRange1 = xlSummaryWorkSheet.Range[xlSummaryWorkSheet.Cells[SummaryStartRow + 1, 1], xlSummaryWorkSheet.Cells[SummaryStartRow + 1, 6]];
                xlRange1.Font.Bold = true;

                HashSet <String> ListItems = new HashSet <String>();
                for (int i = 0, j = 0; i < drItems.Length; i++)
                {
                    if (ListItems.Contains(drItems[i]["StockName"].ToString()))
                    {
                        continue;
                    }
                    xlSummaryWorkSheet.Cells[i + SummaryStartRow + 2, 1].Value        = (j + 1);
                    xlSummaryWorkSheet.Cells[i + SummaryStartRow + 2, 2].Value        = drItems[i]["StockName"].ToString();
                    xlSummaryWorkSheet.Cells[i + SummaryStartRow + 2, 3].Value        = drItems[i]["VendorName"].ToString();
                    xlSummaryWorkSheet.Cells[i + SummaryStartRow + 2, 4].Value        = drItems[i]["Quantity"].ToString();
                    xlSummaryWorkSheet.Cells[i + SummaryStartRow + 2, 5].Value        = drItems[i]["PurchasePrice"].ToString();
                    xlSummaryWorkSheet.Cells[i + SummaryStartRow + 2, 5].NumberFormat = "#,##0.00";
                    xlSummaryWorkSheet.Cells[i + SummaryStartRow + 2, 6].Value        = Double.Parse(drItems[i]["Quantity"].ToString()) * Double.Parse(drItems[i]["PurchasePrice"].ToString());
                    xlSummaryWorkSheet.Cells[i + SummaryStartRow + 2, 6].NumberFormat = "#,##0.00";
                    Total += Double.Parse(xlSummaryWorkSheet.Cells[i + SummaryStartRow + 2, 6].Value.ToString());
                    j++;
                    ListItems.Add(drItems[i]["StockName"].ToString());
                }

                Excel.Range tmpxlRange = xlSummaryWorkSheet.Cells[drItems.Length + SummaryStartRow + 2, 5];
                tmpxlRange.Value     = "Total";
                tmpxlRange.Font.Bold = true;

                tmpxlRange              = xlSummaryWorkSheet.Cells[drItems.Length + SummaryStartRow + 2, 6];
                tmpxlRange.Value        = Total;
                tmpxlRange.Font.Bold    = true;
                tmpxlRange.NumberFormat = "#,##0.00";
                xlSummaryWorkSheet.UsedRange.Columns.AutoFit();
                xlApp.DisplayAlerts = false;
                SellerInvoiceForm.AddPageHeaderAndFooter(ref xlSummaryWorkSheet, "Itemwise Summary", CurrReportSettings);
                xlApp.DisplayAlerts = true;
                #endregion
            }
            catch (Exception ex)
            {
                CommonFunctions.ShowErrorDialog("VendorPurchaseOrderForm.CreateItemSummarySheet()", ex);
                xlApp.Quit();
                CommonFunctions.ReleaseCOMObject(xlApp);
            }
        }
Пример #8
0
 public void UpdateProductInventoryDataFromInvoice(DataRow[] drProducts)
 {
     try
     {
         foreach (DataRow dr in drProducts)
         {
             ProductDetails ObjProductDetails = GetProductDetails(dr["Item Name"].ToString().Trim());
             if (ObjProductDetails == null)
             {
                 continue;
             }
             StockProductDetails ObjStockProductDetails = ListStockProducts[ObjProductDetails.StockProductIndex];
             ObjStockProductDetails.OrderQty += (Double.Parse(dr["Order Quantity"].ToString().Trim()) * ObjProductDetails.Units);
             if (dr["Sales Quantity"] == DBNull.Value)
             {
                 continue;
             }
             ObjStockProductDetails.RecvdQty += (Double.Parse(dr["Sales Quantity"].ToString().Trim()) * ObjProductDetails.Units);
             if (dr["Total"] != DBNull.Value)
             {
                 ObjStockProductDetails.TotalCost     += Double.Parse(dr["Total"].ToString().Trim());
                 ObjStockProductDetails.TotalTax      += Double.Parse(dr["TotalTax"].ToString().Trim());
                 ObjStockProductDetails.TotalDiscount += Double.Parse(dr["Discount"].ToString().Trim());
             }
             ObjStockProductDetails.IsUpdated = true;
         }
     }
     catch (Exception ex)
     {
         CommonFunctions.ShowErrorDialog("ProductMaster.UpdateProductInventoryDataFromInvoice()", ex);
         throw;
     }
 }
Пример #9
0
        void ShowChildForm(Form ObjForm)
        {
            try
            {
                if (MdiChildren.Length > 0)
                {
                    return;
                }

                CommonFunctions.ResetProgressBar();

                CommonFunctions.CurrentForm = ObjForm;
                ObjForm.MdiParent           = this;
                ObjForm.ShowIcon            = false;
                ObjForm.ShowInTaskbar       = false;
                ObjForm.MinimizeBox         = false;
                ObjForm.MaximizeBox         = false;
                ObjForm.FormBorderStyle     = System.Windows.Forms.FormBorderStyle.FixedDialog;
                ObjForm.StartPosition       = FormStartPosition.CenterScreen;
                ObjForm.FormClosed         += new FormClosedEventHandler(ChildFormClosed);
                ObjForm.Show();
            }
            catch (Exception ex)
            {
                CommonFunctions.ShowErrorDialog("MainForm.ShowChildForm()", ex);
            }
        }
Пример #10
0
 public void ResetStockProducts(Boolean Flag = false)
 {
     try
     {
         for (int i = 0; i < ListStockProducts.Count; i++)
         {
             StockProductDetails ObjStockProductDetails = ListStockProducts[i];
             ObjStockProductDetails.IsUpdated       = Flag;
             ObjStockProductDetails.IsStockOverride = false;
             ObjStockProductDetails.NetQty          = 0;
             ObjStockProductDetails.SaleQty         = 0;
             ObjStockProductDetails.OrderQty        = 0;
             ObjStockProductDetails.RecvdQty        = 0;
             ObjStockProductDetails.Inventory       = 0;
             ObjStockProductDetails.NetCost         = 0;
             ObjStockProductDetails.TotalCost       = 0;
             ObjStockProductDetails.TotalDiscount   = 0;
             ObjStockProductDetails.TotalTax        = 0;
         }
     }
     catch (Exception ex)
     {
         CommonFunctions.ShowErrorDialog("ProductMaster.ResetStockProducts()", ex);
     }
 }
Пример #11
0
        public void LoadProductInventoryFile(DataRow[] drProductInventory)
        {
            try
            {
                foreach (DataRow dr in drProductInventory)
                {
                    StockProductDetails ObjStockProductDetails = GetStockProductDetails(dr["StockName"].ToString().Trim());
                    if (ObjStockProductDetails == null)
                    {
                        continue;
                    }

                    if (dr["Stock"] != DBNull.Value)
                    {
                        ObjStockProductDetails.Inventory = Double.Parse(dr["Stock"].ToString());
                    }
                    if (dr["Units"] != DBNull.Value)
                    {
                        ObjStockProductDetails.Units = Double.Parse(dr["Units"].ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                CommonFunctions.ShowErrorDialog("ProductMaster.LoadProductInventoryFile()", ex);
                throw;
            }
        }
Пример #12
0
        public void ComputeStockNetData(String TransactionType)
        {
            try
            {
                for (int i = 0; i < ListStockProducts.Count; i++)
                {
                    StockProductDetails ObjStockProductDetails = ListStockProducts[i];
                    if (ObjStockProductDetails.IsUpdated)
                    {
                        if (ObjStockProductDetails.IsStockOverride)
                        {
                            ObjStockProductDetails.NetQty    = ObjStockProductDetails.RecvdQty;
                            ObjStockProductDetails.RecvdQty -= ObjStockProductDetails.Inventory;
                        }
                        else
                        {
                            switch (TransactionType.Trim().ToUpper())
                            {
                            case "SALE": ObjStockProductDetails.RecvdQty = -1 * ObjStockProductDetails.RecvdQty; break;

                            case "PURCHASE":
                            default: break;
                            }
                            ObjStockProductDetails.NetQty = ObjStockProductDetails.Inventory + ObjStockProductDetails.RecvdQty;
                        }
                        ObjStockProductDetails.NetCost = Math.Round(ObjStockProductDetails.TotalCost - ObjStockProductDetails.TotalDiscount + ObjStockProductDetails.TotalTax, 0);
                    }
                }
            }
            catch (Exception ex)
            {
                CommonFunctions.ShowErrorDialog("ProductMaster.ComputeStockNetData()", ex);
            }
        }
Пример #13
0
        public void AddProductToCache(ProductDetails ObjProductDetails)
        {
            try
            {
                ObjProductDetails.ItemName = ObjProductDetails.ItemName.Trim();
                if (String.IsNullOrEmpty(ObjProductDetails.StockName))
                {
                    ObjProductDetails.StockName = ObjProductDetails.ItemName;
                }
                ObjProductDetails.StockName = ObjProductDetails.StockName.Trim();

                StockProductDetails ObjStockProductDetails = new StockProductDetails();
                ObjStockProductDetails.StockName = ObjProductDetails.StockName;
                AddStockProduct(ObjStockProductDetails);

                Int32 ProductIndex = ListProducts.BinarySearch(ObjProductDetails, ObjProductDetails);
                if (ProductIndex < 0)
                {
                    ListProducts.Insert(~ProductIndex, ObjProductDetails);
                    ObjProductDetails.FillMissingPricesForPriceGroups(ListPriceGroups);
                }
            }
            catch (Exception ex)
            {
                CommonFunctions.ShowErrorDialog("ProductMaster.AddProductToCache()", ex);
            }
        }
Пример #14
0
        public static Boolean SetChildNodeValue(XmlNode Node, String ChildNodeName, String Value)
        {
            try
            {
                if (!Node.HasChildNodes)
                {
                    return(false);
                }

                foreach (XmlElement Element in Node.ChildNodes)
                {
                    if (Element.Name.Equals(ChildNodeName, StringComparison.InvariantCultureIgnoreCase))
                    {
                        //if (String.IsNullOrEmpty(Element.InnerText)) return false;
                        Element.InnerText = Value;
                        return(true);
                    }
                }
                return(false);
            }
            catch (Exception ex)
            {
                CommonFunctions.ShowErrorDialog("XMLFileUtils.SetChildNodeValue", ex);
                return(true);
            }
        }
Пример #15
0
        public Boolean LoadDetailsFromNode(XmlNode ProductLineNode)
        {
            try
            {
                this.ProductLineNode = ProductLineNode;
                XMLFileUtils.GetAttributeValue(ProductLineNode, "Name", out Name);

                ObjSettings = new Settings();
                XmlNode GeneralNode;
                XMLFileUtils.GetChildNode(ProductLineNode, "General", out GeneralNode);
                ObjSettings.LoadSettingsFromNode(GeneralNode);

                XmlNode InvoiceNode;
                XMLFileUtils.GetChildNode(ProductLineNode, "Invoice", out InvoiceNode);
                ObjSettings.LoadSettingsFromNode(InvoiceNode);

                XmlNode QuotationNode;
                XMLFileUtils.GetChildNode(ProductLineNode, "Quotation", out QuotationNode);
                ObjSettings.LoadSettingsFromNode(QuotationNode);

                XmlNode PurchaseOrderNode;
                XMLFileUtils.GetChildNode(ProductLineNode, "PurchaseOrder", out PurchaseOrderNode);
                ObjSettings.LoadSettingsFromNode(PurchaseOrderNode);

                return(true);
            }
            catch (Exception ex)
            {
                CommonFunctions.ShowErrorDialog("ProductLine.LoadDetailsFromNode()", ex);
                return(false);
            }
        }
Пример #16
0
        private void btnAddNew_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtBoxName.Text.Trim().Length == 0)
                {
                    MessageBox.Show(this, "Product Line Name cannot be empty", "Manage Product Line", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                if (CommonFunctions.ListProductLines.FindIndex(s => s.Name.Equals(txtBoxName.Text.Trim(), StringComparison.InvariantCultureIgnoreCase)) >= 0)
                {
                    MessageBox.Show(this, "Specified Product Line already exists", "Manage Product Line", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                CommonFunctions.AddNewProductLine(txtBoxName.Text.Trim(), cmbBoxProductLine.SelectedIndex);

                MessageBox.Show(this, "New ProductLine \"" + txtBoxName.Text + "\" created successfully", "Manage Product Line", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            catch (Exception ex)
            {
                CommonFunctions.ShowErrorDialog("ManageProductLineForm.btnAddNew_Click()", ex);
            }
        }
Пример #17
0
        private void FillDataGridSellers()
        {
            try
            {
                String SelectedLine = cmbBoxLineFilter.SelectedItem.ToString();
                if (SelectedLine.Equals("<All>", StringComparison.InvariantCultureIgnoreCase))
                {
                    SelectedLine = "";
                }
                else if (SelectedLine.Equals("<Blanks>", StringComparison.InvariantCultureIgnoreCase))
                {
                    SelectedLine = "Line = '' Or Line is null";
                }
                else
                {
                    SelectedLine = "Line = '" + SelectedLine + "'";
                }

                dtSellerMaster.DefaultView.RowFilter = SelectedLine;
                dtGridViewSellers.DataSource         = dtSellerMaster.DefaultView.ToTable();

                foreach (DataGridViewRow item in dtGridViewSellers.Rows)
                {
                    DataGridViewCheckBoxCell cell = (DataGridViewCheckBoxCell)item.Cells[0];
                    if (CommonFunctions.ListSelectedSellers.Contains(item.Cells[1].Value))
                    {
                        cell.Value = cell.TrueValue;
                    }
                }
            }
            catch (Exception ex)
            {
                CommonFunctions.ShowErrorDialog("SellerListForm.FillDataGridSellers()", ex);
            }
        }
Пример #18
0
        public static Boolean SetAttributeValue(XmlNode Node, String AttributeName, String Value)
        {
            try
            {
                XmlAttribute AttributeElement = null;
                if (Node.Attributes != null)
                {
                    foreach (XmlAttribute item in Node.Attributes)
                    {
                        if (item.Name.Equals(AttributeName, StringComparison.InvariantCultureIgnoreCase))
                        {
                            AttributeElement = item;
                            break;
                        }
                    }
                }

                if (AttributeElement == null)
                {
                    AttributeElement = Node.OwnerDocument.CreateAttribute(AttributeName);
                    Node.Attributes.Append(AttributeElement);
                }
                AttributeElement.Value = Value;

                return(true);
            }
            catch (Exception ex)
            {
                CommonFunctions.ShowErrorDialog("XMLFileUtils.SetAttributeValue", ex);
                return(false);
            }
        }
Пример #19
0
        public void ReadSettingsFromNode(XmlNode Node, ReportType Type)
        {
            try
            {
                SettingsNode = Node;
                this.Type    = Type;

                String Value;
                XMLFileUtils.GetChildNodeValue(SettingsNode, "HeaderTitle", out HeaderTitle);
                XMLFileUtils.GetChildNodeValue(SettingsNode, "HeaderSubTitle", out HeaderSubTitle);
                XMLFileUtils.GetChildNodeValue(SettingsNode, "FooterTitle", out FooterTitle);
                XMLFileUtils.GetChildNodeValue(SettingsNode, "Address", out Address);
                XMLFileUtils.GetChildNodeValue(SettingsNode, "PhoneNumber", out PhoneNumber);
                XMLFileUtils.GetChildNodeValue(SettingsNode, "EMailID", out EMailID);
                XMLFileUtils.GetChildNodeValue(SettingsNode, "VATPercent", out VATPercent);
                XMLFileUtils.GetChildNodeValue(SettingsNode, "TINNumber", out TINNumber);
                XMLFileUtils.GetChildNodeValue(SettingsNode, "GSTINumber", out GSTINumber);

                if (XMLFileUtils.GetChildNodeValue(SettingsNode, "LastNumber", out Value))
                {
                    LastNumber = Int32.Parse(Value);
                }

                if (XMLFileUtils.GetChildNodeValue(SettingsNode, "HeaderTitleColor", out Value))
                {
                    HeaderTitleColor = CommonFunctions.GetColor(Value);
                }
                if (XMLFileUtils.GetChildNodeValue(SettingsNode, "HeaderSubTitleColor", out Value))
                {
                    HeaderSubTitleColor = CommonFunctions.GetColor(Value);
                }
                if (XMLFileUtils.GetChildNodeValue(SettingsNode, "FooterTitleColor", out Value))
                {
                    FooterTitleColor = CommonFunctions.GetColor(Value);
                }
                if (XMLFileUtils.GetChildNodeValue(SettingsNode, "FooterTextColor", out Value))
                {
                    FooterTextColor = CommonFunctions.GetColor(Value);
                }
                XmlNode PastSalesPeriodNode;
                if (XMLFileUtils.GetChildNode(SettingsNode, "PastSalesPeriod", out PastSalesPeriodNode))
                {
                    if (XMLFileUtils.GetChildNodeValue(PastSalesPeriodNode, "Value", out Value))
                    {
                        PastSalePeriodValue = Int32.Parse(Value);
                    }
                    if (XMLFileUtils.GetChildNodeValue(PastSalesPeriodNode, "Units", out Value))
                    {
                        PastSalePeriodUnits = GetTimePeriodUnits(Value);
                    }
                }
            }
            catch (Exception ex)
            {
                CommonFunctions.ShowErrorDialog("ReportSettings.ReadSettingsFromNode()", ex);
            }
        }
Пример #20
0
        void LoadHSNMasterData(DataTable dtHSNMaster)
        {
            try
            {
                List <TaxGroupDetails> ListTaxGroupDetails = ObjProductMaster.ListTaxGroupDetails;
                ListTaxGroupDetails.Clear();

                String[] ArrTaxName = new String[] { "CGST", "SGST", "IGST" };
                String[] ArrTaxDesc = new String[] { "Central Goods and Service Tax", "State Goods and Service Tax", "Inter Goods and Service Tax" };
                for (int i = 0; i < ArrTaxName.Length; i++)
                {
                    TaxGroupDetails ObjTaxGroupDetails = new TaxGroupDetails();
                    ObjTaxGroupDetails.Name    = ArrTaxName[i]; ObjTaxGroupDetails.Description = ArrTaxDesc[i];
                    ObjTaxGroupDetails.TaxRate = 0;
                    ListTaxGroupDetails.Add(ObjTaxGroupDetails);
                }

                Int32[] TaxColIndexes = new Int32[ListTaxGroupDetails.Count];
                for (int i = 0; i < TaxColIndexes.Length; i++)
                {
                    for (int j = 0; j < dtHSNMaster.Columns.Count; j++)
                    {
                        if (dtHSNMaster.Columns[j].ColumnName.Equals(ListTaxGroupDetails[i].Name, StringComparison.InvariantCultureIgnoreCase))
                        {
                            TaxColIndexes[i] = j;
                            break;
                        }
                    }
                }

                for (int i = 0; i < dtHSNMaster.Rows.Count; i++)
                {
                    DataRow dr = dtHSNMaster.Rows[i];

                    if (dr["HSNCode"] == DBNull.Value || String.IsNullOrEmpty(dr["HSNCode"].ToString()))
                    {
                        continue;
                    }

                    HSNCodeDetails ObjHSNCodeDetails = new HSNCodeDetails();
                    ObjHSNCodeDetails.HSNCode      = dr["HSNCode"].ToString();
                    ObjHSNCodeDetails.ListTaxRates = new Double[TaxColIndexes.Length];
                    for (int j = 0; j < TaxColIndexes.Length; j++)
                    {
                        ObjHSNCodeDetails.ListTaxRates[j] = Double.Parse(dr[ListTaxGroupDetails[j].Name].ToString());
                    }

                    ObjProductMaster.AddHSNCode(ObjHSNCodeDetails);
                }
            }
            catch (Exception ex)
            {
                CommonFunctions.ShowErrorDialog("ProductLine.LoadHSNMasterData()", ex);
            }
        }
Пример #21
0
 private void dateTimePO_ValueChanged(object sender, EventArgs e)
 {
     try
     {
         txtBoxVendorOrderSheet.Text = txtBoxOutputFolder.Text + @"\VendorOrder_" + dateTimePO.Value.ToString("dd-MM-yyyy") + ".xlsx";
     }
     catch (Exception ex)
     {
         CommonFunctions.ShowErrorDialog("VendorPurchaseOrderForm.dateTimePO_ValueChanged()", ex);
     }
 }
 private void bgWorkerSellerHistory_DoWork(object sender, DoWorkEventArgs e)
 {
     try
     {
         CreateSellerReport();
     }
     catch (Exception ex)
     {
         CommonFunctions.ShowErrorDialog("SellerHistoryReportForm.bgWorkerSellerHistory_DoWork()", ex);
     }
 }
 private void bgWorkerSellerHistory_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     try
     {
         CommonFunctions.UpdateProgressBar(e.ProgressPercentage);
     }
     catch (Exception ex)
     {
         CommonFunctions.ShowErrorDialog("SellerHistoryReportForm.bgWorkerSellerHistory_ProgressChanged()", ex);
     }
 }
Пример #24
0
 public void UpdateSettingsToNode()
 {
     try
     {
         XMLFileUtils.SetChildNodeValue(SettingsNode, "SummaryLocation", SummaryLocation.ToString());
     }
     catch (Exception ex)
     {
         CommonFunctions.ShowErrorDialog("GeneralSettings.UpdateSettingsToNode()", ex);
     }
 }
Пример #25
0
 private void bgWorkerUpdPurchasesForm_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     try
     {
         CommonFunctions.UpdateProgressBar(e.ProgressPercentage);
     }
     catch (Exception ex)
     {
         CommonFunctions.ShowErrorDialog("UpdateProductPurchasesForm.bgWorkerUpdPurchasesForm_ProgressChanged()", ex);
     }
 }
Пример #26
0
 private void SellerListForm_Load(object sender, EventArgs e)
 {
     try
     {
         FillListBoxLineFilter();
     }
     catch (Exception ex)
     {
         CommonFunctions.ShowErrorDialog("SellerListForm.SellerListForm_Load()", ex);
     }
 }
Пример #27
0
 private void cmbBoxLineFilter_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         FillDataGridSellers();
     }
     catch (Exception ex)
     {
         CommonFunctions.ShowErrorDialog("SellerListForm.cmbBoxLineFilter_SelectedIndexChanged()", ex);
     }
 }
Пример #28
0
 private void bgWorkerOrderMaster_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     try
     {
         CommonFunctions.UpdateProgressBar(e.ProgressPercentage);
     }
     catch (Exception ex)
     {
         CommonFunctions.ShowErrorDialog("OrderMasterForm.bgWorkerOrderMaster_ProgressChanged()", ex);
     }
 }
Пример #29
0
 private void bgWorkerOrderMaster_DoWork(object sender, DoWorkEventArgs e)
 {
     try
     {
         LoadDetailsFromOrderMaster();
     }
     catch (Exception ex)
     {
         CommonFunctions.ShowErrorDialog("OrderMasterForm.bgWorkerOrderMaster_DoWork()", ex);
     }
 }
Пример #30
0
 private void SettingsForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     try
     {
         CommonFunctions.SelectProductLine(CommonFunctions.SelectedProductLineIndex, false);
     }
     catch (Exception ex)
     {
         CommonFunctions.ShowErrorDialog("SettingsForm.SettingsForm_FormClosed()", ex);
     }
 }