public ActionResult Create(DrugModel model, string DrugType) { try { var dbo = new DrugBusiness(); if (dbo.nameexists(model.DrugCode, DrugType)) { ModelState.AddModelError("", "Drug already exists, you can only increase quantity & change price for drug"); return(View(model)); } dbo.CreateMethod(model, DrugType); foreach (DrugModel dg in dbo.GetAll()) { ViewBag.DrugName = dg.DrugName; } //TempData["msg"] = "Data has been successfully saved"; return(RedirectToAction("Index")); } catch (DataException) { return(View(model)); } }
public ActionResult Create() { var dbo = new DrugBusiness(); //return View(); return(PartialView()); }
public ActionResult Delete(int id, DrugModel model) { try { var dbo = new DrugBusiness(); dbo.PostDeleteMethod(id); TempData["msg"] = "Data has been Deleted"; return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Update(int id, DrugModel model) { try { var dbo = new DrugBusiness(); dbo.PostReviewMethod(model); TempData["msg"] = "Data has been successfully Updated"; return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Details(int?id) { var dbo = new DrugBusiness(); return(PartialView(dbo.DetailsMethod(id))); }
public ActionResult Update(int id) { var dbo = new DrugBusiness(); return(PartialView(dbo.GetReviewMethod(id))); }