private void CreditOnOffProduct(string command, bool productState)
        {
            ProductCatalog productList = new ProductCatalog();
            Product        product     = stregsystem.GetProduct(command);

            product.CanBeBoughtOnCredit = productState;

            if (productList.UpdateProduct(product))
            {
                cli.DisplayCreditOnOffProduct(product, productState);
            }
        }
        private void ActiveDeactiveProduct(string command, bool productState)
        {
            ProductCatalog productList = new ProductCatalog();
            Product        product     = stregsystem.GetProduct(command);

            product.Active = productState;

            if (productList.UpdateProduct(product))
            {
                cli.DisplayActiveDeactiveProduct(product, productState);
            }
        }
Beispiel #3
0
        public void LoadList()
        {
            TransactionsList     transactionsList       = new TransactionsList(this);
            UsersList            usersList              = new UsersList();
            ProductCatalog       productCatalog         = new ProductCatalog();
            SeasonProductCatalog seasonalProductCatalog = new SeasonProductCatalog();

            UserList            = usersList.GetList();
            ProductList         = productCatalog.GetList();
            SeasonalProductList = seasonalProductCatalog.GetList();
            BTransactionList    = transactionsList.GetBuyList();
            CTransactionList    = transactionsList.GetCashList();
        }
Beispiel #4
0
        //Gets Product a unique ID
        public int NewSeasonalProductID()
        {
            ProductCatalog productList = new ProductCatalog();
            int            highestID   = 0;

            foreach (Product product in productList.GetList())
            {
                if (product.ProductID > highestID)
                {
                    highestID = product.ProductID;
                }
            }

            return(highestID + 1);
        }