public ActionResult ReduceQuantity(string removeCartID, int removeProductID)
        {
            // using (var _db = new WingtipToys.Models.ProductContext())

            using (var _db = new InventoryDb())
            {
                try
                {
                    var myItem = (from item in _db.ShoppingCartItems where item.CartId == removeCartID && item.Product.Id == removeProductID select item).FirstOrDefault();
                    if (myItem != null)
                    {
                        // Remove Item.
                        myItem.Quantity--;
                        myItem.Product.Quantity++;

                        _db.SaveChanges();
                    }
                }
                catch (Exception exp)
                {
                    throw new Exception("ERROR: Unable to Remove Cart Item - " + exp.Message.ToString(), exp);
                }
            }

            return(RedirectToAction("Index"));
        }
Example #2
0
        public List <ConsumptionReport_Result> GetcounsumptionReport(int productId, DateTime startDate, DateTime endDate, int tenantId)
        {
            List <Item> response = new List <Item>();
            var         db       = new InventoryDb();

            return(db.ConsumptionReport(productId, startDate, endDate, tenantId).ToList());
        }
Example #3
0
        public List <FetchReport_Result> GetItemsByDate(DateTime startDate, DateTime endDate, int tenantId)
        {
            List <Item> response = new List <Item>();
            var         db       = new InventoryDb();

            return(db.FetchReport(startDate, endDate, tenantId).ToList());
        }
Example #4
0
        public List <StockingItemsReport_Result> GetProductStockingItem(DateTime startDate, DateTime endDate, int tenantId)
        {
            var db            = new InventoryDb();
            var stockingitems = db.StockingItemsReport(startDate, endDate, tenantId).ToList();

            return(stockingitems);
            // return db.StockReport(productId, startDate, endDate).ToList();
        }
Example #5
0
        public List <PeriodicReport_Result> GetProductStock(int productId, DateTime startDate, DateTime endDate, int tenantId)
        {
            var db    = new InventoryDb();
            var stock = db.PeriodicReport(productId, startDate, endDate, tenantId).ToList();

            return(stock);
            // return db.StockReport(productId, startDate, endDate).ToList();
        }
 public new void Dispose()
 {
     if (_db != null)
     {
         _db.Dispose();
         _db = null;
     }
 }
Example #7
0
 public PostgreEssence(InventoryDb db)
     : base(db)
 {
 }
 internal InventoryItemRepository(InventoryDb context)
 {
     this.db = context;
 }
 public InventoryItemRepository()
 {
     this.db = new InventoryDb();
 }
Example #10
0
        public List <ThreshHold_Result> Getthreshhold(int tenantId)
        {
            var db = new InventoryDb();

            return(db.ThreshHold(tenantId).OrderByDescending(o => o.ProductId).ToList());
        }
Example #11
0
        public List <SiCategoryReport_Result> Getsicategorystock(int categoryId, int tenantid)
        {
            var db = new InventoryDb();

            return(db.SiCategoryReport(categoryId, tenantid).ToList());
        }
Example #12
0
        public List <CategorySReport_Result> Getscategorystock(int categoryId, int productId, int tenantid)
        {
            var db = new InventoryDb();

            return(db.CategorySReport(categoryId, productId, tenantid).ToList());
        }
Example #13
0
        public List <StockReport_Result> GetProductStock(int productId, int tenantId)
        {
            var db = new InventoryDb();

            return(db.StockReport(productId, tenantId).ToList());
        }
        public List <TransactionReport_Result> GetTransactionreport(int productId, DateTime fromdate, DateTime todate, int tenantId)
        {
            var db = new InventoryDb();

            return(db.TransactionReport(productId, fromdate, todate, tenantId).ToList());
        }
 internal ProductCategoryRepository(InventoryDb context)
 {
     this.db = context;
 }
 public ProductCategoryRepository()
 {
     this.db = new InventoryDb();
 }