Beispiel #1
0
        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"));
        }
Beispiel #2
0
        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();
            //  }
        }