Beispiel #1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            //输入用户变量
            int    Id       = Convert.ToInt32(Request.QueryString["id"]);
            int    flowId   = Convert.ToInt32(Request.QueryString["flowId"]);
            int    stepNo   = Convert.ToInt32(this.txtNodeId.Text);
            string stepName = this.txtNodeName.Text;
            string nodeType = this.ddlNodeType.SelectedValue;

            //验证
            //处理
            Process.MODEL prcsModi = Process.GetCache(Id);//Process.NewDataModel(Id);
            prcsModi.StepNo.set(stepNo);
            prcsModi.Name.set(stepName);
            prcsModi.NodeType.set(nodeType);
            prcsModi.Next_Nodes.set(this.GetNextNodeIdList());
            prcsModi.Notby.set(this.GetNextNodeIdList2());
            int iR = prcsModi.Update();

            //if (stepNo > 1)
            //{
            //    string sSql = String.Format("Update FL_Process set Next_Nodes=(case when Next_Nodes is null then '{2}' when Next_Nodes='' then '{2}' else Next_Nodes+','+'{2}' end) where FlowId={0} and StepNo={1}", flowId, stepNo - 1, stepNo);
            //    ULCode.QDA.XSql.Execute(sSql);
            //}
            //错误
            if (iR != 0)
            {
                string listUrl = this.MenuBar1.CurIndex == 4 ? String.Format("Flow_Prcs_VmlList.aspx?Id={0}", flowId) : String.Format("Flow_Prcs_List.aspx?Id={0}", flowId);
                ULCode.Debug.Confirm(this, "修改步骤成功,是否回到流程设计页?", listUrl, this.Request.Url.ToString());
            }
            else
            {
                ULCode.Debug.Alert(this, "修改步骤失败!");
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            //获取id
            //*******************************************************
            //1.验证用户权限
            if (!this.Master.A_Edit)
            {
                Response.Write("你没有权限访问此功能!");
                Response.End();
                return;
            }
            //2.取得用户变量
            string flowId         = Request.QueryString["flowId"];
            string nodeId         = Request.QueryString["id"];
            string userList       = this.hidden_UserList.Value;
            string dutyList       = this.hidden_RoleList.Value;
            string departmentList = this.hidden_DepartmentList.Value;

            //下面语句是UI开发人员的语句,后台开发人员需删除掉。


            //以下代码由后台开发人员填写
            //3.验证用户变量,包含Request.QueryString及Request.Form
            if (string.IsNullOrEmpty(flowId))
            {
                return;
            }
            if (string.IsNullOrEmpty(nodeId))
            {
                return;
            }
            //4.业务处理过程
            Process.MODEL process = Process.GetCache(Convert.ToInt32(nodeId)); //Process.NewDataModel(nodeId);
            process.Priv_UserList.set(userList);
            process.Priv_DutyList.set(dutyList);
            process.Priv_DeptList.set(departmentList);
            process.UpdateTable.set(drop_UpdateTable.SelectedValue);
            process.UpdateKeyValue.set(keyvalue.Text);
            int row = process.Update();

            //填写主要业务逻辑代码

            //5.(用户及业务对象)统计与状态

            //6.登记日志
            if (row != 0)
            {
                //WX.Main.AddLog(WX.LogType.Default, "经办权限设置成功!", "");
                ULCode.Debug.Alert("经办权限设置成功!", "Flow_Prcs_List.aspx?FlowId=" + flowId);
            }
            else
            {
                ULCode.Debug.Alert(this, "经办权限设置设置失败!");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!ULCode.Validation.IsNumber(Convert.ToString(Request.QueryString["flowid"])) ||
                    !ULCode.Validation.IsNumber(Convert.ToString(Request.QueryString["id"])))
                {
                    ULCode.Debug.we("你没有权限访问此功能!");
                    return;
                }
                string flowId = Request.QueryString["flowId"];
                string nodeId = Request.QueryString["id"];

                Process.MODEL process = Process.GetCache(Convert.ToInt32(nodeId)); //Process.NewDataModel(nodeId);
                if (process.Priv_UserList.value != null)
                {
                    string userList = string.Empty;
                    this.hidden_UserList.Value = process.Priv_UserList.value.ToString();

                    this.txtUserList.Text = CommonUtils.GetRealNameListByUserIdList(process.Priv_UserList.value.ToString());
                }
                if (process.Priv_DutyList.value != null)
                {
                    string dutyList  = string.Empty;
                    string dutyValue = process.Priv_DutyList.value.ToString();
                    this.hidden_RoleList.Value = dutyValue;
                    this.txtRoleList.Text      = CommonUtils.GetDutyNameListByDutyIdList(process.Priv_DutyList.value.ToString());
                }
                if (process.Priv_DeptList.value != null)
                {
                    string deptList  = string.Empty;
                    string deptValue = process.Priv_DeptList.value.ToString();
                    this.hidden_DepartmentList.Value = deptValue;

                    this.txtDepartmentList.Text = CommonUtils.GetDeptNameListByDeptIdList(process.Priv_DeptList.value.ToString());
                }
                if (process.UpdateTable.ToString() != "")
                {
                    drop_UpdateTable.SelectedValue = process.UpdateTable.ToString();
                }
                keyvalue.Text = process.UpdateKeyValue.ToString();
            }
        }
