public ActionResult AddPrescriptionType(AddPrescriptionTypeViewModel model) { if (!ModelState.IsValid) { return(View(model)); } var db = new ApplicationDbContext(); var type = new PrescriptionType { Type = model.Type }; db.PrescriptionTypes.Add(type); db.SaveChanges(); return(RedirectToAction("AddPrescription")); }
public ActionResult AddPrescriptionType() { var model = new AddPrescriptionTypeViewModel(); return(View(model)); }