Ejemplo n.º 1
0
        public ActionResult Edit([Bind()] Models.ViewModels.RescueRoomInfos2.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.IsRescueRoom);
                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.RescueRoomInfos2.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));
        }
Ejemplo n.º 2
0
        public ActionResult Edit(Guid id)
        {
            var targetV = new Models.ViewModels.RescueRoomInfos2.Edit.Edit(id);
            var targetW = new Models.ViewModels.RescueRoomInfos2.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));
        }