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")); }
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()); }
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()); }
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(); }
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; } }
public PostgreEssence(InventoryDb db) : base(db) { }
internal InventoryItemRepository(InventoryDb context) { this.db = context; }
public InventoryItemRepository() { this.db = new InventoryDb(); }
public List <ThreshHold_Result> Getthreshhold(int tenantId) { var db = new InventoryDb(); return(db.ThreshHold(tenantId).OrderByDescending(o => o.ProductId).ToList()); }
public List <SiCategoryReport_Result> Getsicategorystock(int categoryId, int tenantid) { var db = new InventoryDb(); return(db.SiCategoryReport(categoryId, tenantid).ToList()); }
public List <CategorySReport_Result> Getscategorystock(int categoryId, int productId, int tenantid) { var db = new InventoryDb(); return(db.CategorySReport(categoryId, productId, tenantid).ToList()); }
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(); }