Ejemplo n.º 1
0
        private void showRecycleBinAlert()
        {
            string alertMessage = null;

            ProductPackageDA ppda  = new ProductPackageDA();
            List <Package>   pList = ppda.findDeletedProductPackagesBySupplierID(supplierID, Language.getLanguageCode(), conn);

            foreach (Package p in pList)
            {
                if (p.getDateDeleted().Date <= DateTime.Now.Date.AddYears(-1))
                {
                    alertMessage += "\n - " + p.getProductName();
                }
            }

            if (alertMessage != null)
            {
                alertMessage = rs.GetString("recycleBinAlertMsg") + alertMessage + "\n";
                recycleBinAlertLabel.Text       = alertMessage;
                recycleBinAlertGroupBox.Visible = true;
            }
        }
Ejemplo n.º 2
0
        private void showRecycleBinAlert(string supplierID, string productCategory)
        {
            string alertMessage = null;

            if (productCategory.Equals("Bottle"))
            {
                StringCollection showedDeletedAlertBottle = setting.showedDeletedAlertBottle;
                ProductBottleDA  pbda  = new ProductBottleDA();
                List <Bottle>    bList = pbda.findDeletedProductBottlesBySupplierID(supplierID, Language.getLanguageCode(), conn);
                foreach (Bottle b in bList)
                {
                    if (b.getDateDeleted().Date <= DateTime.Now.Date.AddYears(-1))
                    {
                        if (!showedDeletedAlertBottle.Contains(b.getProductID()))
                        {
                            alertMessage += "\n - " + b.getProductName();
                            showedDeletedAlertBottle.Add(b.getProductID());
                            setting.Save();
                        }
                    }
                    else
                    {
                        showedDeletedAlertBottle.Remove(b.getProductID());
                        setting.Save();
                    }
                }
            }
            if (productCategory.Equals("Package"))
            {
                StringCollection showedDeletedAlertPackage = setting.showedDeletedAlertPackage;
                ProductPackageDA ppda  = new ProductPackageDA();
                List <Package>   pList = ppda.findDeletedProductPackagesBySupplierID(supplierID, Language.getLanguageCode(), conn);
                foreach (Package p in pList)
                {
                    if (p.getDateDeleted().Date <= DateTime.Now.Date.AddYears(-1))
                    {
                        if (!showedDeletedAlertPackage.Contains(p.getProductID()))
                        {
                            alertMessage += "\n - " + p.getProductName();
                            showedDeletedAlertPackage.Add(p.getProductID());
                            setting.Save();
                        }
                    }
                    else
                    {
                        showedDeletedAlertPackage.Remove(p.getProductID());
                        setting.Save();
                    }
                }
            }
            if (productCategory.Equals("Perfume"))
            {
                StringCollection showedDeletedAlertPerfume = setting.showedDeletedAlertPerfume;
                ProductPerfumeDA ppda  = new ProductPerfumeDA();
                List <Perfume>   pList = ppda.findDeletedProductPerfumeBySupplierID(supplierID, Language.getLanguageCode(), conn);
                foreach (Perfume p in pList)
                {
                    if (p.getDateDeleted().Date <= DateTime.Now.Date.AddYears(-1))
                    {
                        if (!showedDeletedAlertPerfume.Contains(p.getProductID()))
                        {
                            alertMessage += "\n - " + p.getProductName();
                            showedDeletedAlertPerfume.Add(p.getProductID());
                            setting.Save();
                        }
                    }
                    else
                    {
                        showedDeletedAlertPerfume.Remove(p.getProductID());
                        setting.Save();
                    }
                }
            }

            if (alertMessage != null)
            {
                alertMessage = rs.GetString("recycleBinAlertMsg") + alertMessage;
                MessageBox.Show(alertMessage, rs.GetString("recycleBinAlertTitle"));
            }
        }