public ActionResult Create(PrescriptionProductModel prescription) { Prescription p = new Prescription(); p.PrescriptionCategoryName = prescription.name; if (Session["PrescriptionProduct"] != null) { List <Product> prescriptionProducts = (List <Product>)Session["PrescriptionProduct"]; p.Products = prescriptionProducts; } int r = ServiceFactory.GetPrescriptionService().Insert(p); return(RedirectToAction("Index")); }
public ActionResult Edit(PrescriptionProductModel prescription) { prescription.Prescription = (Prescription)Session["Prescription"]; prescription.Prescription.PrescriptionCategoryName = prescription.name; // try // { // TODO: Add update logic here ServiceFactory.GetPrescriptionService().Update(prescription.Prescription); return(RedirectToAction("Index")); // } // catch // { // return View(); // } }