Пример #1
0
        public ActionResult Delete(int id)
        {
            genericProduct genericProduct = new genericProduct("Delete");


            genericProduct.Delete(id);

            return(RedirectToAction("DisplayProduct"));
        }
Пример #2
0
        public ActionResult DisplayProduct()
        {
            genericProduct genericProduct = new genericProduct("Select");

            List <Product> productList = new List <Product>();


            productList = genericProduct.SelectAll();

            return(View(productList));
        }
Пример #3
0
        public ActionResult Edit(Product product)
        {
            List <Product> products = new List <Product>();

            products.Add(product);

            genericProduct genericProduct = new genericProduct(product, "Update");

            genericProduct.edit(productID);

            return(RedirectToAction("DisplayProduct"));
        }
Пример #4
0
        public ActionResult Products(Product modelClasses)
        {
            List <Product> products = new List <Product>();

            products.Add(modelClasses);

            genericProduct genericProduct = new genericProduct(modelClasses, "Insert");

            genericProduct.Insert();

            return(RedirectToAction("DisplayProduct"));
        }
Пример #5
0
        public ActionResult addQuantity(int Quantity)
        {
            genericProduct genericProduct = new genericProduct();

            List <Product> productList = new List <Product>();

            int q = intQ + Quantity;

            genericProduct.UpdateQuantity(prodid, q);

            return(RedirectToAction("addSaleData", new { id = prodid, curntQ = curentQ }));
        }
Пример #6
0
        public ActionResult Edit(Product product)
        {
            List <Product> products = new List <Product>();

            products.Add(product);

            genericProduct genericProduct = new genericProduct(product, "Update");

            genericProduct.edit(productID);


            return(View());
        }
Пример #7
0
        public ActionResult addSaleData(int Quantity)
        {
            genericProduct genericProduct = new genericProduct();

            List <Product> productList = new List <Product>();

            int q = curentQ - Quantity;

            genericProduct.UpdateQuantity(prodid, q);
            if (q < 5)
            {
                NotificationsDisplay notifications = new NotificationsDisplay();
                notifications.CreateAnotification("Only " + q + " products left for  " + productname, "Packeger");
            }
            return(RedirectToAction("addSaleData", new { id = prodid, curntQ = curentQ }));
        }
Пример #8
0
        public ActionResult addSaleData(int id, int curntQ)
        {
            genericProduct genericProduct = new genericProduct("Select");

            prodid  = id;
            curentQ = curntQ;

            List <Product> productList = new List <Product>();

            productList = genericProduct.SelectAll();
            Product product = new Product();

            foreach (var item in productList)
            {
                if (item.id == id)
                {
                    product     = item;
                    productname = item.ProductName;
                }
            }


            return(View(product));
        }