Esempio n. 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 CardiologicalPCIItem();

                    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 }));
            }
        }
Esempio n. 2
0
 public ActionResult Create()
 {
     ViewBag.activeInv = "active";
     try
     {
         using (var db = new StoreContext())
         {
             this.OrganizeViewBugs(db);
             var item = new CardiologicalPCIItem();
             return(View("InputForm", item));
         }
     }
     catch (Exception ex)
     {
         return(RedirectToAction("Index", "Error", new { msg = ex.Message }));
     }
 }