Beispiel #1
0
        public ActionResult Edit([Bind()] Models.ViewModels.ResuscitateRoomInfos.Edit.Edit targetV)
        {
            if (ModelState.IsValid)
            {
                var db3 = new Models.Domains3.Entities.EiSDbContext();

                var target = db3.GeneralRoomInfos.FirstOrDefault(c => c.GeneralRoomInfoId == targetV.GeneralRoomInfoId && c.Room.IsResuscitateRoom);
                if (target == null)
                {
                    return(HttpNotFound());
                }

                targetV.GetReturn(target);

                Models.BusinessModels.TrasenInformationConvertor.FromEmployeeNumberToName(target);

                db3.SaveChanges();

                return(RedirectToAction("Details", new { id = targetV.GeneralRoomInfoId }));
            }

            var targetW = new Models.ViewModels.ResuscitateRoomInfos.Edit.SelectionWorker(targetV);

            ViewBag.BedId               = targetW.Beds;
            ViewBag.InRoomWayId         = targetW.InRoomWays;
            ViewBag.GreenPathCategoryId = targetW.GreenPathCategories;
            ViewBag.RescueResultId      = targetW.RescueResults;
            ViewBag.DestinationId       = targetW.Destinations;
            ViewBag.CriticalLevelId     = targetW.CriticalLevels;
            ViewBag.DestinationFirstId  = targetW.DestinationFirsts;
            ViewBag.DestinationSecondId = targetW.DestinationSeconds;
            ViewBag.TransferReasonId    = targetW.TransferReasons;

            return(View(targetV));
        }
Beispiel #2
0
        public ActionResult Edit(Guid id)
        {
            var targetV = new Models.ViewModels.ResuscitateRoomInfos.Edit.Edit(id);
            var targetW = new Models.ViewModels.ResuscitateRoomInfos.Edit.SelectionWorker(targetV);

            ViewBag.BedId               = targetW.Beds;
            ViewBag.InRoomWayId         = targetW.InRoomWays;
            ViewBag.GreenPathCategoryId = targetW.GreenPathCategories;
            ViewBag.RescueResultId      = targetW.RescueResults;
            ViewBag.DestinationId       = targetW.Destinations;
            ViewBag.CriticalLevelId     = targetW.CriticalLevels;
            ViewBag.DestinationFirstId  = targetW.DestinationFirsts;
            ViewBag.DestinationSecondId = targetW.DestinationSeconds;
            ViewBag.TransferReasonId    = targetW.TransferReasons;

            return(View(targetV));
        }