Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //进入条件
         WX.Flow.Model.Flow.MODEL flow = WX.Flow.Model.Flow.GetCache(rFlowId); //WX.Flow.Model.Flow.NewDataModel(rFlowId);
         this.FormId     = flow.FormId.ToInt32();
         MenuBar1.Param1 = this.rFlowId.ToString();
         bool b = flow.GetProcessByStep(1).GetInAccess(null);
         if (b == false)
         {
             this.btnSubmit.Enabled = false;
             this.tooltip.InnerText = flow.GetProcessByStep(1).GetInMsg(null);
         }
         //填充流程信息及新工作流水号
         flow.LoadNumberRule(false);
         string name   = flow.Name.value.ToString();
         string number = flow.NumberRule.GetValue();
         this.txtSerialNumber.Text = number; //String.Format("{0}({1})", name, number);
         this.txtDescription.Text  = flow.Description.value.ToString();
         //填充流程步骤列表
         flow.LoadProcessList(false);
         var process = flow.ProcessList;
         //var process = Process.Caches.FindAll(delegate(Process.MODEL dele) { return dele.Id.ToInt32() == rFlowId; });//WX.Flow.Model.Process.GetModels("SELECT * FROM FL_Process WHERE FlowId=" + rFlowId);
         var query = process.Select(p => new
         {
             StepNo   = p.GetFieldValue("StepNo").ToString(),
             Name     = p.GetFieldValue("Name").ToString(),
             NextNode = ShowNextNode(p.GetFieldValue("Next_Nodes").ToString())
         });
         this.ProcessRepeater.DataSource = query;
         this.ProcessRepeater.DataBind();
     }
 }
Exemplo n.º 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);

            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 ");
            }
        }
Exemplo n.º 3
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);
            }
        }
Exemplo n.º 4
0
        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;
        }
Exemplo n.º 5
0
        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");
        }
Exemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //进入条件
                if (Request["Flow_Id"] != null && Request["Flow_Id"] != "")
                {
                    flow            = WX.Flow.Model.Flow.GetCache(rFlowId); //WX.Flow.Model.Flow.NewDataModel(rFlowId);
                    this.FormId     = flow.FormId.ToInt32();
                    MenuBar1.Param1 = this.rFlowId.ToString();
                    bool b = flow.GetProcessByStep(1).GetInAccess(null);
                    if (b == false || flow.IsVisible.ToInt32() == 1)
                    {
                        this.btnSubmit.Enabled = false;
                        this.tooltip.InnerText = flow.GetProcessByStep(1).GetInMsg(null);
                    }
                    //填充流程信息及新工作流水号
                    flow.LoadNumberRule(false);
                    string name = flow.Name.value.ToString();

                    //表单
                    WX.Flow.Model.Form.MODEL formmodel = WX.Flow.Model.Form.NewDataModel(flow.FormId);
                    //WX.Flow.Model.Run.MODEL runmodel;
                    //runmodel = WX.Flow.Model.Run.NewDataModel();
                    //runmodel.FlowId.value = flow.Id.value;
                    ////2.装载Form表单
                    //runmodel.LoadMyFlow(false);
                    //runmodel.LoadMyForm(false);

                    WX.Flow.FormFieldCollection ffedit   = new WX.Flow.FormFieldCollection();
                    WX.Flow.FormFieldCollection ffhidden = new WX.Flow.FormFieldCollection();
                    Literal1.Text = formmodel.GenerateHtmls(formmodel.Items_FormFieldCollection, ffedit, ffhidden, WX.Main.CurUser.UserID).Replace("-SYS_IP-", getIp());
                }
                if (Request["RunID"] != null && Request["RunID"] != "")
                {
                    WX.Flow.Model.Run.MODEL runmodel;
                    runmodel        = WX.Flow.Model.Run.GetModel("select * from FL_Run where Id=" + Request["RunID"]);
                    MenuBar1.Param1 = runmodel.FlowId.ToString();
                    flow            = WX.Flow.Model.Flow.NewDataModel(runmodel.FlowId.ToInt32());
                    //2.装载Form表单
                    runmodel.LoadMyForm(false);
                    Literal1.Text             = runmodel.GenerateHtmls(runmodel.Id.ToInt32());
                    this.txtSerialNumber.Text = runmodel.Name.ToString(); //String.Format("{0}({1})", name, number);
                    btnSubmit.Visible         = false;
                }
                else
                {
                    this.txtSerialNumber.Text = String.Format("{0}({1})", flow.Name.ToString(), WX.Flow.Model.Run.GetFileCode(rFlowId));
                }
                this.labDescription.Text = flow.Description.value.ToString();
                //填充流程步骤列表
                System.Data.DataTable query;
                if (Request["RunID"] != null)
                {
                    query = ULCode.QDA.XSql.GetDataTable("select A.StepNo,A.Name,A.Next_Nodes,emp.RealName+':'+C.Content username from FL_Process A Left join FL_Run B on A.FlowID=B.FlowID left join FL_RunFeedBack C on B.ID=C.RunID and A.StepNo=C.StepNo left join TU_Users emp on C.CheckUserID=emp.UserId where A.FlowId=" + flow.Id.ToString() + " and B.ID=" + Request["RunID"] + " order by A.StepNo asc");
                }
                else
                {
                    query = ULCode.QDA.XSql.GetDataTable("select StepNo,Name,Next_Nodes,'' username from FL_Process where FlowId=" + flow.Id.ToString() + " order by StepNo asc");
                }
                this.ProcessRepeater.DataSource = query;
                this.ProcessRepeater.DataBind();
            }
        }