protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Master.A_Edit)
     {
         Response.Write("你没有权限访问此功能!");
         Response.End();
         return;
     }
     if (!IsPostBack)
     {
         WX.Flow.Model.Flow.MODEL flowmodel = WX.Flow.Model.Flow.GetCache(Convert.ToInt32(Request["flowid"])); //WX.Flow.Model.Flow.GetModel("select * from FL_Flows where ID=" + Request["flowid"]);
         flowmodel.LoadForm(false);
         WX.Flow.Model.Form.MODEL    formmodel = flowmodel.Form;                                               //WX.Flow.Model.Form.GetModel("select * from FL_Forms where ID=" + flowmodel.FormId.value.ToString());
         WX.Flow.FormFieldCollection ffc       = formmodel.Items_FormFieldCollection;
         if (ffc != null)
         {
             foreach (WX.Flow.FormField ff in ffc)
             {
                 select1.Items.Add(new ListItem(ff.Text, ff.Id));
             }
         }
         WX.Flow.Model.Process.MODEL model = WX.Flow.Model.Process.GetCache(Convert.ToInt32(Request.QueryString["Id"])); //WX.Flow.Model.Process.GetModel("select * from FL_Process where ID=" + Request["id"]);
         Literal1.Text = model.StepNo.value + ":" + model.Name.value;
         WX.Flow.FormFieldCollection edit = model.Editable_FormFieldCollection;
         if (edit != null)
         {
             foreach (WX.Flow.FormField ff in edit)
             {
                 select2.Items.Add(new ListItem(ff.Text, ff.Id));
                 select1.Items.Remove(select1.Items.FindByValue(ff.Id));
             }
         }
     }
 }
        private int Save(int rRunId, int rStepId)
        {
            //1.获取模型
            WX.Flow.Model.Run.MODEL     runmodel = WX.Flow.Model.Run.NewDataModel(rRunId);
            WX.Flow.Model.Process.MODEL process  = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + runmodel.FlowId.ToString() + " and StepNo=" + (runmodel.StepNo.ToInt32() + 1));
            if (process == null)
            {
                runmodel.Deal_Flag.value = WX.Flow.DealFlag.HasOperated;
            }
            else
            {
                runmodel.Deal_Flag.value = WX.Flow.DealFlag.NotReceived;
                if (process.Next_Nodes.ToString() != "")
                {
                    runmodel.Next_Nodes.value = process.Next_Nodes.value;
                }
                else
                {
                    WX.Flow.Model.Process.MODEL proc = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + runmodel.FlowId.ToString() + " and StepNo=" + runmodel.StepNo.ToInt32());
                    runmodel.Next_Nodes.value = proc.Next_Nodes.value;
                }
                runmodel.StepNo.value = process.StepNo.value;
            }
            //2.取表单值
            runmodel.LoadMyForm(false);
            WX.Flow.FormFieldCollection ffc = runmodel.MyForm.GetPostedDatas();
            //3.上传附件并取得附件列表
            string attach_nameList = String.Empty;
            string attache_idlist  = String.Empty;
            //4.取得手写与签章信息
            int iR = runmodel.Save(rStepId, ffc, attache_idlist, attach_nameList, "", "", 0);//最后两个参数为会签意见和手写签章信息

            runmodel.Update();
            return(0);// iR;
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            //获取id
            //*******************************************************
            //1.验证用户权限
            if (!this.Master.A_Edit)
            {
                Response.Write("你没有权限访问此功能!");
                Response.End();
                return;
            }
            //2.取得用户变量
            //string prcsin = PLUG_IN_type.SelectedValue + "|" + PLUG_IN.Value + "|" + PLUG_IN_demo.Text;
            //string prcsout = PLUG_OUT_type.SelectedValue + "|" + PLUG_OUT.Value + "|" + PLUG_OUT_demo.Text;
            //下面语句是UI开发人员的语句,后台开发人员需删除掉。


            //以下代码由后台开发人员填写
            //3.验证用户变量,包含Request.QueryString及Request.Form

            //4.业务处理过程
            bool bDeal = false;

            //填写主要业务逻辑代码
            WX.Flow.Model.Process.MODEL prcs = WX.Flow.Model.Process.GetCache(Convert.ToInt32(Request.QueryString["Id"]));//WX.Flow.Model.Process.GetModel("select * from FL_Process where ID=" + Request["id"]);
            if (prcs != null)
            {
                prcs.Sign_Look.value        = SIGNLOOK.SelectedValue;
                prcs.Sign_Mode.value        = FEEDBACK.SelectedValue;
                prcs.Pass_OpForce.value     = TURN_PRIV.SelectedValue;
                prcs.Pass_RollBack.value    = ALLOW_BACK.SelectedValue;
                prcs.Sync_DealMode.value    = SYNC_DEAL.SelectedValue;
                prcs.Sync_CombineMode.value = GATHER_NODE.SelectedValue;

                if (prcs.Update() != 0)
                {
                    bDeal = true;
                }
            }
            //5.(用户及业务对象)统计与状态

            //6.登记日志
            if (bDeal)
            {
                WX.Main.AddLog(WX.LogType.Default, "流程步骤流转设置成功!", "");
            }
            else
            {
                ULCode.Debug.Alert(this, "流程步骤流转设置失败!");
            }
            Response.Redirect("Flow_Prcs_List.aspx?id=" + Request["flowId"]);
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            //获取id
            //*******************************************************
            //1.验证用户权限
            if (!this.Master.A_Edit)
            {
                Response.Write("你没有权限访问此功能!");
                Response.End();
                return;
            }
            //2.取得用户变量
            string prcsin  = PRCS_IN.Value + "|" + PRCS_IN_SET.Value + "|" + PRCS_IN_DESC.Value;
            string prcsout = PRCS_OUT.Value + "|" + PRCS_OUT_SET.Value + "|" + PRCS_OUT_DESC.Value;
            //下面语句是UI开发人员的语句,后台开发人员需删除掉。


            //以下代码由后台开发人员填写
            //3.验证用户变量,包含Request.QueryString及Request.Form

            //4.业务处理过程
            bool bDeal = false;

            //填写主要业务逻辑代码
            WX.Flow.Model.Process.MODEL prcs = WX.Flow.Model.Process.GetCache(Convert.ToInt32(Request.QueryString["Id"])); //WX.Flow.Model.Process.GetModel("select * from FL_Process where ID=" + Request["id"]);
            if (prcs != null)
            {
                prcs.Condition_In.value  = prcsin.Replace("'", "`");
                prcs.Condition_Out.value = prcsout.Replace("'", "`");

                // string sSql = String.Format("Update FL_Process set Condition_In='{0}',Condition_Out='{1}' where ID={2}", prcsin.Replace("'", "`"), prcsout.Replace("'", "`"), Request["id"]);
                if (prcs.Update() != 0)
                {
                    bDeal = true;
                }
            }
            //5.(用户及业务对象)统计与状态

            //6.登记日志
            if (bDeal)
            {
                WX.Main.AddLog(WX.LogType.Default, "流程条件设置成功!", "");
            }
            else
            {
                ULCode.Debug.Alert(this, "流程条件设置失败!");
            }
            Response.Redirect("Flow_Prcs_List.aspx?id=" + Request["flowId"]);
        }
        private string GetSysVariable(string Vname)
        {
            string returnstr = "";

            WX.WXUser cu = WX.Main.CurUser;
            WX.Flow.Model.Process.MODEL pmodel = WX.Flow.Model.Process.GetModel("select top 1 * from TE_VarDefine where Title='" + Vname + "'");
            string name = "";

            if (pmodel != null && pmodel.Name.value != null)
            {
                name = pmodel.Name.value.ToString();
            }
            switch (name)
            {
            case "PRCS_Z_UserName":
                cu.LoadUserModel(false);
                returnstr = cu.UserModel.RealName.value.ToString();
                break;

            case "PRCS_Z_UserDuty":
                cu.LoadDutyUser();
                returnstr = cu.DutyUser.Name.value.ToString();
                break;

            case "PRCS_Z_UserDept":
                cu.LoadUserModel(false);
                WX.Model.Department.MODEL dept = WX.Model.Department.GetCache(cu.UserModel.DepartmentID.ToInt32());
                //WX.Model.Department.GetModel("select * from TE_Departments where ID=" + cu.EmployeeUser.DepartmentID.value.ToString());
                returnstr = dept.Name.value.ToString();
                break;

            case "PRCS_Z_UserSupDept":
                cu.LoadUserModel(false);
                WX.Model.Department.MODEL dept2 = WX.Model.Department.GetCache(cu.UserModel.DepartmentID.ToInt32());
                //WX.Model.Department.GetModel("select * from TE_Departments where ID=" + cu.EmployeeUser.DepartmentID.value.ToString());
                dept2 = WX.Model.Department.GetCache(dept2.ParentID.ToInt32());
                //WX.Model.Department.GetModel("select * from TE_Departments where ID=" + dept2.ParentID.value.ToString());
                returnstr = dept2.Name.value.ToString();
                break;

            case "PRCS_ID": returnstr = Request["id"]; break;

            case "Datetime_Now": returnstr = DateTime.Now.ToString("yyyy-MM-dd"); break;

            default: break;
            }
            return(returnstr);
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            //Process.MODEL process = new Process.MODEL();
            WX.Flow.Model.Flow.MODEL flow = WX.Flow.Model.Flow.GetCache(rFlowId); //WX.Flow.Model.Flow.NewDataModel(rFlowId);
            flow.LoadProcessList(false);
            if (flow.GetProcessByStep(1).ExecIn(null) == 0)
            {
                ULCode.Debug.Alert(this, "程序出错,请联系管理员!");
                return;
            }
            int newRunId = flow.NewWork(this.txtSerialNumber.Text);

            this.Save(newRunId, 1);
            if (newRunId > 0)
            {
                WX.Flow.Model.Run.MODEL     runmodel = WX.Flow.Model.Run.GetModel("select * from FL_Run where Id=" + newRunId);
                WX.Flow.Model.Process.MODEL process  = WX.Flow.Model.Process.GetCache(runmodel.FlowId.ToInt32(), runmodel.StepNo.ToInt32());
                WX.Model.User.MODEL         squser   = WX.Model.User.NewDataModel(runmodel.BeginUser.ToString());
                if (process.Auto_Type.ToString() == "1")//经办人为流程发起人的
                {
                    WX.Main.MessageSend("<a href=/Manage/Work/Work_MyCheck.aspx?flag=0&mes=1>" + flow.Name.ToString() + "(" + WX.CommonUtils.GetRealNameListByUserIdList(runmodel.BeginUser.ToString()) + ")——请尽快审批!</a>", "/Manage/Main/messagelist.aspx", runmodel.BeginUser.ToString(), WX.Main.CurUser.UserID, 12, 0);
                }
                else if (process.Auto_Type.ToString() == "2")//经办人为部门主管的
                {
                    WX.Main.MessageSend("<a href=/Manage/Work/Work_MyCheck.aspx?flag=0&mes=1>" + flow.Name.ToString() + "(" + WX.CommonUtils.GetRealNameListByUserIdList(runmodel.BeginUser.ToString()) + ")——请尽快审批!</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetDeptUserID(1, "[Host]", squser.DepartmentID.ToInt32()), WX.Main.CurUser.UserID, 12, 0);
                }
                else if (process.Auto_Type.ToString() == "4")
                {
                    WX.Main.MessageSend("<a href=/Manage/Work/Work_MyCheck.aspx?flag=0&mes=1>" + flow.Name.ToString() + "(" + WX.CommonUtils.GetRealNameListByUserIdList(runmodel.BeginUser.ToString()) + ")——请尽快审批!</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetParentDeptHost(squser.DepartmentID.ToInt32(), "Host"), WX.Main.CurUser.UserID, 12, 0);
                }
                else if (process.Auto_Type.ToString() == "5")
                {
                    WX.Main.MessageSend("<a href=/Manage/Work/Work_MyCheck.aspx?flag=0&mes=1>" + flow.Name.ToString() + "(" + WX.CommonUtils.GetRealNameListByUserIdList(runmodel.BeginUser.ToString()) + ")——请尽快审批!</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetParentDeptHost(squser.DepartmentID.ToInt32(), "SubHosts"), WX.Main.CurUser.UserID, 12, 0);
                }
                else
                {
                    System.Data.DataTable dt = ULCode.QDA.XSql.GetDataTable("select UserID from Tu_Users where 1=1" + (process.Priv_UserList.ToString() != "" ? " and UserID in(" + process.Priv_UserList.ToString() + ")" : "") + (process.Priv_DutyList.ToString() != "" ? " and DutyId in(select ID from TE_DutyDetail where DutyID in(" + process.Priv_DutyList.ToString() + "))" : "") + (process.Priv_DeptList.ToString() != "" ? " and Priv_DeptList in(" + process.Priv_DeptList.ToString() + ")" : ""));
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        WX.Main.MessageSend("<a href=/Manage/Work/Work_MyCheck.aspx?flag=0&mes=1>" + flow.Name.ToString() + "(" + WX.CommonUtils.GetRealNameListByUserIdList(runmodel.BeginUser.ToString()) + ")——请尽快审批!</a>", "/Manage/Main/messagelist.aspx", dt.Rows[i][0].ToString(), WX.Main.CurUser.UserID, 12, 0);
                    }
                }

                //转到下一页
                Response.Redirect("/Manage/Work/Work_MyWork.aspx?flag=0 ");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Master.A_Edit)
            {
                Response.Write("你没有权限访问此功能!");
                Response.End();
                return;
            }
            if (!IsPostBack)
            {
                WX.Flow.Model.Process.MODEL prcs = WX.Flow.Model.Process.GetCache(Convert.ToInt32(Request.QueryString["Id"]));//WX.Flow.Model.Process.GetModel("select * from FL_Process where ID=" + Request["id"]);
                if (prcs != null)
                {
                    if (prcs.Plug_In.value != null)
                    {
                        string[] pin = prcs.Plug_In.value.ToString().Split('|');
                        PLUG_IN_type.SelectedValue = pin[0];
                        PLUG_IN.Value     = pin[1].Replace("`", "'");
                        PLUG_IN_demo.Text = pin[2];

                        MatchCollection mc = Regex.Matches(pin[1], "\\[(.*?)\\]");
                        foreach (Match mm in mc)
                        {
                            pin[1] = pin[1].Replace(mm.Value, mm.Result(Request[mm.Value.Replace("[", "").Replace("]", "")]));
                        }
                        plugin = pin[1].Replace("`", "'");
                    }
                    if (prcs.Plug_Out.value != null)
                    {
                        string[] pout = prcs.Plug_Out.value.ToString().Split('|');
                        PLUG_OUT_type.SelectedValue = pout[0];
                        PLUG_OUT.Value     = pout[1].Replace("`", "'");
                        PLUG_OUT_demo.Text = pout[2];

                        MatchCollection mc2 = Regex.Matches(pout[1], "\\[(.*?)\\]");
                        foreach (Match mm in mc2)
                        {
                            pout[1] = pout[1].Replace(mm.Value, mm.Result(Request[mm.Value.Replace("[", "").Replace("]", "")]));
                        }
                        plugout = pout[1].Replace("`", "'");
                    }
                }
            }
        }
        /// <summary>
        /// 保存表单及其它功能按钮
        /// </summary>
        private int Save(int rRunId, int rStepId)
        {
            //1.获取模型
            WX.Flow.Model.Run.MODEL     runmodel = WX.Flow.Model.Run.NewDataModel(rRunId);
            WX.Flow.Model.Process.MODEL process  = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + runmodel.FlowId.ToString() + " and StepNo=" + rStepId);
            if (process == null)
            {
                runmodel.Deal_Flag.value = WX.Flow.DealFlag.HasOperated;
            }
            else
            {
                runmodel.Deal_Flag.value = WX.Flow.DealFlag.NotReceived;
                if (process.Next_Nodes.ToString() != "")
                {
                    runmodel.Next_Nodes.value = process.Next_Nodes.value;
                }
                else
                {
                    WX.Flow.Model.Process.MODEL proc = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + runmodel.FlowId.ToString() + " and StepNo=" + runmodel.StepNo.ToInt32());
                    runmodel.Next_Nodes.value = proc.Next_Nodes.value;
                }
                runmodel.StepNo.value = process.StepNo.value;
            }
            //2.取表单值

            WX.Flow.FormFieldCollection ffc = new WX.Flow.FormFieldCollection();
            //3.上传附件并取得附件列表
            string attach_nameList = String.Empty;
            string attache_idlist  = String.Empty;

            //WX.Flow.FormFieldCollection ffc = new WX.Flow.FormFieldCollection();
            //foreach (WX.Flow.FormField ff in runmodel.MyForm.Items_FormFieldCollection)
            //{
            //    ff.Value = this.Request.Form[ff.Id] == null ? "" : this.Request.Form[ff.Id];
            //    ffc.Add(ff);
            //}
            //
            //4.取得手写与签章信息
            int iR = runmodel.Save(rStepId, ffc, attache_idlist, attach_nameList, "", "", 0);//最后两个参数为会签意见和手写签章信息

            runmodel.Update();
            return(iR);
        }
 protected void Button1_Click(object sender, EventArgs e)
 {
     WX.Flow.Model.Process.MODEL model = WX.Flow.Model.Process.GetCache(Convert.ToInt32(Request.QueryString["Id"])); //WX.Flow.Model.Process.GetModel("select * from FL_Process where ID=" + Request["id"]);
     WX.Flow.FormFieldCollection ffc   = new WX.Flow.FormFieldCollection();
     WX.Flow.FormField           ff    = null;
     string[] ffstr = FLD_STR.Value.Split(',');
     for (int i = 0; i < ffstr.Length; i++)
     {
         if (ffstr[i] != "")
         {
             ff      = new WX.Flow.FormField();
             ff.Id   = ffstr[i].Split('|')[0];
             ff.Text = ffstr[i].Split('|')[1];
             ffc.Add(ff);
         }
     }
     model.Editable_FormFieldCollection = ffc;
     model.Update();
     Response.Redirect("Flow_Prcs_List.aspx?id=" + Request["flowid"]);
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Master.A_Edit)
     {
         Response.Write("你没有权限访问此功能!");
         Response.End();
         return;
     }
     if (!IsPostBack)
     {
         WX.Flow.Model.Process.MODEL procss = WX.Flow.Model.Process.GetCache(Convert.ToInt32(Request.QueryString["Id"])); //WX.Flow.Model.Process.GetModel("select * from FL_Process where Id=" + Request["id"]);
         if (procss != null)
         {
             WX.Data.Dict.BindListCtrl_enum_SignLookMode(this.SIGNLOOK, null, null, procss.Sign_Look.ToString());
             WX.Data.Dict.BindListCtrl_enum_SignMode(this.FEEDBACK, null, null, procss.Sign_Mode.ToString());
             TURN_PRIV.SelectedValue = procss.Pass_OpForce.ToString();
             WX.Data.Dict.BindListCtrl_enum_RollBackMode(this.ALLOW_BACK, null, null, procss.Pass_RollBack.ToString());
             WX.Data.Dict.BindListCtrl_enum_Sync_DealMode(this.SYNC_DEAL, null, null, procss.Sync_DealMode.ToString());
             WX.Data.Dict.BindListCtrl_enum_Sync_CombineMode(this.GATHER_NODE, null, null, procss.Sync_CombineMode.ToString());
         }
     }
 }
