コード例 #1
0
        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"));
        }
コード例 #2
0
        public ActionResult AddPrescriptionType()
        {
            var model = new AddPrescriptionTypeViewModel();

            return(View(model));
        }