public ActionResult ProcessPurchase(string dDate) { DateTime ddDate = DateTime.Parse(dDate).Date; InventoryManger iManage = new InventoryManger(); int a = iManage.ProcessPurchaseInward(ddDate, false); //TODO: instead of product item . it should list purchase invoice with item if (a > 0) { var dm = db.ProductItems.Include(c => c.MainCategory); ViewBag.MessageHead = "No of Product Item added and stock is created are " + a; return View(dm); } else { ViewBag.MessageHead = "No Product items added. Some error might has been occured. a=" + a; return View(new ProductItem()); } }
public ActionResult ProcessPurchase(string dDate) { DateTime ddDate = DateTime.Parse(dDate).Date; InventoryManger iManage = new InventoryManger(); int a = iManage.ProcessPurchaseInward(ddDate, false); //TODO: instead of product item . it should list purchase invoice with item if (a > 0) { var dm = db.ProductPurchases.Include(c => c.PurchaseItems).Where(c => DbFunctions.TruncateTime(c.InWardDate) == DbFunctions.TruncateTime(ddDate)); ViewBag.MessageHead = "Invoices added and No. Of Items Added are " + a; return(View(dm.ToList())); } else { //TODO: In view Check for Model is null or not ViewBag.MessageHead = "No Product items added. Some error might has been occured. a=" + a; return(View(new List <ProductPurchase>())); } }
public IActionResult ProcessPurchase(string dDate) { HelperUtil.IsSessionSet(HttpContext); DateTime ddDate = DateTime.Parse(dDate).Date; int StoreId = HelperUtil.GetStoreID(HttpContext); InventoryManger iManage = new InventoryManger(StoreId); int a = iManage.ProcessPurchaseInward(db, ddDate, false); if (a > 0) { return(RedirectToAction("ProcessedPurchase", new { id = a, onDate = ddDate })); } else { //TODO: In view Check for Model is null or not ViewBag.MessageHead = "No Product items added. Some error might has been occurred. a=" + a; return(View(new List <ProductPurchase> ())); } }