Esempio n. 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //1.获取当前工作对象
                WX.Flow.Model.Run.MODEL runmodel;
                runmodel = WX.Flow.Model.Run.GetModel("select * from FL_Run where Id=" + this.rRunId);
                //2.装载Form表单
                runmodel.LoadMyForm(false);
                Literal1.Text = runmodel.GenerateHtmls(runmodel.Id.ToInt32());

                #region //3.装载附件
                string[]      attid        = runmodel.Attach_IdList.ToString().Split(new String[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                string[]      attname      = runmodel.Attach_NameList.ToString().Split(new String[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                StringBuilder sbAttachList = new StringBuilder();
                for (int i = 0; i < attid.Length; i++)
                {
                    sbAttachList.AppendFormat("<div id='attach_{2}'>{0}&nbsp;&nbsp;&nbsp;&nbsp;{1}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='javascript:deleteAttach({2},{3})'>删除</a></div>", i + 1, attname[i], attid[i], rRunId);
                }
                liAttachList.Text = sbAttachList.ToString();
                #endregion

                #region //4.装载签办文本信息
                hiddrunid.Value  = this.rRunId.ToString();
                hiddstepno.Value = runmodel.StepNo.ToString();
                DataTable dt = ULCode.QDA.XSql.GetDataTable(String.Format("select rfb.*,p.Name runname,emp.RealName username from FL_RunFeedBack rfb "
                                                                          + " left join FL_Run run on rfb.RunId=run.Id"
                                                                          + " left join FL_Process p on run.FlowId=p.FlowId and rfb.StepNo=p.StepNo "

                                                                          + " left join TU_Users emp on rfb.UserId=emp.UserId "
                                                                          + " where RunId ={0}", rRunId));
                bool flag = true;
                WX.Main.CurUser.LoadDutyUser();
                WX.Main.CurUser.LoadMyDepartment();
                WX.Flow.Model.Process.MODEL proc = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + runmodel.FlowId.ToString() + " and StepNo=" + runmodel.StepNo.ToString());
                int next_n = runmodel.Next_Nodes.ToInt32();
                if (proc.Next_Nodes.ToString() != "")
                {
                    next_n = proc.StepNo.ToInt32();
                }
                WX.Flow.Model.Process.MODEL process = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + runmodel.FlowId.ToString() + " and StepNo=" + next_n + " and(Priv_UserList like '%" + WX.Main.CurUser.UserID + "%'	or Priv_DutyList like'%"+ WX.Main.CurUser.DutyUser.ID.ToString() + "%' or Priv_DeptList like'%" + WX.Main.CurUser.MyDepartMent.ID.ToString() + "%')");
                WX.Flow.Model.Process.MODEL proc2   = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + runmodel.FlowId.ToString() + " and StepNo=" + next_n);
                WX.Main.CurUser.LoadMyDepartment(flag);

                if (runmodel.Deal_Flag.ToInt32() < 3)
                {
                    if (process != null)//经办人设置为我的
                    {
                        flag = true;
                    }
                    else if (proc2 != null && proc2.Auto_Type.ToString() == "1" && runmodel.BeginUser.ToString() == WX.Main.CurUser.UserID)//经办人为流程发起人的
                    {
                        flag = true;
                    }
                    else if (proc2 != null && proc2.Auto_Type.ToString() == "2" && WX.WXUser.GetDeptIDByUserID(runmodel.BeginUser.ToString()) == WX.Main.CurUser.MyDepartMent.ID.ToInt32() && (WX.Main.CurUser.DutyUser.ID.ToInt32() == 500 || WX.Main.IsBestDuty(WX.Main.CurUser.MyDepartMent.ID.ToInt32(), WX.Main.CurUser.UserID)))//经办人为部门主管的
                    {
                        flag = true;
                    }
                    else
                    {
                        flag = false;
                    }
                }
                else
                {
                    flag = false;
                }

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (Convert.ToInt32(dt.Rows[i]["FeedFlag"]) == 0 && Convert.ToString(dt.Rows[i]["UserId"]) == WX.Main.CurUser.UserID)
                    {
                        this.FORM_CONTENT.Text = dt.Rows[i]["Content"].ToString();
                        if (!String.IsNullOrEmpty(Convert.ToString(dt.Rows[i]["SignData"])))
                        {
                            this.txtSealData.Value         = dt.Rows[i]["SignData"].ToString();
                            this.liCurUserSealButton.Text += "<input type=\"button\" onclick=\"PopupIFrame('/App_Ctrl/ShowSignData.aspx?Id=" + Convert.ToString(dt.Rows[i]["Id"]) + "','查看手写签章','','',250,250);\" value=\"查看手写签章\" />";
                        }
                    }
                    else
                    {
                        this.liSignList.Text += " <tr>\n";
                        this.liSignList.Text += " <td>\n";
                        this.liSignList.Text += "     <fieldset>\n";
                        this.liSignList.Text += "    <!--<b> -->\n";
                        this.liSignList.Text += "      <legend>\n";
                        this.liSignList.Text += "      	第" + dt.Rows[i]["StepNo"] + "步 " + dt.Rows[i]["runname"] + "      <u style='cursor:hand'>" + dt.Rows[i]["username"] + "</u>\n";
                        this.liSignList.Text += "      <!--</b> -->\n";
                        this.liSignList.Text += "      </legend>\n";

                        /*
                         * if (Convert.ToString(dt.Rows[i]["UserId"]) == WX.Main.CurUser.UserID)
                         * {
                         *  sign.Text += "                          <img src='/images/edit.gif' style='cursor:pointer' align='absmiddle' alt='编辑意见' onClick='edit_sign('6');'>&nbsp;\n";
                         *  sign.Text += "          <img src='/images/delete.gif' style='cursor:pointer' align='absmiddle' alt='删除意见' onClick='delete_sign('6');'>&nbsp;\n";
                         *  sign.Text += "                <img src='/images/edit.gif' style='cursor:pointer' align='absmiddle' alt='回复意见' onClick='reply_sign('6');'>\n";
                         * }*/
                        this.liSignList.Text += "      <div class='content'>\n";
                        this.liSignList.Text += "         <div style='width:85%;float:left;'>";
                        this.liSignList.Text += "         <i>" + dt.Rows[i]["EditTime"] + "</i><br/>";
                        this.liSignList.Text += "         " + dt.Rows[i]["Content"];
                        this.liSignList.Text += "         </div>\n";
                        this.liSignList.Text += "         <div style='width:14%;float:left; text-align:left;'>";
                        if (!String.IsNullOrEmpty(Convert.ToString(dt.Rows[i]["SignData"])))
                        {
                            this.liSignList.Text += "           <input type=\"button\" onclick=\"PopupIFrame('/App_Ctrl/ShowSignData.aspx?Id=" + Convert.ToString(dt.Rows[i]["Id"]) + "','查看手写签章','','',250,250);\" value=\"查看手写签章\" />";
                        }
                        this.liSignList.Text += "         </div>\n";
                        this.liSignList.Text += "      </div>\n";
                        this.liSignList.Text += "      </fieldset>\n";
                        this.liSignList.Text += "       </td>\n";
                        this.liSignList.Text += "     </tr>";
                    }
                }
                #endregion
                qz.Visible           = flag;
                form_control.Visible = flag;
                FileUpload1.Visible  = flag;
            }
        }
