Beispiel #1
0
 public ActionResult Edit(patient patient)
 {
     unitOfWork.Repository<patient>().Update(patient);
     unitOfWork.Save();
     ViewBag.MaritalStatusId = new SelectList(unitOfWork.CachedRepository<maritalstatu>().Get(), "Id", "Description");
     ViewBag.PrimaryCareProviderId = new SelectList(unitOfWork.Repository<medicalprovider>().Get(), "Id", "FirstName");
     ViewBag.GenderId = new SelectList(unitOfWork.CachedRepository<gender>().Get(), "Id", "Description");
     ViewBag.TitleId = new SelectList(unitOfWork.CachedRepository<title>().Get(), "Id", "Description");
     return View(patient);
 }
Beispiel #2
0
        public ActionResult Create(patient patient)
        {
            if (ModelState.IsValid)
            {
                unitOfWork.Repository<patient>().Insert(patient);
                unitOfWork.Save();
                return RedirectToAction("Index");
            }

            ViewBag.MaritalStatusId = new SelectList(unitOfWork.CachedRepository<maritalstatu>().Get(), "Id", "Description");
            ViewBag.PrimaryCareProviderId = new SelectList(unitOfWork.Repository<medicalprovider>().Get(), "Id", "FirstName");
            ViewBag.GenderId = new SelectList(unitOfWork.CachedRepository<gender>().Get(), "Id", "Description");
            ViewBag.TitleId = new SelectList(unitOfWork.CachedRepository<title>().Get(), "Id", "Description");
            ViewBag.AddressTypeId = new SelectList(unitOfWork.CachedRepository<addresstype>().Get(), "Id", "Description");
            ViewBag.PhoneTypeId = new SelectList(unitOfWork.CachedRepository<phonetype>().Get(), "Id", "Description");
            ViewBag.EmailTypeId = new SelectList(unitOfWork.CachedRepository<emailtype>().Get(), "Id", "Description");
            return View(patient);
        }