Ejemplo n.º 1
0
        public PackageManagementUserCtrl(string supplierID)
        {
            InitializeComponent();

            this.supplierID = supplierID;
            productList     = ppda.findProductPackagesBySupplierID(supplierID, Language.getLanguageCode(), conn);

            genPackageID();

            searchPriceFormTextBox.Text = "1";
            searchPriceToTextBox.Text   = "300";

            searchReleaseFromDateTime.Value = DateTime.Now.Date.AddMonths(-18);
            searchReleaseToDateTime.Value   = DateTime.Now.Date;
        }
Ejemplo n.º 2
0
        private void showStockAlert()
        {
            if (setting.stockAlert)
            {
                string alertMessage = null;

                ProductPackageDA ppda  = new ProductPackageDA();
                List <Package>   pList = ppda.findProductPackagesBySupplierID(supplierID, Language.getLanguageCode(), conn);
                foreach (Package p in pList)
                {
                    if (p.getQtyInStock() < 1)
                    {
                        alertMessage += "\n - " + p.getProductName();
                    }
                }

                if (alertMessage != null)
                {
                    alertMessage               = rs.GetString("stockAlertNoItemMsg") + alertMessage + "\n";
                    stockAlertLabel.Text       = alertMessage;
                    stockAlertGroupBox.Visible = true;
                }
            }
        }
Ejemplo n.º 3
0
        private void showStockAlert(string supplierID, string productCategory)
        {
            if (setting.stockAlert)
            {
                string alertMessage = null;

                if (productCategory.Equals("Bottle"))
                {
                    StringCollection showedStockAlertBottle = setting.showedStockAlertBottle;
                    ProductBottleDA  pbda  = new ProductBottleDA();
                    List <Bottle>    bList = pbda.findProductBottlesBySupplierID(supplierID, Language.getLanguageCode(), conn);
                    foreach (Bottle b in bList)
                    {
                        if (b.getQtyInStock() < 1)
                        {
                            if (!showedStockAlertBottle.Contains(b.getProductID()))
                            {
                                alertMessage += "\n - " + b.getProductName();
                                showedStockAlertBottle.Add(b.getProductID());
                                setting.Save();
                            }
                        }
                        else
                        {
                            showedStockAlertBottle.Remove(b.getProductID());
                            setting.Save();
                        }
                    }
                }
                if (productCategory.Equals("Package"))
                {
                    StringCollection showedStockAlertPackage = setting.showedStockAlertPackage;
                    ProductPackageDA ppda  = new ProductPackageDA();
                    List <Package>   pList = ppda.findProductPackagesBySupplierID(supplierID, Language.getLanguageCode(), conn);
                    foreach (Package p in pList)
                    {
                        if (p.getQtyInStock() < 1)
                        {
                            if (!showedStockAlertPackage.Contains(p.getProductID()))
                            {
                                alertMessage += "\n - " + p.getProductName();
                                showedStockAlertPackage.Add(p.getProductID());
                                setting.Save();
                            }
                        }
                        else
                        {
                            showedStockAlertPackage.Remove(p.getProductID());
                            setting.Save();
                        }
                    }
                }
                if (productCategory.Equals("Perfume"))
                {
                    StringCollection showedStockAlertPerfume = setting.showedStockAlertPerfume;
                    ProductPerfumeDA ppda  = new ProductPerfumeDA();
                    List <Perfume>   pList = ppda.findProductPerfumeBySupplierID(supplierID, Language.getLanguageCode(), conn);
                    foreach (Perfume p in pList)
                    {
                        if (p.getQtyInStock() < 50)
                        {
                            if (!showedStockAlertPerfume.Contains(p.getProductID()))
                            {
                                alertMessage += "\n - " + p.getProductName();
                                showedStockAlertPerfume.Add(p.getProductID());
                                setting.Save();
                            }
                        }
                        else
                        {
                            showedStockAlertPerfume.Remove(p.getProductID());
                            setting.Save();
                        }
                    }
                }

                if (alertMessage != null)
                {
                    if (productCategory.Equals("Perfume"))
                    {
                        alertMessage = rs.GetString("stockAlertMsg") + alertMessage;
                    }
                    else
                    {
                        alertMessage = rs.GetString("stockAlertNoItemMsg") + alertMessage;
                    }

                    MessageBox.Show(alertMessage, rs.GetString("stockAlertTitle"));
                }
            }
        }