public ActionResult AvaliableStock() { ViewStockModel model = new ViewStockModel(); // List<StockDataList> AssignedStock = _accountService.AssignedStockQty(); List <StockDataList> StockHistory = _accountService.StockHistory(); //List<StockDataList> AssignedStock = _accountService.AssignedStockQty(); model.AllStockData = StockHistory; ///model.AssignedStock = AssignedStock; return(View(model)); }
public ActionResult StockEntry() { ViewBag.CategoryList = _accountService.GetAllCategory(); //_accountService.SubCategory(); ViewBag.SubCategoryList = _accountService.SubCategory(); ViewBag.ProductList = _accountService.ProductList(); StockModel sem = new StockModel(); List <StockDataList> AllStockData = _accountService.StockInfo(); ViewStockModel model = new ViewStockModel(); model.AllStockData = AllStockData; sem.DisplayData = model; return(View(sem)); }
public ActionResult StockEntry(StockModel md) { if (ModelState.IsValid) { string currentUser = HttpContext.User.Identity.Name; int stockID = md.FormSubmit.StockID; if (stockID == 0) { bool returnresult = _accountService.EnterStock(md.FormSubmit.ProductID, md.FormSubmit.Quantity, md.FormSubmit.ManufactureDate, md.FormSubmit.ExpiryDate, md.FormSubmit.BarCode, currentUser); if (returnresult == true) { ModelState.Clear(); ViewBag.SuccessMsg = "Product created successfully"; } else { ViewBag.SuccessMsg = "Error raised while creating product successfully"; } } else { bool returnresult = _accountService.UpdateStock(md.FormSubmit.StockID, md.FormSubmit.ProductID, md.FormSubmit.Quantity, md.FormSubmit.ManufactureDate, md.FormSubmit.ExpiryDate, md.FormSubmit.BarCode); if (returnresult == true) { ModelState.Clear(); ViewBag.SuccessMsg = "Product information updated successfully"; } else { ViewBag.Failuremessage = "Unable to update please try again later!"; } } } ViewBag.CategoryList = _accountService.GetAllCategory(); ViewBag.SubCategoryList = _accountService.SubCategory(); ViewBag.ProductList = _accountService.ProductList(); StockModel sem = new StockModel(); List <StockDataList> AllStockData = _accountService.StockInfo(); ViewStockModel model = new ViewStockModel(); model.AllStockData = AllStockData; sem.DisplayData = model; return(View(sem)); }