Esempio n. 12
0
        /// <summary>
        /// 保存表单及其它功能按钮
        /// </summary>
        private int Save()
        {
            //1.获取模型
            WX.Flow.Model.Run.MODEL runmodel = WX.Flow.Model.Run.GetModel("select * from FL_Run where Id=" + this.rRunId);

            //2.取表单值
            runmodel.LoadMyForm(false);
            WX.Flow.FormFieldCollection ffc = runmodel.MyForm.GetPostedDatas();
            //3.上传附件并取得附件列表
            string             attach_nameList = String.Empty;
            string             attache_idlist  = String.Empty;
            string             uploadUserId    = WX.Main.CurUser.UserID;
            string             uploadIp        = WX.Main.getIp(this);
            HttpFileCollection hfc             = Request.Files;

            for (int i = 0; i < hfc.Count; i++)
            {
                HttpPostedFile hpf = hfc[i];
                // 取文件后缀名
                string oldFileName = System.IO.Path.GetFileName(hpf.FileName);
                string ext         = System.IO.Path.GetExtension(hpf.FileName);
                string newFileName = DateTime.Now.ToString("yyyyMMddhhmmss fff") + ext;
                string newPath     = String.Format("/UploadFiles/Run/{0}", newFileName);
                if (hpf.ContentLength > 0)
                {
                    try
                    {
                        hpf.SaveAs(Server.MapPath(newPath));
                        //上传成功了
                        DateTime uploadTime = DateTime.Now;
                        string   cmdText    = String.Format("INSERT INTO FL_RunAttachs (RunId,StepNo,NewFileName,OldFileName,UploadUserID,UploadTime,UploadIP)"
                                                            + " VALUES ('{0}','{1}','{2}','{3}','{4}','{5}','{6}');SELECT @@IDENTITY as  IdentityID;"
                                                            , rRunId, runmodel.StepNo.ToString(), newPath, oldFileName, uploadUserId, DateTime.Now, uploadIp);
                        int id = ULCode.QDA.XSql.GetData(cmdText).ToInt32();
                        if (attach_nameList.Length > 0)
                        {
                            attach_nameList = attach_nameList + ",";
                        }
                        attach_nameList = attach_nameList + oldFileName;
                        if (attache_idlist.Length > 0)
                        {
                            attache_idlist = attache_idlist + ",";
                        }
                        attache_idlist = attache_idlist + id;
                    }
                    catch
                    {
                        ;
                    }
                }
            }
            //WX.Flow.FormFieldCollection ffc = new WX.Flow.FormFieldCollection();
            //foreach (WX.Flow.FormField ff in runmodel.MyForm.Items_FormFieldCollection)
            //{
            //    ff.Value = this.Request.Form[ff.Id] == null ? "" : this.Request.Form[ff.Id];
            //    ffc.Add(ff);
            //}
            //
            //4.取得手写与签章信息
            string sealData = this.txtSealData.Value;

            WX.Flow.Model.Process.MODEL proc = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + runmodel.FlowId.ToString() + " and StepNo=" + runmodel.StepNo.ToInt32());

            WX.Flow.Model.Process.MODEL process = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + runmodel.FlowId.ToString() + " and StepNo=" + (runmodel.StepNo.ToInt32() + 1));

            if (process == null)
            {
                runmodel.Deal_Flag.value = WX.Flow.DealFlag.HasOperated;
            }
            else
            {
                runmodel.Deal_Flag.value = 1;
                runmodel.StepNo.value    = runmodel.StepNo.ToInt32() + 1;
                if (process.Next_Nodes.ToString() != "")
                {
                    runmodel.Next_Nodes.value = process.Next_Nodes.value;
                }
                if (proc.Next_Nodes.ToString() == "")
                {
                    WX.Flow.Model.Process.MODEL proc2 = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + runmodel.FlowId.ToString() + " and StepNo=" + (runmodel.Next_Nodes.ToInt32() + 1));
                    if (proc2 == null)
                    {
                        runmodel.Deal_Flag.value = WX.Flow.DealFlag.HasOperated;
                    }
                }
            }
            int iR = runmodel.Save(proc.Next_Nodes.ToString() == "" ? runmodel.Next_Nodes.ToInt32() : proc.StepNo.ToInt32(), ffc, attache_idlist, attach_nameList, this.FORM_CONTENT.Text, sealData, 1);

            if (process != null)
            {
                WX.Model.User.MODEL squser = WX.Model.User.NewDataModel(runmodel.BeginUser.ToString());
                if (process.Auto_Type.ToString() == "1")//经办人为流程发起人的
                {
                    WX.Main.MessageSend("<a href=/Manage/Work/Work_MyCheck.aspx?flag=0&mes=1>" + runmodel.Name.ToString() + "(" + WX.CommonUtils.GetRealNameListByUserIdList(runmodel.BeginUser.ToString()) + ")——请尽快审批!</a>", "/Manage/Main/messagelist.aspx", runmodel.BeginUser.ToString(), WX.Main.CurUser.UserID, 12, 0);
                }
                else if (process.Auto_Type.ToString() == "2")//经办人为部门主管的
                {
                    WX.Main.MessageSend("<a href=/Manage/Work/Work_MyCheck.aspx?flag=0&mes=1>" + runmodel.Name.ToString() + "(" + WX.CommonUtils.GetRealNameListByUserIdList(runmodel.BeginUser.ToString()) + ")——请尽快审批!</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetDeptUserID(1, "[Host]", squser.DepartmentID.ToInt32()), WX.Main.CurUser.UserID, 12, 0);
                }
                else if (process.Auto_Type.ToString() == "4")
                {
                    WX.Main.MessageSend("<a href=/Manage/Work/Work_MyCheck.aspx?flag=0&mes=1>" + runmodel.Name.ToString() + "(" + WX.CommonUtils.GetRealNameListByUserIdList(runmodel.BeginUser.ToString()) + ")——请尽快审批!</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetParentDeptHost(squser.DepartmentID.ToInt32(), "Host"), WX.Main.CurUser.UserID, 12, 0);
                }
                else if (process.Auto_Type.ToString() == "5")
                {
                    WX.Main.MessageSend("<a href=/Manage/Work/Work_MyCheck.aspx?flag=0&mes=1>" + runmodel.Name.ToString() + "(" + WX.CommonUtils.GetRealNameListByUserIdList(runmodel.BeginUser.ToString()) + ")——请尽快审批!</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetParentDeptHost(squser.DepartmentID.ToInt32(), "SubHosts"), WX.Main.CurUser.UserID, 12, 0);
                }
                else
                {
                    System.Data.DataTable dt = ULCode.QDA.XSql.GetDataTable("select UserID from Tu_Users where 1=1" + (process.Priv_UserList.ToString() != "" ? " and UserID in('" + process.Priv_UserList.ToString().Replace(",", "','") + "')" : "") + (process.Priv_DutyList.ToString() != "" ? " and DutyId in(select ID from TE_DutyDetail where DutyID in(" + process.Priv_DutyList.ToString() + "))" : "") + (process.Priv_DeptList.ToString() != "" ? " and Priv_DeptList in(" + process.Priv_DeptList.ToString() + ")" : ""));
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        WX.Main.MessageSend("<a href=/Manage/Work/Work_MyCheck.aspx?flag=0&mes=1>" + runmodel.Name.ToString() + "(" + WX.CommonUtils.GetRealNameListByUserIdList(runmodel.BeginUser.ToString()) + ")——请尽快审批!</a>", "/Manage/Main/messagelist.aspx", dt.Rows[i][0].ToString(), WX.Main.CurUser.UserID, 12, 0);
                    }
                }
            }
            return(iR);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Master.A_Edit)
            {
                Response.Write("你没有权限访问此功能!");
                Response.End();
                return;
            }
            if (!IsPostBack)
            {
                WX.Flow.Model.Flow.MODEL flow = WX.Flow.Model.Flow.GetCache(Convert.ToInt32(Request["flowId"]));//WX.Flow.Model.Flow.GetModel("select * from FL_Flows where ID=" + Request["flowId"]);
                if (flow != null)
                {
                    flow.LoadForm(false);
                    fm = flow.Form;// WX.Flow.Model.Form.GetModel("select * from FL_Forms where ID=" + flow.FormId.value);
                    ITEM_VALUE2.Items.Add(new ListItem("常量", ""));
                    if (fm.Items_FormFieldCollection != null)
                    {
                        foreach (WX.Flow.FormField ff in fm.Items_FormFieldCollection)
                        {
                            ListItem li = new ListItem();
                            li.Text  = ff.Text;
                            li.Value = "@" + ff.Text;
                            ITEM_NAME.Items.Add(li);
                            ITEM_VALUE2.Items.Add(li);
                        }
                    }
                    DataTable dt = ULCode.QDA.XSql.GetDataTable("SELECT [Name],[Title],[Value],[Type] FROM [TE_VarDefine]");
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        ListItem li = new ListItem();
                        li.Text  = "[" + dt.Rows[i]["title"].ToString() + "]";
                        li.Value = "[" + dt.Rows[i]["title"].ToString() + "]";
                        ITEM_VALUE2.Items.Add(li);
                        li.Value = "[" + dt.Rows[i]["title"].ToString() + "]";
                        ITEM_NAME.Items.Add(li);
                    }
                    WX.Flow.Model.Process.MODEL prcs = WX.Flow.Model.Process.GetCache(Convert.ToInt32(Request.QueryString["Id"]));//WX.Flow.Model.Process.GetModel("select * from FL_Process where ID=" + Request["id"]);
                    if (prcs != null)
                    {
                        if (prcs.Condition_In.value != null && prcs.Condition_In.value.ToString() != "")
                        {
                            string[] inarray    = prcs.Condition_In.value.ToString().Split('|');
                            string[] prcsinlist = inarray[0].Split(new string[] { "\n" }, StringSplitOptions.None);
                            for (int i = 0; i < prcsinlist.Length; i++)
                            {
                                if (prcsinlist[i].Trim() != "")
                                {
                                    prcsinstr += String.Format("<tr class=\"TableLine1\">\n" +
                                                               "            <td align=\"center\">[{0}]</td>" +
                                                               "            <td>{1}</td>" +
                                                               "            <td align=\"center\">" +
                                                               "              <image style=\"cursor:pointer\" src=\"/images/edit.gif\" align=\"absmiddle\" onclick=\"upedit(this,1);\">" +
                                                               "              <image style=\"cursor:pointer\" src=\"/images/delete.gif\" align=\"absmiddle\" onclick=\"delRule(this,1)\">" +
                                                               "            </td>" +
                                                               "           </tr>     ", (i + 1).ToString(), prcsinlist[i].Replace("`", "'"));
                                }
                            }
                            PRCS_IN_SET.Value  = inarray[1];
                            PRCS_IN_DESC.Value = inarray[2];
                        }
                        if (prcs.Condition_Out.value != null && prcs.Condition_Out.value.ToString() != "")
                        {
                            string[] outarray    = prcs.Condition_Out.value.ToString().Split('|');
                            string[] prcsoutlist = outarray[0].Split(new string[] { "\n" }, StringSplitOptions.None);
                            for (int i = 0; i < prcsoutlist.Length; i++)
                            {
                                if (prcsoutlist[i].Trim() != "")
                                {
                                    prcsoutstr += String.Format("<tr class=\"TableLine1\">\n" +
                                                                "            <td align=\"center\">[{0}]</td>" +
                                                                "            <td>{1}</td>" +
                                                                "            <td align=\"center\">" +
                                                                "              <image style=\"cursor:pointer\" src=\"/images/edit.gif\" align=\"absmiddle\" onclick=\"upedit(this,0)\">" +
                                                                "              <image style=\"cursor:pointer\" src=\"/images/delete.gif\" align=\"absmiddle\" onclick=\"delRule(this,0)\">" +
                                                                "            </td>" +
                                                                "           </tr>     ", (i + 1).ToString(), prcsoutlist[i].Replace("`", "'"));
                                }
                            }
                            PRCS_OUT_SET.Value  = outarray[1];
                            PRCS_OUT_DESC.Value = outarray[2];
                        }
                    }
                }

                /*
                 * WX.Flow.Model.Process.MODEL prcsmodel = WX.Flow.Model.Process.GetCache(Convert.ToInt32(Request.QueryString["Id"])) ;//WX.Flow.Model.Process.GetModel("select * from FL_Process where ID=" + Request["id"]);
                 * if (prcsmodel.Condition_In.value != null)
                 * {
                 *  Response.Write("转入:" + checkin(prcsmodel.Condition_In.value.ToString().Replace("`", "'")) + "<br/>");
                 * }
                 * if (prcsmodel.Condition_Out.value != null)
                 * {
                 *  Response.Write("转出:" + checkin(prcsmodel.Condition_Out.value.ToString().Replace("`", "'")));
                 * }*/
            }


            //if (prcsmodel != null)
            //{
            //    object obj = ULCode.QDA.XSql.GetValue("select top 1 ID from FL_Process where " + checkin(prcsmodel.Condition_In.value.ToString().Replace("`", "'")));
            //    if (obj != null)
            //    {
            //        Response.Write("正在进入流程。。。。。");
            //    }
            //    else
            //    {
            //        Response.Write(prcsmodel.Condition_In.value.ToString().Split('|')[2]);
            //    }
            //    object objout = ULCode.QDA.XSql.GetValue("select top 1 ID from FL_Process where " + checkin(prcsmodel.Condition_Out.value.ToString().Replace("`", "'")));
            //    if (objout != null)
            //    {
            //        Response.Write("正在转出流程。。。。。");
            //    }
            //    else
            //    {
            //        Response.Write(prcsmodel.Condition_In.value.ToString().Split('|')[2]);
            //    }
            //}
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            //获取id
            //*******************************************************
            //1.验证用户权限
            if (!this.Master.A_Edit)
            {
                Response.Write("你没有权限访问此功能!");
                Response.End();
                return;
            }
            //2.取得用户变量
            //string prcsin = PLUG_IN_type.SelectedValue + "|" + PLUG_IN.Value + "|" + PLUG_IN_demo.Text;
            //string prcsout = PLUG_OUT_type.SelectedValue + "|" + PLUG_OUT.Value + "|" + PLUG_OUT_demo.Text;
            //下面语句是UI开发人员的语句,后台开发人员需删除掉。


            //以下代码由后台开发人员填写
            //3.验证用户变量,包含Request.QueryString及Request.Form

            //4.业务处理过程
            bool bDeal = false;

            //填写主要业务逻辑代码
            WX.Flow.Model.Process.MODEL prcs = WX.Flow.Model.Process.GetCache(Convert.ToInt32(Request.QueryString["Id"]));//WX.Flow.Model.Process.GetModel("select * from FL_Process where ID=" + Request["id"]);
            if (prcs != null)
            {
                prcs.Auto_Type.value         = AUTO_TYPE.SelectedValue;
                prcs.Auto_FilterMode.value   = USER_FILTER.SelectedValue;
                prcs.Auto_OPMode.value       = TOP_DEFAULT.SelectedValue;
                prcs.Auto_OpChangeMode.value = USER_LOCK.SelectedValue;
                if (prcs.Auto_Type.value.ToString() == "3")
                {
                    if (AUTO_USER_OP.Value != "")
                    {
                        prcs.Auto_UserOP.value = AUTO_USER_OP.Value;
                    }
                    if (AUTO_USER.Value != "")
                    {
                        prcs.Auto_UserList.value = AUTO_USER.Value;
                    }
                }
                if (prcs.Auto_Type.value.ToString() == "2" || prcs.Auto_Type.value.ToString() == "4" || prcs.Auto_Type.value.ToString() == "6" || prcs.Auto_Type.value.ToString() == "8" || prcs.Auto_Type.value.ToString() == "9" || prcs.Auto_Type.value.ToString() == "10" || prcs.Auto_Type.value.ToString() == "11")
                {
                    prcs.Auto_BaseUnit.value = AUTO_PRCS_USER.SelectedValue;
                }
                if (prcs.Auto_Type.value.ToString() == "7")
                {
                    prcs.Auto_Item.value = drop_items.SelectedValue;
                }
                if (prcs.Update() != 0)
                {
                    bDeal = true;
                }
            }
            //5.(用户及业务对象)统计与状态

            //6.登记日志
            if (bDeal)
            {
                WX.Main.AddLog(WX.LogType.Default, "流程步骤经办设置成功!", "");
            }
            else
            {
                ULCode.Debug.Alert(this, "流程步骤经办设置失败!");
            }
            Response.Redirect("Flow_Prcs_List.aspx?id=" + Request["flowId"]);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Master.A_Edit)
     {
         Response.Write("你没有权限访问此功能!");
         Response.End();
         return;
     }
     if (Request["flowid"] != null)
     {
         try
         {
             fid = Convert.ToInt32(Request["flowid"]);
         }
         catch { }
         if (!IsPostBack)
         {
             WX.Flow.Model.Flow.MODEL model = WX.Flow.Model.Flow.GetCache(fid); //WX.Flow.Model.Flow.GetModel("select * from FL_Flows where ID=" + fid);
             if (model != null)
             {
                 model.LoadForm(false);
                 WX.Flow.Model.Form.MODEL formmodel = model.Form; //WX.Flow.Model.Form.GetModel("select * from FL_Forms where ID=" + model.FormId.value);
                 foreach (WX.Flow.FormField ff in formmodel.Items_FormFieldCollection)
                 {
                     drop_items.Items.Add(new ListItem(ff.Text, ff.Id));
                 }
             }
             //DataTable dt = ULCode.QDA.XSql.GetDataTable("select Name,StepNo from FL_Process where FlowId=" + fid);
             //for (int i = 0; i < dt.Rows.Count; i++)
             model.LoadProcessList(false);
             if (model.ProcessList != null)
             {
                 foreach (WX.Flow.Model.Process.MODEL prcs in model.ProcessList)
                 {
                     AUTO_PRCS_USER.Items.Add(new ListItem(prcs.Name.ToString(), prcs.StepNo.ToString()));
                 }
             }
             AUTO_PRCS_USER.SelectedValue = Request["id"];
             WX.Flow.Model.Process.MODEL procss = WX.Flow.Model.Process.GetCache(Convert.ToInt32(Request["id"]));//WX.Flow.Model.Process.GetModel("select * from FL_Process where Id="+Request["id"]);
             if (procss != null)
             {
                 WX.Data.Dict.BindListCtrl_enum_AutoOpMode(this.TOP_DEFAULT, null, null, procss.Auto_OPMode.ToString());
                 USER_LOCK.SelectedValue = procss.Auto_OpChangeMode.ToString();
                 WX.Data.Dict.BindListCtrl_enum_AutoSelOpFilter(this.USER_FILTER, null, null, procss.Auto_FilterMode.ToString());
                 WX.Data.Dict.BindListCtrl_enum_AutoSelOpType(this.AUTO_TYPE, null, null, procss.Auto_Type.ToString());
                 AUTO_PRCS_USER.SelectedValue = procss.Auto_BaseUnit.ToString();
                 drop_items.SelectedValue     = procss.Auto_Item.ToString();
                 AUTO_USER.Value = procss.Auto_UserList.ToString();
                 if (procss.Auto_UserList.ToString() != "")
                 {
                     AUTO_USER_NAME.Text = ULCode.QDA.XSql.GetXDataTable("SELECT RealName FROM TU_Employees WHERE UserID in('" + procss.Auto_UserList.ToString().Replace(",", "','") + "')").ToColValueList();
                 }
                 AUTO_USER_OP.Value = procss.Auto_UserOP.ToString();
                 if (procss.Auto_UserOP.ToString() != "")
                 {
                     AUTO_USER_OP_NAME.Text = ULCode.QDA.XSql.GetXDataTable("SELECT RealName FROM TU_Employees WHERE UserID in('" + procss.Auto_UserOP.ToString().Replace(",", "','") + "')").ToColValueList();
                 }
             }
         }
     }
 }