Beispiel #4
0
        private void LoadData()
        {
            int flowId = Convert.ToInt32(Request.QueryString["flowid"]);
            int Id     = Convert.ToInt32(Request.QueryString["id"]);

            WX.Flow.Model.Flow.MODEL flow = WX.Flow.Model.Flow.GetCache(flowId); //WX.Flow.Model.Flow.NewDataModel(flowId);
            flow.LoadProcessList(true);

            Process.MODEL process = WX.Flow.Model.Process.GetCache(Id); //Process.NewDataModel(Id);
            process.LoadNextProcessList(true);
            process.LoadNotbyProcessList(true);
            this.txtNodeId.Text            = process.StepNo.ToString();
            this.txtNodeName.Text          = process.Name.ToString();
            this.ddlNodeType.SelectedValue = process.NodeType.ToString();

            if (process.NextProcessList != null)
            {
                foreach (Process.MODEL prcs in process.NextProcessList)
                {
                    this.ListBox1.Items.Add(new ListItem(String.Format("{0},{1}", prcs.StepNo, prcs.Name), prcs.StepNo.ToString()));
                }
            }
            foreach (Process.MODEL prcs in process.NotbyProcessList)
            {
                this.ListBox3.Items.Add(new ListItem(String.Format("{0},{1}", prcs.StepNo, prcs.Name), prcs.StepNo.ToString()));
            }
            if (flow.ProcessList != null)
            {
                foreach (Process.MODEL prcs in flow.ProcessList)
                {
                    if (process.NextProcessList == null || !process.NextProcessList.Exists(delegate(Process.MODEL prcs_dele) { return(prcs.Id.ToInt32() == prcs_dele.Id.ToInt32()); }))
                    {
                        this.ListBox2.Items.Add(new ListItem(String.Format("{0},{1}", prcs.StepNo, prcs.Name), prcs.StepNo.ToString()));
                    }
                    if (process.NotbyProcessList == null || !process.NotbyProcessList.Exists(delegate(Process.MODEL prcs_dele) { return(prcs.Id.ToInt32() == prcs_dele.Id.ToInt32()); }))
                    {
                        this.ListBox4.Items.Add(new ListItem(String.Format("{0},{1}", prcs.StepNo, prcs.Name), prcs.StepNo.ToString()));
                    }
                }
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            //输入用户变量
            int    stepNo   = Convert.ToInt32(this.txtNodeId.Text);
            string stepName = this.txtNodeName.Text;
            string nodeType = this.ddlNodeType.SelectedValue;
            int    flowId   = Convert.ToInt32(Request.QueryString["id"]);

            //验证
            //处理
            Process.MODEL prcsNew = Process.NewDataModel();
            prcsNew.StepNo.set(stepNo);
            prcsNew.Name.set(stepName);
            prcsNew.NodeType.set(nodeType);
            prcsNew.FlowId.set(flowId);
            Point point = this.GetDefault_VMLPoint(stepNo);

            prcsNew.VML_Left.set(point.X);
            prcsNew.VML_Top.set(point.Y);
            prcsNew.Next_Nodes.set(this.GetNextNodeIdList());
            prcsNew.Notby.set(this.GetNextNodeIdList2());
            int iR = prcsNew.Insert(true);

            if (stepNo > 1)
            {
                string sSql = String.Format("Update FL_Process set Next_Nodes=(case when Next_Nodes is null then '{2}' when Next_Nodes='' then '{2}' else Next_Nodes+','+'{2}' end) where FlowId={0} and StepNo={1}", flowId, stepNo - 1, stepNo);
                ULCode.QDA.XSql.Execute(sSql);
            }
            //错误
            if (iR > 0)
            {
                prcsNew.SaveIntoCaches();
                string listUrl = this.MenuBar1.CurIndex == 4 ? String.Format("Flow_Prcs_VmlList.aspx?Id={0}", flowId) :String.Format("Flow_Prcs_List.aspx?Id={0}", flowId);
                ULCode.Debug.Confirm(this, "添加步骤成功,是否继续添加?", this.Request.Url.ToString(), listUrl);
            }
            else
            {
                ULCode.Debug.Alert(this, "添加步骤失败!");
            }
        }