Example #1
0
        /********  获取数据  可修改区域 Start  ********/
        private Model.WF_WorkFlow_Model GetNewDataModel(HttpContext context)
        {
            Model.WF_WorkFlow_Model model = new Model.WF_WorkFlow_Model();
            if (IsEdit)
            {
                model = bll.GetModelByKeyValue(_pKeyValue);

                if (null == model)
                {
                    throw new HasNotRecordException(_pKeyValue);
                }
            }

            model.ID = string.IsNullOrWhiteSpace(_pKeyValue) ? 0 : int.Parse(_pKeyValue);

            model.WorkFlowID = UrlHelper.ReqIntByGetOrPost(context, "WorkFlowID");

            model.WorkFlowName = UrlHelper.ReqStrByGetOrPost(context, "WorkFlowName");

            model.Remark = UrlHelper.ReqStrByGetOrPost(context, "Remark");

            model.CreateTime = UrlHelper.ReqDateTimeByGetOrPost(context, "CreateTime");

            model.WFAdministrator = UrlHelper.ReqStrByGetOrPost(context, "WFAdministrator");

            model.Enabled = UrlHelper.ReqBoolByGetOrPost(context, "Enabled");

            return(model);
        }
Example #2
0
        private void OptData()
        {
            /********   可修改区域 Start  ********/
            Model.WF_WorkFlow_Model model = GetNewDataModel(CurrentContext);
            /********   可修改区域 End  ********/

            bool   issuccess = false;
            string msg       = string.Empty;

            try
            {
                if (IsAdd)
                {
                    issuccess = bll.AddModel(model);
                    msg       = issuccess ? "添加成功。" : "添加失败!";
                }
                else
                {
                    issuccess = bll.UpdateModel(model);
                    msg       = issuccess ? "修改成功。" : "修改失败!";
                }
            }
            catch (Exception ex)
            {
                issuccess = false;
                msg       = string.Format("{0} {1}", msg, ex.Message);
            }
            ReturnMsg(issuccess, enumReturnTitle.OptData, msg);
        }