public ActionResult Edit([Bind()] Models.ViewModels.ObserveRoomInfos.Edit.Edit targetV)
        {
            if (ModelState.IsValid)
            {
                var db = new Models.Domains.Entities.EiSDbContext();

                var target = db.ObserveRoomInfos.Find(targetV.ObserveRoomInfoId);
                if (target == null)
                {
                    return(HttpNotFound());
                }

                targetV.GetReturn(target);

                Models.BusinessModels.TrasenInformationConvertor.FromEmployeeNumberToName(target);

                db.SaveChanges();

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

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

            ViewBag.BedId = targetW.Beds;
            ViewBag.InObserveRoomWayId  = targetW.InObserveRoomWays;
            ViewBag.DestinationId       = targetW.Destinations;
            ViewBag.DestinationFirstId  = targetW.DestinationFirsts;
            ViewBag.DestinationSecondId = targetW.DestinationSeconds;
            ViewBag.TransferReasonId    = targetW.TransferReasons;

            return(View(targetV));
        }
        /// <summary>
        /// 编辑。
        /// </summary>
        /// <param name="id">留观室病例ID。</param>
        public ActionResult Edit(Guid id)
        {
            var db = new Models.Domains.Entities.EiSDbContext();

            var target = db.ObserveRoomInfos.Find(id);

            if (target == null)
            {
                return(HttpNotFound());
            }

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

            ViewBag.BedId = targetW.Beds;
            ViewBag.InObserveRoomWayId  = targetW.InObserveRoomWays;
            ViewBag.DestinationId       = targetW.Destinations;
            ViewBag.DestinationFirstId  = targetW.DestinationFirsts;
            ViewBag.DestinationSecondId = targetW.DestinationSeconds;
            ViewBag.TransferReasonId    = targetW.TransferReasons;

            return(View(targetV));
        }