Esempio n. 1
0
        public ActionResult Create([Bind()] Models.ViewModels.RescueRoomConsultations.Create.Create targetV)
        {
            if (ModelState.IsValid)
            {
                var db = new EiSDbContext();

                var target = targetV.GetReturn();

                Models.BusinessModels.TrasenInformationConvertor.FromEmployeeNumberToName(target);

                db.RescueRoomConsultations.Add(target);
                db.SaveChanges();

                //处理返回页面
                if (targetV.GoToGreenPath == true)
                {
                    var rescueRoomInfo = db.RescueRoomInfos.Find(targetV.RescueRoomInfoId);

                    return(RedirectToAction(rescueRoomInfo.GreenPathActionName, "GreenPaths", new { id = rescueRoomInfo.GreenPathId }));
                }

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

            var targetW = new Models.ViewModels.RescueRoomConsultations.Create.SelectionWorker(targetV);

            ViewBag.ConsultationDepartmentId = targetW.ConsultationDepartments;

            return(View(targetV));
        }
Esempio n. 2
0
        /// <summary>
        /// 新增。
        /// </summary>
        /// <param name="rescueRoomInfoId">归属的抢救室病例ID。</param>
        /// <param name="goToGreenPath">指定跳转到绿色通道表单。(后续参数忽略)</param>
        public ActionResult Create(Guid rescueRoomInfoId, bool goToGreenPath = false)
        {
            var db = new EiSDbContext();

            var rescueRoomInfo = db.RescueRoomInfos.Find(rescueRoomInfoId);

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

            var targetV = new Models.ViewModels.RescueRoomConsultations.Create.Create();
            var targetW = new Models.ViewModels.RescueRoomConsultations.Create.SelectionWorker(targetV);

            targetV.RescueRoomInfoId = rescueRoomInfoId;
            targetV.RequestTime      = DateTime.Today;
            targetV.GoToGreenPath    = goToGreenPath;

            ViewBag.ConsultationDepartmentId = targetW.ConsultationDepartments;

            return(View(targetV));
        }