Ejemplo n.º 1
0
        private void OptData()
        {
            /********   可修改区域 Start  ********/
            Model.WF_Node_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);
        }
Ejemplo n.º 2
0
        /********  获取数据  可修改区域 Start  ********/
        private Model.WF_Node_Model GetNewDataModel(HttpContext context)
        {
            Model.WF_Node_Model model = new Model.WF_Node_Model();
            if (IsEdit)
            {
                model = bll.GetModelByKeyValue(_pKeyValue);

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

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

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

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

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

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

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

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

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

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

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

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

            model.CanPassPercent = UrlHelper.ReqFloatByGetOrPost(context, "CanPassPercent");

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

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

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

            return(model);
        }