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 ");
            }
        }
示例#2
0
        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);

            if (newRunId > 0)
            {
                //转到下一页
                Response.Redirect(String.Format("Run_SignForm.aspx?Run_ID={0}&Flow_Id={1}&Step_Id={2}", newRunId, flow.Id, 1), true);
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            WX.XZ.Train.MODEL        trainmodel = WX.XZ.Train.NewDataModel(Request["TrainID"]);
            WX.Flow.Model.Flow.MODEL flow       = WX.Flow.Model.Flow.GetCache(trainmodel.FlowID.ToInt32()); //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("《" + flow.Name.ToString() + "》学习心得");

            this.Save(newRunId, 1);
            WX.XZ.TrainUsers.MODEL tusermodel = WX.XZ.TrainUsers.GetModelToTrainID(trainmodel.ID.ToInt32(), WX.Main.CurUser.UserID);
            tusermodel.RunID.value = newRunId;
            tusermodel.State.value = 2;
            tusermodel.Update();
            ULCode.Debug.Alert(this, "提交成功!");
            Button1.Visible = false;
        }
        protected void SubmitData3(object sender, EventArgs e)
        {
            WX.Flow.Model.Flow.MODEL flow = WX.Flow.Model.Flow.GetCache(14); //WX.Flow.Model.Flow.NewDataModel(rFlowId);
            flow.LoadProcessList(false);
            if (flow.GetProcessByStep(1).ExecIn(null) == 0)
            {
                ULCode.Debug.Alert(this, "程序出错,请联系管理员!");
                return;
            }
            int newRunId;

            if (WX.Request.rNotifyFileId > 0)
            {
                newRunId = WX.Request.rNotifyFile.RunID.ToInt32();
            }
            else
            {
                newRunId = flow.NewWork(flow.Name.ToString() + "——" + ui_title.Text);
            }
            this.Save(newRunId, 2);
            SaveData(3, newRunId);
            //返回处理结果或返回其它页面。
            Response.Redirect("MyFiles.aspx");
        }