Esempio n. 16
0
        }/// <summary>

        /// 保存表单及其它功能按钮
        /// </summary>
        private int Save(int rRunId, int rStepId)
        {
            //1.获取模型
            WX.Flow.Model.Run.MODEL     runmodel = WX.Flow.Model.Run.NewDataModel(rRunId);
            WX.Flow.Model.Process.MODEL process  = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + runmodel.FlowId.ToString() + " and StepNo=" + (runmodel.StepNo.ToInt32() + 1));
            if (process == null)
            {
                runmodel.Deal_Flag.value = DealFlag.HasOperated;
            }
            else
            {
                runmodel.Deal_Flag.value = DealFlag.NotReceived;
                if (process.Next_Nodes.ToString() != "")
                {
                    runmodel.Next_Nodes.value = process.Next_Nodes.value;
                }
                else
                {
                    WX.Flow.Model.Process.MODEL proc = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + runmodel.FlowId.ToString() + " and StepNo=" + runmodel.StepNo.ToInt32());
                    runmodel.Next_Nodes.value = proc.Next_Nodes.value;
                }
                runmodel.StepNo.value = process.StepNo.value;
            }
            //2.取表单值
            runmodel.LoadMyForm(false);
            WX.Flow.FormFieldCollection ffc = runmodel.MyForm.GetPostedDatas();
            //3.上传附件并取得附件列表
            string             attach_nameList = String.Empty;
            string             attache_idlist  = String.Empty;
            string             uploadUserId    = WX.Main.CurUser.UserID;
            string             uploadIp        = WX.Main.getIp(this);
            HttpFileCollection hfc             = Request.Files;

            for (int i = 0; i < hfc.Count; i++)
            {
                HttpPostedFile hpf = hfc[i];
                // 取文件后缀名
                string oldFileName = System.IO.Path.GetFileName(hpf.FileName);
                string ext         = System.IO.Path.GetExtension(hpf.FileName);
                string newFileName = DateTime.Now.ToString("yyyyMMddhhmmss fff") + ext;
                string newPath     = String.Format("/UploadFiles/Run/{0}", newFileName);
                if (hpf.ContentLength > 0)
                {
                    try
                    {
                        hpf.SaveAs(Server.MapPath(newPath));
                        //上传成功了
                        DateTime uploadTime = DateTime.Now;
                        string   cmdText    = String.Format("INSERT INTO FL_RunAttachs (RunId,StepNo,NewFileName,OldFileName,UploadUserID,UploadTime,UploadIP)"
                                                            + " VALUES ('{0}','{1}','{2}','{3}','{4}','{5}','{6}');SELECT @@IDENTITY as  IdentityID;"
                                                            , rRunId, rStepId, newPath, oldFileName, uploadUserId, DateTime.Now, uploadIp);
                        int id = ULCode.QDA.XSql.GetData(cmdText).ToInt32();
                        if (attach_nameList.Length > 0)
                        {
                            attach_nameList = attach_nameList + ",";
                        }
                        attach_nameList = attach_nameList + oldFileName;
                        if (attache_idlist.Length > 0)
                        {
                            attache_idlist = attache_idlist + ",";
                        }
                        attache_idlist = attache_idlist + id;
                    }
                    catch
                    {
                        ;
                    }
                }
            }
            //WX.Flow.FormFieldCollection ffc = new WX.Flow.FormFieldCollection();
            //foreach (WX.Flow.FormField ff in runmodel.MyForm.Items_FormFieldCollection)
            //{
            //    ff.Value = this.Request.Form[ff.Id] == null ? "" : this.Request.Form[ff.Id];
            //    ffc.Add(ff);
            //}
            //
            //4.取得手写与签章信息
            int iR = runmodel.Save(rStepId, ffc, attache_idlist, attach_nameList, "", "", 0);//最后两个参数为会签意见和手写签章信息

            runmodel.Update();
            return(0);// iR;
        }
