コード例 #1
0
        public PartialViewResult AddProcess(int deviceId)
        {
            ProcessViewModel viewmodel = new ProcessViewModel();
            viewmodel.DeviceId = deviceId;
            viewmodel.Analysts = UserRes.GetAll().Where(x => x.RoleId == (int)RoleType.ANALYST || x.RoleId == (int)RoleType.MANAGER).ToList();
            viewmodel.ProcessTypes = ProcessTypeRes.GetAll();

            return PartialView("_PartialPageAddProcess", viewmodel);
        }
コード例 #2
0
        public JsonResult ConfirmAddProcess(int deviceId, ProcessViewModel viewmodel)
        {
            FARProcessHistoryDto his = new FARProcessHistoryDto()
            {
                DeviceId = deviceId,
                Analystor = viewmodel.Email,
                Comment = viewmodel.Comment,
                ProcessTypeId = viewmodel.ProcessTypeId,
                LastUpdatedBy = this.CurrentName,
                IsIncluded = true,
                SeqNum = 0,
            };
            var result = ProcessHisRep.Add(his);
            switch (result)
            {
                case Model.SaveResult.SUCCESS:
                    Response.StatusCode = (int)HttpStatusCode.OK;
                    return new JsonResult
                    {
                        Data = new { code = "SB01", Id = deviceId },
                        JsonRequestBehavior = JsonRequestBehavior.AllowGet
                    };
                case Model.SaveResult.FAILURE:
                    Response.StatusCode = (int)HttpStatusCode.BadRequest;
                    return new JsonResult
                    {
                        Data = new { code = "SB02", Id = deviceId },
                        JsonRequestBehavior = JsonRequestBehavior.AllowGet
                    };
            }

            Response.StatusCode = (int)HttpStatusCode.BadRequest;
            return new JsonResult
            {
                Data = new { code = "SB02", Id = deviceId },
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            };
        }
コード例 #3
0
        public PartialViewResult EditProcess(int id)
        {
            ProcessViewModel viewmodel = new ProcessViewModel();
            var single = ProcessHisRep.Single(id);
            viewmodel.DeviceId = single.DeviceId;
            viewmodel.ProcessTypeId = single.ProcessTypeId;
            viewmodel.Email = single.Analystor;
            viewmodel.Comment = single.Comment;
            viewmodel.Analysts = UserRes.GetAll().Where(x => x.RoleId == (int)RoleType.ANALYST || x.RoleId == (int)RoleType.MANAGER).ToList();
            viewmodel.ProcessTypes = ProcessTypeRes.GetAll();

            return PartialView("_PartialPageEditProcess", viewmodel);
        }