Beispiel #1
0
        // Նոր ավելացված ֆունկցիա
        public ActionResult CreateWithResident(int?id)
        {
            ViewBag.activeRec = "active";
            try
            {
                using (var db = new StoreContext())
                {
                    this.OrganizeViewBugs(db);
                    Resident resident = db.Residents.Find(id);
                    var      item     = new CardiologicalExaminationItem();

                    item.ResidentId             = resident.ResidentId;
                    item.PatientId              = resident.PatientId;
                    item.ResidentFirstName      = resident.ResidentFirstName;
                    item.ResidentLastName       = resident.ResidentLastName;
                    item.ResidentPatronymicName = resident.ResidentPatronymicName;
                    item.BirthDate              = resident.BirthDate;

                    return(View("InputForm", item));
                }
            }
            catch (Exception ex)
            {
                return(RedirectToAction("Index", "Error", new { msg = ex.Message }));
            }
        }
Beispiel #2
0
 public ActionResult Create()
 {
     ViewBag.activeExm = "active";
     try
     {
         using (var db = new StoreContext())
         {
             this.OrganizeViewBugs(db);
             var item = new CardiologicalExaminationItem();
             return(View("InputForm", item));
         }
     }
     catch (Exception ex)
     {
         return(RedirectToAction("Index", "Error", new { msg = ex.Message }));
     }
 }
Beispiel #3
0
 public ActionResult Details(int?id)
 {
     using (var db = new StoreContext())
     {
         if (id == null)
         {
             return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
         }
         CardiologicalExaminationItem cardiologicalExaminationItem = db.CardiologicalExaminationItems.Find(id);
         if (cardiologicalExaminationItem == null)
         {
             return(HttpNotFound());
         }
         else
         {
             return(View("Details", cardiologicalExaminationItem));
         }
     }
 }