Esempio n. 17
0
        private void SaveData(int state, int runid)
        {
            WX.XZ.NotifyFiles.MODEL model;

            //业务处理过程
            if (WX.Request.rNotifyFileId > 0)
            {
                model = WX.Request.rNotifyFile;
            }
            else
            {
                model = WX.XZ.NotifyFiles.NewDataModel();

                model.UserID.value = WX.Main.CurUser.UserID;
            }

            if (this.FileUpload1.HasFile)
            {
                string annexpath = this.SavaAnnex();
                if (annexpath == "-1")
                {
                    ULCode.Debug.Alert(this, "附件格式不正确,请选择.PDF格式的文件!");
                    return;
                }
                else
                {
                    string[] annexs = model.Annex.ToString().Split('|');
                    if (annexs.Length == 2 && annexs[0] != "")
                    {
                        try
                        {
                            File.Delete(Server.MapPath(annexs[0]));
                        }
                        catch { }
                    }
                    model.Annex.value = annexpath;
                }
            }
            model.Annex.value = model.Annex.ToString() == "" ? "|" : model.Annex.ToString();
            // Response.Write(model.Annex.ToString()); return;
            //2.取得用户变量
            model.Code.value  = ui_Code.Text;
            model.Title.value = ui_title.Text;

            model.Users.value       = hidden_UserList.Value;
            model.Depms.value       = hidden_DepartmentList.Value;
            model.Content.value     = ui_content1.Value;
            model.Area.value        = ui_Area.SelectedValue;
            model.PublishTime.value = DateTime.Now;
            if (runid > 0)
            {
                model.RunID.value = runid;
            }
            ////填写主要业务逻辑代码、登记日志

            model.state.value = state;
            if (state == 4)
            {
                model.StepNo.value   = 0;
                model.StepName.value = "行政发布";
                WX.Main.MessageSend("<a href=/Manage/XZ/NotifyFileDetail.aspx?NotifyFileId=" + model.ID.ToString() + ">文件《" + model.Title.ToString() + "》通过审批!请行政尽快发布</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetCAUserID, WX.Main.CurUser.UserID, 5, 0);
                WX.Main.MessageSend("<a href=/Manage/XZ/NotifyFileDetail.aspx?NotifyFileId=" + model.ID.ToString() + ">文件《" + model.Title.ToString() + "》通过审批!请行政尽快发布</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetAdminUserID, WX.Main.CurUser.UserID, 5, 0);
            }
            else
            {
                model.FlowID.value   = 14;
                model.StepNo.value   = state == 1 ? 1 : 2;
                model.StepName.value = WX.Flow.Model.Process.GetCache(model.FlowID.ToInt32(), model.StepNo.ToInt32()).Name.value;
            }
            if (WX.Request.rNotifyFileId > 0)
            {
                model.Update();
                WX.Main.AddLog(WX.LogType.Default, "修改文件通知!", String.Format("{0}", model.Title.ToString()));
            }
            else
            {
                int id = model.Insert(true);
                model.ID.value = id;
                WX.Main.AddLog(WX.LogType.Default, "拟写文件通知!", String.Format("{0}-{1}", id, model.Title.ToString()));
            }
            if (state == 3)
            {
                WX.Flow.Model.Process.MODEL process = WX.Flow.Model.Process.GetCache(model.FlowID.ToInt32(), model.StepNo.ToInt32());
                WX.Model.User.MODEL         squser  = WX.Model.User.NewDataModel(model.UserID.ToString());
                if (process.Auto_Type.ToString() == "1")//经办人为流程发起人的
                {
                    WX.Main.MessageSend("<a href=/Manage/XZ/NotifyFileDetail.aspx?NotifyFileId=" + model.ID.ToString() + ">" + squser.RealName.ToString() + "拟写的文件《" + model.Title.ToString() + "》!申请审批</a>", "/Manage/Main/messagelist.aspx", model.UserID.ToString(), WX.Main.CurUser.UserID, 5, 0);
                }
                else if (process.Auto_Type.ToString() == "2")//经办人为部门主管的
                {
                    WX.Main.MessageSend("<a href=/Manage/XZ/NotifyFileDetail.aspx?NotifyFileId=" + model.ID.ToString() + ">" + squser.RealName.ToString() + "拟写的文件《" + model.Title.ToString() + "》申请主管审批!</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetDeptUserID(1, "[Host]", squser.DepartmentID.ToInt32()), WX.Main.CurUser.UserID, 5, 0);
                }
                else if (process.Auto_Type.ToString() == "4")
                {
                    WX.Main.MessageSend("<a href=/Manage/XZ/NotifyFileDetail.aspx?NotifyFileId=" + model.ID.ToString() + ">" + squser.RealName.ToString() + "拟写的文件《" + model.Title.ToString() + "》申请上级审批!</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetParentDeptHost(squser.DepartmentID.ToInt32(), "Host"), WX.Main.CurUser.UserID, 5, 0);
                }
                else if (process.Auto_Type.ToString() == "5")
                {
                    WX.Main.MessageSend("<a href=/Manage/XZ/NotifyFileDetail.aspx?NotifyFileId=" + model.ID.ToString() + ">" + squser.RealName.ToString() + "拟写的文件《" + model.Title.ToString() + "》申请分管领导审批!</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetParentDeptHost(squser.DepartmentID.ToInt32(), "SubHosts"), WX.Main.CurUser.UserID, 5, 0);
                }
                else
                {
                    System.Data.DataTable dt = ULCode.QDA.XSql.GetDataTable("select UserID from Tu_Users where 1=1" + (process.Priv_UserList.ToString() != "" ? " and UserID in(" + process.Priv_UserList.ToString() + ")" : "") + (process.Priv_DutyList.ToString() != "" ? " and DutyId in(select ID from TE_DutyDetail where DutyID in(" + process.Priv_DutyList.ToString() + "))" : "") + (process.Priv_DeptList.ToString() != "" ? " and Priv_DeptList in(" + process.Priv_DeptList.ToString() + ")" : ""));
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        WX.Main.MessageSend("<a href=/Manage/XZ/NotifyFileDetail.aspx?NotifyFileId=" + model.ID.ToString() + ">" + squser.RealName.ToString() + "拟写的文件《" + model.Title.ToString() + "》!申请审批</a>", "/Manage/Main/messagelist.aspx", dt.Rows[i][0].ToString(), WX.Main.CurUser.UserID, 5, 0);
                    }
                }
            }
        }
Esempio n. 18
0
            /// <summary>
            /// 保存
            /// </summary>
            /// <param name="step">第几步</param>
            /// <param name="fldDatas">字段信息与数据</param>
            /// <param name="attacheIdList">附件id列表</param>
            /// <param name="attacheNameList">附件Name列表</param>
            /// <param name="signText"></param>
            /// <param name="signData"></param>
            /// <param name="flag">状态</param>
            /// <returns></returns>
            public int Save(int step, FormFieldCollection fldDatas, string attacheIdList, string attacheNameList, string signText, string signData, int flag)
            {
                //1.保存fldDatas到FL_RunDatas_{N}中
                this.LoadMyForm(false);
                String sSql = String.Format("select * from sysobjects where xtype='u' and name='FL_RunDatas_{0}'", this.MyForm.Id);

                if (!ULCode.QDA.XSql.IsHasRow(sSql))
                {
                    sSql = String.Format("Select * into FL_RunDatas_{0} from FL_RunDatas", this.MyForm.Id);
                    ULCode.QDA.XSql.Execute(sSql);
                }
                sSql = String.Format("Select * from FL_RunDatas_{0} where RunId={1}", this.MyForm.Id, this.Id);
                if (ULCode.QDA.XSql.IsHasRow(sSql))
                {
                    sSql = String.Format("Update FL_RunDatas_{0} set Datas='{2}' where RunId={0}", this.MyForm.Id, this.Id, fldDatas.GetSavedDatas(FormFieldDataType.Data));
                }
                else
                {
                    sSql = String.Format("insert into FL_RunDatas_{0}(Name,FormId,RunId,BeginUserId,BeginTime,Datas) Values('{2}','{0}','{1}','{3}','{4}','{5}')"
                                         , this.MyForm.Id
                                         , this.Id
                                         , this.Name
                                         , this.BeginUser.ToString()
                                         , this.BeginTime
                                         , fldDatas.GetSavedDatas(FormFieldDataType.Data));
                }
                int iR0 = ULCode.QDA.XSql.Execute(sSql);

                //2.保存attacheIdList, attacheNameList到当前步骤
                if (!String.IsNullOrEmpty(attacheIdList))
                {
                    if (this.Attach_IdList.isEmpty)
                    {
                        this.Attach_IdList.set_String_Append(attacheIdList);
                    }
                    else
                    {
                        this.Attach_IdList.set_String_Append("," + attacheIdList);
                    }
                }
                if (!String.IsNullOrEmpty(attacheNameList))
                {
                    if (this.Attach_NameList.isEmpty)
                    {
                        this.Attach_NameList.set_String_Append("," + attacheNameList);
                    }
                    else
                    {
                        this.Attach_NameList.set_String_Append("," + attacheNameList);
                    }
                }
                //this.Attach_IdList.set_String_AppendFormat(",{0}", attacheIdList);
                //this.Attach_NameList.set_String_AppendFormat(",{0}", attacheNameList);

                int iR1 = this.Update();

                //3.保存SignText与SignData
                sSql = String.Format("if exists(select * from FL_RunFeedBack where RunId={0} and StepNo={1} and UserId='{4}' and FeedFlag=0)"
                                     + " Update FL_RunFeedBack set Content='{2}',SignData='{3}',FeedFlag={7},EditTime=GetDate(),CheckUserID='" + WX.Public.CurUser.UserID + "' where RunId={0} and StepNo={1} and UserId='{4}' and FeedFlag=0;"
                                     + " else "
                                     + " Insert into FL_RunFeedBack(RunId,StepNo,UserId,Content,Attach_IdList,Attach_NameList,EditTime,FeedFlag,SignData,ReplyId,CheckUserID)"
                                     + "                         values({0},{1},'{4}','{2}','{5}','{6}',GetDate(),{7},'{3}',0,'{8}');"
                                     , this.Id, step, signText, signData, this.BeginUser.ToString(), null, null, flag, WX.Public.CurUser.UserID);

                int iR2 = ULCode.QDA.XSql.Execute(sSql);

                WX.Flow.Model.Process.MODEL proc = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + this.FlowId.ToString() + " and StepNo=" + step);
                if (proc != null && proc.UpdateTable.ToString() != "")
                {
                    sSql = String.Format("if exists(select * from {0} where UserID='{2}')  update {0} set {1} where UserID='{2}'; else begin Insert into {0} (UserID) values('{2}');update {0} set {1} where UserID='{2}';end", proc.UpdateTable.ToString(), proc.UpdateKeyValue, this.BeginUser.ToString());
                    ULCode.QDA.XSql.Execute(sSql);
                }
                if (iR0 * iR1 * iR2 > 0)
                {
                    //Succeess;
                }
                else
                {
                    //Faild
                }
                return(iR2);
            }
        /// <summary>
        /// 保存表单及其它功能按钮
        /// </summary>
        private int Save(int state)
        {
            WX.XZ.NotifyFiles.MODEL model = WX.Request.rNotifyFile;
            //1.获取模型
            WX.Flow.Model.Run.MODEL runmodel = WX.Flow.Model.Run.GetModel("select * from FL_Run where Id=" + model.RunID.ToString());
            int stepno = model.StepNo.ToInt32();

            //2.取表单值
            runmodel.LoadMyForm(false);
            WX.Flow.FormFieldCollection ffc = runmodel.MyForm.GetPostedDatas();
            //3.上传附件并取得附件列表
            string             attach_nameList = String.Empty;
            string             attache_idlist  = String.Empty;
            string             uploadUserId    = WX.Main.CurUser.UserID;
            string             uploadIp        = WX.Main.getIp(this);
            HttpFileCollection hfc             = Request.Files;
            //WX.Flow.FormFieldCollection ffc = new WX.Flow.FormFieldCollection();
            //foreach (WX.Flow.FormField ff in runmodel.MyForm.Items_FormFieldCollection)
            //{
            //    ff.Value = this.Request.Form[ff.Id] == null ? "" : this.Request.Form[ff.Id];
            //    ffc.Add(ff);
            //}
            //
            //4.取得手写与签章信息
            string sealData = this.txtSealData.Value;

            WX.Flow.Model.Process.MODEL proc;

            WX.Flow.Model.Process.MODEL process = null;
            int iR = 0;

            if (state == 2)
            {
                model.state.value    = 2;
                model.StepNo.value   = 1;
                model.StepName.value = "文件拟写";
                proc    = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + runmodel.FlowId.ToString() + " and StepNo=" + model.StepNo.ToInt32());
                process = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + runmodel.FlowId.ToString() + " and StepNo=" + proc.Next_Nodes.ToInt32());
                runmodel.StepNo.value     = model.StepNo.value;
                runmodel.Next_Nodes.value = proc.Next_Nodes.value;
                WX.Main.AddLog(WX.LogType.Default, "文件通知审批未通过!", String.Format("{0}-{1}", model.ID.ToString(), model.Title.ToString()));
                //向拟写人发消息
                WX.Main.MessageSend("<a href=/Manage/XZ/NotifyFiles.aspx?mes=1&NotifyFileId=" + model.ID.ToString() + ">你似写的文件《" + model.Title.ToString() + "》——审批未通过被退回</a>", "/Manage/Main/messagelist.aspx", model.UserID.ToString(), WX.Main.CurUser.UserID, 5, 0);
            }
            else
            {
                proc = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + runmodel.FlowId.ToString() + " and StepNo=" + model.StepNo.ToInt32());
                if (proc != null && proc.Next_Nodes.ToString() != "" && proc.Next_Nodes.ToInt32() > 0)
                {
                    process = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + runmodel.FlowId.ToString() + " and StepNo=" + proc.Next_Nodes.ToInt32());
                }

                if (process == null)
                {
                    runmodel.Deal_Flag.value = WX.Flow.DealFlag.HasOperated;
                    model.state.value        = 4;
                    model.StepNo.value       = 0;
                    model.StepName.value     = "行政发布";
                    //审批完成,向行政发消息发布文件

                    WX.Main.MessageSend("<a href=/Manage/XZ/NotifyFileDetail.aspx?NotifyFileId=" + model.ID.ToString() + ">文件《" + model.Title.ToString() + "》通过审批!请行政尽快发布</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetCAUserID, WX.Main.CurUser.UserID, 5, 0);
                    WX.Main.MessageSend("<a href=/Manage/XZ/NotifyFileDetail.aspx?NotifyFileId=" + model.ID.ToString() + ">文件《" + model.Title.ToString() + "》通过审批!请行政尽快发布</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetAdminUserID, WX.Main.CurUser.UserID, 5, 0);
                }
                else
                {
                    runmodel.Deal_Flag.value = 1;
                    runmodel.StepNo.value    = model.StepNo.value = process.StepNo.value;
                    if (process.Next_Nodes.ToInt32() > 0)
                    {
                        runmodel.Next_Nodes.value = process.Next_Nodes.value;
                    }
                    else
                    {
                        runmodel.Next_Nodes.value = 0;
                    }
                    iR = 1;
                    model.state.value    = 3;
                    model.StepName.value = process.Name.value;
                    //向下一个人发消息,提醒审批
                    // WX.Main.MessageSend("<a href=/Manage/XZ/NotifyFileDetail.aspx?NotifyFileId=" + model.ID.ToString() + ">文件《" + model.Title.ToString() + "》通过审批!请行政尽快发布</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetCAUserID, WX.Main.CurUser.UserID, 5, 0);
                    WX.Model.User.MODEL squser = WX.Model.User.NewDataModel(model.UserID.ToString());
                    if (process.Auto_Type.ToString() == "1")//经办人为流程发起人的
                    {
                        WX.Main.MessageSend("<a href=/Manage/XZ/NotifyFileDetail.aspx?NotifyFileId=" + model.ID.ToString() + ">" + squser.RealName.ToString() + "拟写的文件《" + model.Title.ToString() + "》!申请审批</a>", "/Manage/Main/messagelist.aspx", model.UserID.ToString(), WX.Main.CurUser.UserID, 5, 0);
                    }
                    else if (process.Auto_Type.ToString() == "2")//经办人为部门主管的
                    {
                        WX.Main.MessageSend("<a href=/Manage/XZ/NotifyFileDetail.aspx?NotifyFileId=" + model.ID.ToString() + ">" + squser.RealName.ToString() + "拟写的文件《" + model.Title.ToString() + "》申请主管审批!</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetDeptUserID(1, "[Host]", squser.DepartmentID.ToInt32()), WX.Main.CurUser.UserID, 5, 0);
                    }
                    else if (process.Auto_Type.ToString() == "4")
                    {
                        WX.Main.MessageSend("<a href=/Manage/XZ/NotifyFileDetail.aspx?NotifyFileId=" + model.ID.ToString() + ">" + squser.RealName.ToString() + "拟写的文件《" + model.Title.ToString() + "》申请上级审批!</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetParentDeptHost(squser.DepartmentID.ToInt32(), "Host"), WX.Main.CurUser.UserID, 5, 0);
                    }
                    else if (process.Auto_Type.ToString() == "5")
                    {
                        WX.Main.MessageSend("<a href=/Manage/XZ/NotifyFileDetail.aspx?NotifyFileId=" + model.ID.ToString() + ">" + squser.RealName.ToString() + "拟写的文件《" + model.Title.ToString() + "》申请分管领导审批!</a>", "/Manage/Main/messagelist.aspx", WX.CommonUtils.GetParentDeptHost(squser.DepartmentID.ToInt32(), "SubHosts"), WX.Main.CurUser.UserID, 5, 0);
                    }
                    else
                    {
                        System.Data.DataTable dt = ULCode.QDA.XSql.GetDataTable("select UserID from Tu_Users where 1=1" + (process.Priv_UserList.ToString() != "" ? " and UserID in('" + process.Priv_UserList.ToString().Replace(",", "','") + "')" : "") + (process.Priv_DutyList.ToString() != "" ? " and DutyId in(select ID from TE_DutyDetail where DutyID in(" + process.Priv_DutyList.ToString() + "))" : "") + (process.Priv_DeptList.ToString() != "" ? " and Priv_DeptList in(" + process.Priv_DeptList.ToString() + ")" : ""));
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            WX.Main.MessageSend("<a href=/Manage/XZ/NotifyFileDetail.aspx?NotifyFileId=" + model.ID.ToString() + ">" + squser.RealName.ToString() + "拟写的文件《" + model.Title.ToString() + "》!申请审批</a>", "/Manage/Main/messagelist.aspx", dt.Rows[i][0].ToString(), WX.Main.CurUser.UserID, 5, 0);
                        }
                    }
                }
                WX.Main.AddLog(WX.LogType.Default, "文件通知审批通过!", String.Format("{0}-{1}", model.ID.ToString(), model.Title.ToString()));
            }
            model.PublishTime.value = DateTime.Now;
            model.Update();
            runmodel.Save(stepno, ffc, attache_idlist, attach_nameList, this.txt_sign.Text, sealData, 1);

            pageinit();
            return(iR);
        }
        private void pageinit()
        {
            model  = WX.Request.rNotifyFile;
            stepno = model.StepNo.ToInt32();
            string[] signarry = WX.Flow.Model.Run.GetSignList(model.RunID.ToInt32(), WX.Main.CurUser.UserID);
            this.txt_sign.Text            = signarry[0];
            this.txtSealData.Value        = signarry[1];
            this.liCurUserSealButton.Text = signarry[2];
            this.liSignList.Text          = signarry[3];
            bool flag = true;

            if (model.state.ToInt32() >= 4)
            {
                flag            = false;
                Button2.Visible = model.state.ToInt32() == 4;
            }
            else
            {
                WX.Main.CurUser.LoadDutyUser(); WX.Main.CurUser.LoadMyDepartment(flag);
                WX.Flow.Model.Process.MODEL proc = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + model.FlowID.ToString() + " and StepNo=" + model.StepNo.ToString());
                int next_n = model.StepNo.ToInt32();
                if (proc != null && proc.Next_Nodes.ToString() != "")
                {
                    next_n = proc.StepNo.ToInt32();
                }
                WX.Flow.Model.Process.MODEL process = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + model.FlowID.ToString() + " and StepNo=" + next_n + " and(Priv_UserList like '%" + WX.Main.CurUser.UserID + "%'	or Priv_DutyList like'%" + WX.Main.CurUser.DutyUser.ID.ToString() + "%' or Priv_DeptList like'%" + WX.Main.CurUser.MyDepartMent.ID.ToString() + "%')");
                WX.Flow.Model.Process.MODEL proc2   = WX.Flow.Model.Process.GetModel("select * from FL_Process where FlowID=" + model.FlowID.ToString() + " and StepNo=" + next_n);


                WX.Flow.Model.Run.MODEL runmodel = WX.Flow.Model.Run.GetModel("select * from FL_Run where Id=" + model.RunID.ToString());
                WX.Model.User.MODEL     squser   = WX.Model.User.GetCache(model.UserID.ToString());
                if (runmodel.Deal_Flag.ToInt32() < 3)
                {
                    if (process != null)//经办人设置为我的
                    {
                        flag = true;
                    }
                    else if (proc2 != null)
                    {
                        if (proc2.Auto_Type.ToString() == "1" && runmodel.BeginUser.ToString() == WX.Main.CurUser.UserID)//经办人为流程发起人的
                        {
                            flag = true;
                        }
                        else if (proc2.Auto_Type.ToString() == "2" && WX.WXUser.GetDeptIDByUserID(runmodel.BeginUser.ToString()) == WX.Main.CurUser.MyDepartMent.ID.ToInt32() && (WX.Main.CurUser.MyDepartMent.Host.ToString() == WX.Main.CurUser.UserID || WX.Main.IsBestDuty(WX.Main.CurUser.MyDepartMent.ID.ToInt32(), WX.Main.CurUser.UserID)))//经办人为部门主管的
                        {
                            flag = true;
                        }
                        else if (proc2.Auto_Type.ToString() == "4" && WX.CommonUtils.GetParentDeptHost(squser.DepartmentID.ToInt32(), "Host") == WX.Main.CurUser.UserID)
                        {
                            flag = true;
                        }
                        else if (proc2.Auto_Type.ToString() == "5" && WX.CommonUtils.GetParentDeptHost(squser.DepartmentID.ToInt32(), "SubHosts") == WX.Main.CurUser.UserID)
                        {
                            flag = true;
                        }
                        else
                        {
                            flag = false;
                        }
                    }
                    else
                    {
                        flag = false;
                    }
                }
            }
            qz.Visible = flag;
            System.Data.DataTable query = ULCode.QDA.XSql.GetDataTable("select A.StepNo,A.Name,A.Next_Nodes from FL_Process A Left join FL_Run B on A.FlowID=B.FlowID where A.FlowId=" + model.FlowID.ToString() + " and B.ID=" + model.RunID.ToString() + " order by A.StepNo asc");
            this.ProcessRepeater.DataSource = query;
            this.ProcessRepeater.DataBind();
        }