public ActionResult StockIn() { var model = new StockInCreateVM(); model.Categories = db.Categories.ToList(); ViewBag.ProductDropDown = new SelectListItem[] { new SelectListItem() { Value = "", Text = "Select..." } }; return(View(model)); }
public ActionResult StockIn(StockInCreateVM stockInCreate) { if (ModelState.IsValid) { StockIn stock = Mapper.Map <StockIn>(stockInCreate); db.StockIns.Add(stock); if (db.SaveChanges() > 0) { ViewBag.Message = "Data Has been saved Successfully"; } return(RedirectToAction("StockIn")); } return(View()); }
public ActionResult StockIn(StockInCreateVM model) { //insert logic against stockcreate StockIn stockIn = Mapper.Map <StockIn>(model); db.StockIns.Add(stockIn); if (db.SaveChanges() > 0) { ViewBag.Message = "Successful!"; } model.Categories = db.Categories.ToList(); model.Parties = _partyManager.GetAll().ToList(); ViewBag.ProductDropDown = new SelectListItem[] { new SelectListItem() { Value = "", Text = "Select..." } }; return(View(model)); }
public ActionResult StockIn(StockInCreateVM model) { return(View()); }