Exemplo n.º 1
0
        public void AddStock(string product, int amount, DateTime date)
        {
            AddStockManager asm = new AddStockManager();
            AddStock        a   = new AddStock();
            Product         p   = asm.GetProductByName(product);

            a.ProductId = p.Id;
            a.Amount    = amount;
            a.Date      = date;
            asm.AddStock(a);
        }
Exemplo n.º 2
0
        //
        // GET: /AddStock/

        public ActionResult Stock()
        {
            AddStockManager asm = new AddStockManager();
            ProductStock    ps  = new ProductStock();

            ps.StockList = asm.GetAddStocks();

            ps.TotalSpentOnIces     = asm.GetTotalAmountSpentOnIces();
            ps.TotalSpentOnIceCream = asm.GetTotalAmountSpentOnIceCream();
            var twin  = asm.GetTotalAmountShouldHaveMadeFromProduct(1);
            var luigi = asm.GetTotalAmountShouldHaveMadeFromProduct(2);
            var soft  = asm.GetTotalAmountShouldHaveMadeFromProduct(3);

            ps.TotalAmountShouldHaveMade = twin + luigi + soft;
            return(View(ps));
        }
Exemplo n.º 3
0
        public void DeleteStock(int id)
        {
            AddStockManager asm = new AddStockManager();

            asm.DeleteStock(id);
        }