コード例 #1
0
        public ActionResult ModifyPriceApproveStep(string id)
        {
            string strErrText;

            //读取价格审批步骤数据
            FlowSystem      flow = new FlowSystem();
            ApproveFlowStep data = flow.LoadApproveFlowStep(long.Parse(id), LoginAccountId, LoginStaffName, out strErrText);

            if (data == null)
            {
                throw new Exception(strErrText);
            }

            //创建Model
            PriceApproveFlowStepViewModel model = new PriceApproveFlowStepViewModel();

            model.StepNum             = data.StepNum;
            model.StepName            = data.StepName;
            model.DisposerId          = data.DisposerId;
            model.ConditionExpression = data.ConditionExpression;

            model.Conditions = new List <PriceApproveFlowStepConditionViewModel>();
            model.Conditions.Add(new PriceApproveFlowStepConditionViewModel());

            //生成处理人下拉列表项
            StaffSystem  staff     = new StaffSystem();
            List <Staff> listStaff = staff.LoadStaffs(LoginAccountId, LoginStaffName, out strErrText);

            if (listStaff == null)
            {
                throw new Exception(strErrText);
            }
            List <SelectListItem> selectListStaff = new List <SelectListItem>();

            selectListStaff.Add(new SelectListItem {
                Text = string.Empty, Value = string.Empty
            });
            selectListStaff.AddRange(from s in listStaff
                                     select new SelectListItem
            {
                Text  = s.FullName,
                Value = s.Id.ToString()
            });
            ViewData["Disposers"] = new SelectList(selectListStaff, "Value", "Text", model.DisposerId);

            return(View(model));
        }