Esempio n. 1
0
		private Flows_StepInfo MakeNewFsi(Flows_StepInfo fsi)
		{
			Flows_StepInfo flows_StepInfo = new Flows_StepInfo();
			flows_StepInfo.Flow_ID = fsi.Flow_ID;
			flows_StepInfo.IsAct = 1;
			flows_StepInfo.IsEnd = fsi.IsEnd;
			flows_StepInfo.IsHead = fsi.IsHead;
			flows_StepInfo.IsUserEdit = fsi.IsUserEdit;
			flows_StepInfo.IsUserFile = fsi.IsUserFile;
			flows_StepInfo.MailAlert = fsi.MailAlert;
			flows_StepInfo.namelist = fsi.namelist;
			flows_StepInfo.RightToFinish = fsi.RightToFinish;
			flows_StepInfo.Step_Name = fsi.Step_Name;
			flows_StepInfo.Step_Orders = 1;
			flows_StepInfo.Step_Remark = fsi.Step_Remark;
			flows_StepInfo.userlist = fsi.userlist;
			flows_StepInfo.Acts = fsi.Acts;
			Flows_Step.Init().Add(flows_StepInfo);
			return flows_StepInfo;
		}
Esempio n. 2
0
 private void Show()
 {
     if (!string.IsNullOrEmpty(base.Request.QueryString["fm"]))
     {
         this.model_flow.Visible = true;
         this.flow.Visible       = false;
         Flows_ModelInfo byId = Flows_Model.Init().GetById(Convert.ToInt32(base.Request.QueryString["fm"]));
         this.fm_name.InnerText = byId.Flow_Name;
         IList all = Flows_ModelStep.Init().GetAll("Flow_ModelID=" + byId.id, "order by id asc");
         this.rpt_mf.DataSource = all;
         this.rpt_mf.DataBind();
     }
     if (!string.IsNullOrEmpty(base.Request.QueryString["fl"]))
     {
         this.model_flow.Visible = false;
         this.flow.Visible       = true;
         FlowsInfo byId2 = Flows.Init().GetById(Convert.ToInt32(base.Request.QueryString["fl"]));
         this.fl_name.InnerText    = byId2.Flow_Name;
         this.fl_current.InnerHtml = "<u>流程状态</u>:" + this.GetStatus(byId2.Status) + " &nbsp;&nbsp; <u>当前环节</u>:" + byId2.CurrentStepName;
         IList all = Flows_Step.Init().GetAll("isact=0 and flow_id=" + byId2.id, "order by id asc");
         this.rpt_f.DataSource = all;
         this.rpt_f.DataBind();
     }
 }
Esempio n. 3
0
    protected void VerifyStep_Btn(object sender, EventArgs e)
    {
        FlowsInfo     byId = Flows.Init().GetById(Convert.ToInt32(base.Request.QueryString["fl"]));
        string        a    = "";
        List <string> list = new List <string>();

        if (byId.CurrentStepUserList.Contains(",") && byId.CurrentStepUserList.Contains("#") && byId.Status == 0)
        {
            string[] array = byId.CurrentStepUserList.Split(new char[]
            {
                ','
            });
            string[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                string text = array2[i];
                if (text.Contains("#"))
                {
                    list.Add(text.Split(new char[]
                    {
                        '#'
                    })[1]);
                }
            }
        }
        if (list.Contains(this.Uid))
        {
            a = this.Uid;
        }
        if (a != "")
        {
            Flows_StepInfo       flows_StepInfo       = this.ViewState["CurrentStep"] as Flows_StepInfo;
            Flows_StepActionInfo flows_StepActionInfo = new Flows_StepActionInfo();
            flows_StepActionInfo.AddTime           = DateTime.Now;
            flows_StepActionInfo.FlowID            = Convert.ToInt32(base.Request.QueryString["fl"]);
            flows_StepActionInfo.Operation         = 1;
            flows_StepActionInfo.OperationStepID   = flows_StepInfo.id;
            flows_StepActionInfo.OperationWord     = "(同意) :" + base.Request.Form["FlowRemark"];
            flows_StepActionInfo.UserDepName       = this.DepName;
            flows_StepActionInfo.UserID            = Convert.ToInt32(this.Uid);
            flows_StepActionInfo.UserRealName      = this.RealName;
            flows_StepActionInfo.OperationStepName = flows_StepInfo.Step_Name;
            if (flows_StepInfo.IsEnd == 1)
            {
                Flows_StepAction.Init().Add(flows_StepActionInfo);
                FlowsInfo flowsInfo = byId;
                this.AddDoc(flowsInfo.id, flows_StepActionInfo.id);
                flowsInfo.CurrentDocPath = this.filepath.Value;
                if (!this.IsAllVerifid())
                {
                    FlowsInfo expr_216            = flowsInfo;
                    string    hasOperatedUserList = expr_216.HasOperatedUserList;
                    expr_216.HasOperatedUserList = string.Concat(new string[]
                    {
                        hasOperatedUserList,
                        this.RealName,
                        "#",
                        this.Uid,
                        "#",
                        this.DepName,
                        ","
                    });
                    Flows.Init().Update(flowsInfo);
                    MessageBox.ShowAndRedirect(this, "成功审批!", "FlowMenu.aspx");
                }
                else
                {
                    FlowsInfo expr_294            = flowsInfo;
                    string    hasOperatedUserList = expr_294.HasOperatedUserList;
                    expr_294.HasOperatedUserList = string.Concat(new string[]
                    {
                        hasOperatedUserList,
                        this.RealName,
                        "#",
                        this.Uid,
                        "#",
                        this.DepName,
                        ","
                    });
                    Flows.Init().Update(flowsInfo);
                    this.FinishFlow();
                    MessageBox.ShowAndRedirect(this, "成功审批!流程已全部完成!", "FlowMenu.aspx");
                }
            }
            else
            {
                IList all = Flows_Step.Init().GetAll("isact=0 and flow_id=" + base.Request.QueryString["fl"], "order by id asc");
                if (all != null)
                {
                    int num = 0;
                    foreach (object current in all)
                    {
                        Flows_StepInfo flows_StepInfo2 = current as Flows_StepInfo;
                        if (flows_StepInfo2.Acts == flows_StepInfo.Acts)
                        {
                            num = all.IndexOf(current) + 1;
                        }
                    }
                    if (num != 0)
                    {
                        Flows_StepAction.Init().Add(flows_StepActionInfo);
                        FlowsInfo flowsInfo = byId;
                        this.AddDoc(flowsInfo.id, flows_StepActionInfo.id);
                        flowsInfo.CurrentDocPath = this.filepath.Value;
                        if (this.IsAllVerifid())
                        {
                            Flows_StepInfo flows_StepInfo3 = this.MakeNewFsi((Flows_StepInfo)all[num]);
                            flowsInfo.CurrentStepID       = flows_StepInfo3.id;
                            flowsInfo.CurrentStepName     = flows_StepInfo3.Step_Name;
                            flowsInfo.CurrentStepUserList = flows_StepInfo3.userlist;
                            Help.FlowMobleSend(flows_StepInfo3.userlist, flowsInfo.Flow_Name);
                        }
                        FlowsInfo expr_458            = flowsInfo;
                        string    hasOperatedUserList = expr_458.HasOperatedUserList;
                        expr_458.HasOperatedUserList = string.Concat(new string[]
                        {
                            hasOperatedUserList,
                            this.RealName,
                            "#",
                            this.Uid,
                            "#",
                            this.DepName,
                            ","
                        });
                        Flows.Init().Update(flowsInfo);
                        MessageBox.ShowAndRedirect(this, "成功审批!", "FlowMenu.aspx");
                    }
                }
            }
        }
    }
Esempio n. 4
0
    private void Show(string fid)
    {
        FlowsInfo byId = Flows.Init().GetById(Convert.ToInt32(fid));

        if (byId.CurrentStepUserList.Contains("#" + this.Uid + "#") || byId.HasOperatedUserList.Contains("#" + this.Uid + "#") || byId.ViewUserList.Contains("#" + this.Uid + "#") || byId.CreatorID == Convert.ToInt32(this.Uid) || this.Modules.Contains("28"))
        {
            this.ViewState["Flow"]    = byId;
            this.filepath.Value       = byId.CurrentDocPath;
            this.DocBody.InnerHtml    = byId.DocBody;
            this.Flow_Name1.InnerText = byId.Flow_Name;
            this.status.InnerText     = this.GetStatus(byId.Status);
            this.creator.InnerText    = byId.CreatorRealName + "(" + byId.CreatorDepName + ")";
            this.addtime.InnerText    = Utils.ConvertDate1(byId.AddTime);
            this.vlidtime.InnerText   = "永不过期";
            if (byId.IsValid == 1)
            {
                this.vlidtime.InnerText = byId.ValidTime.ToString("yyyy-MM-dd") + " 之前";
            }
            this.currentstepname.InnerText = byId.CurrentStepName;
            if (!string.IsNullOrEmpty(byId.Remark))
            {
                this.bodys.InnerHtml = byId.Remark.Replace("\n", "<br>");
            }
            IList          all           = Flows_Doc.Init().GetAll("flow_id=" + byId.id, "order by id asc");
            List <TmpInfo> list          = new List <TmpInfo>();
            List <TmpInfo> list2         = new List <TmpInfo>();
            List <TmpInfo> list3         = new List <TmpInfo>();
            Flows_DocInfo  flows_DocInfo = null;
            int            j;
            for (int i = 0; i < all.Count; i++)
            {
                Flows_DocInfo flows_DocInfo2 = all[i] as Flows_DocInfo;
                if (i == all.Count - 1)
                {
                    flows_DocInfo = flows_DocInfo2;
                }
                if (flows_DocInfo2.DocPath.Contains("|"))
                {
                    string[] array = flows_DocInfo2.DocPath.Split(new char[]
                    {
                        '|'
                    });
                    for (j = 0; j < array.Length; j++)
                    {
                        if (array[j].Trim() != "")
                        {
                            TmpInfo tmpInfo = new TmpInfo();
                            int     num     = array[j].LastIndexOf('/') + 1;
                            string  tmp     = array[j].Substring(num, array[j].Length - num);
                            string  s       = array[j].Replace("~", "");
                            tmpInfo.Tmp1 = array[j];
                            tmpInfo.Tmp2 = tmp;
                            tmpInfo.Tmp3 = base.Server.UrlEncode(s);
                            tmpInfo.Tmp4 = string.Concat(new string[]
                            {
                                "<span style='color:#999'>(",
                                flows_DocInfo2.UserRealName,
                                "&nbsp;",
                                Utils.ConvertDate1(flows_DocInfo2.AddTime),
                                ")</span>"
                            });
                            list.Add(tmpInfo);
                        }
                    }
                }
            }
            if (flows_DocInfo != null && flows_DocInfo.DocPath.Contains("|"))
            {
                string[] array = flows_DocInfo.DocPath.Split(new char[]
                {
                    '|'
                });
                for (j = 0; j < array.Length; j++)
                {
                    if (array[j].Trim() != "")
                    {
                        TmpInfo tmpInfo = new TmpInfo();
                        int     num     = array[j].LastIndexOf('/') + 1;
                        string  tmp     = array[j].Substring(num, array[j].Length - num);
                        string  s       = array[j].Replace("~", "");
                        tmpInfo.Tmp1 = array[j];
                        tmpInfo.Tmp2 = tmp;
                        tmpInfo.Tmp3 = base.Server.UrlEncode(s);
                        tmpInfo.Tmp4 = string.Concat(new string[]
                        {
                            "<span style='color:#999'>(",
                            flows_DocInfo.UserRealName,
                            "&nbsp;",
                            Utils.ConvertDate1(flows_DocInfo.AddTime),
                            ")</span>"
                        });
                        list2.Add(tmpInfo);
                    }
                }
            }
            //j = 0;
            //IL_52F:
            //while (j < list2.Count)
            //{
            //    TmpInfo tmpInfo2 = list2[j];
            //    for (int i = 0; i < list.Count; i++)
            //    {
            //        TmpInfo tmpInfo3 = list[i];
            //        if (tmpInfo2.Tmp1 == tmpInfo3.Tmp1)
            //        {
            //            tmpInfo2.Tmp4 = tmpInfo3.Tmp4;
            //            IL_520:
            //            list3.Add(tmpInfo2);
            //            j++;
            //            goto IL_52F;
            //        }
            //    }
            //    goto IL_520;
            //}


            j = 0;
            while (j < list2.Count)
            {
                TmpInfo tmpInfo2 = list2[j];
                for (int i = 0; i < list.Count; i++)
                {
                    TmpInfo tmpInfo3 = list[i];
                    if (tmpInfo2.Tmp1 == tmpInfo3.Tmp1)
                    {
                        tmpInfo2.Tmp4 = tmpInfo3.Tmp4;
                        break;
                    }
                }
                list3.Add(tmpInfo2);
                j++;
            }

            for (j = 0; j < list2.Count; j++)
            {
                TmpInfo tmpInfo2 = list2[j];
                for (int i = 0; i < list.Count; i++)
                {
                    TmpInfo tmpInfo3 = list[i];
                    if (tmpInfo2.Tmp1 == tmpInfo3.Tmp1)
                    {
                        tmpInfo2.Tmp4 = tmpInfo3.Tmp4;
                        list3.Add(tmpInfo2);
                    }
                }
            }



            if (list3.Count > 0)
            {
                this.rpt.DataSource = list3;
                this.rpt.DataBind();
            }
            Flows_StepInfo byId2 = Flows_Step.Init().GetById(byId.CurrentStepID);
            this.ViewState["CurrentStep"] = byId2;
            string text = "";
            IList  all2 = Flows_StepAction.Init().GetAll(string.Concat(new object[]
            {
                "OperationStepID=",
                byId.CurrentStepID,
                " and FlowID=",
                byId.id
            }), "order by id asc");
            string[] array2 = byId.CurrentStepUserList.Split(new char[]
            {
                ','
            });
            List <string> list4 = new List <string>();
            for (j = 0; j < array2.Length; j++)
            {
                if (array2[j].Contains("#"))
                {
                    list4.Add(array2[j].Split(new char[]
                    {
                        '#'
                    })[0].Trim());
                }
            }
            foreach (object current in all2)
            {
                Flows_StepActionInfo flows_StepActionInfo = current as Flows_StepActionInfo;
                if (flows_StepActionInfo.Operation == 1)
                {
                    text = text + flows_StepActionInfo.UserRealName + "[已签/同意], ";
                    if (list4.Contains(flows_StepActionInfo.UserRealName.Trim()))
                    {
                        list4.Remove(flows_StepActionInfo.UserRealName.Trim());
                    }
                }
                if (flows_StepActionInfo.Operation == -1)
                {
                    text = text + flows_StepActionInfo.UserRealName + "[已签/不同意], ";
                    if (list4.Contains(flows_StepActionInfo.UserRealName.Trim()))
                    {
                        list4.Remove(flows_StepActionInfo.UserRealName.Trim());
                    }
                }
            }
            foreach (string current2 in list4)
            {
                text = text + current2 + "[未审批], ";
            }
            this.currentuserlist.InnerHtml = text;
            IList         all3           = Flows_StepAction.Init().GetAll("FlowID=" + byId.id, "order by id asc");
            IList         all4           = Flows_Doc.Init().GetAll("StepAction_ID=0 and flow_id=" + byId.id, null);
            Flows_DocInfo flows_DocInfo3 = all4[0] as Flows_DocInfo;
            base.Server.UrlEncode(flows_DocInfo3.DocPath.Replace("~", ""));
            string text2 = this.yjs;
            this.yjs = string.Concat(new string[]
            {
                text2,
                "0、<u>流程申请</u> &nbsp; ",
                byId.CreatorRealName,
                " 在 ",
                Utils.ConvertDate2(byId.AddTime),
                " 发起流程(申请人) <br>"
            });
            foreach (object current in all3)
            {
                Flows_StepActionInfo flows_StepActionInfo = current as Flows_StepActionInfo;
                IList all5 = Flows_Doc.Init().GetAll("StepAction_ID=" + flows_StepActionInfo.id, null);
                if (all5.Count == 0)
                {
                    object obj = this.yjs;
                    this.yjs = string.Concat(new object[]
                    {
                        obj,
                        all3.IndexOf(current) + 1,
                        "、<u>",
                        flows_StepActionInfo.OperationStepName,
                        "</u> &nbsp; ",
                        flows_StepActionInfo.UserRealName,
                        " 在 ",
                        Utils.ConvertDate2(flows_StepActionInfo.AddTime),
                        " 已审 &nbsp;<strong style='color:#ff0000'>",
                        flows_StepActionInfo.OperationWord,
                        "</strong><br>"
                    });
                }
                else
                {
                    Flows_DocInfo flows_DocInfo4 = all5[0] as Flows_DocInfo;
                    base.Server.UrlEncode(flows_DocInfo4.DocPath.Replace("~", ""));
                    object obj = this.yjs;
                    this.yjs = string.Concat(new object[]
                    {
                        obj,
                        all3.IndexOf(current) + 1,
                        "、<u>",
                        flows_StepActionInfo.OperationStepName,
                        "</u> &nbsp; ",
                        flows_StepActionInfo.UserRealName,
                        " 在 ",
                        Utils.ConvertDate2(flows_StepActionInfo.AddTime),
                        " 已审 ",
                        flows_StepActionInfo.OperationWord,
                        "<br>"
                    });
                }
            }
            if (byId.ViewUserList.Contains(","))
            {
                string[] array3 = byId.ViewUserList.Split(new char[]
                {
                    ','
                });
                for (j = 0; j < array3.Length; j++)
                {
                    if (array3[j].Contains("#"))
                    {
                        HtmlGenericControl expr_A97 = this.viewuserlist;
                        expr_A97.InnerText = expr_A97.InnerText + array3[j].Split(new char[]
                        {
                            '#'
                        })[0] + ",";
                    }
                }
            }
            if (list4.Contains(this.RealName.Trim()) && byId.Status == 0)
            {
                this.displays.Visible = true;
                this.b1.Enabled       = true;
                this.b2.Enabled       = true;
                if (byId2.RightToFinish == 1)
                {
                    this.b3.Visible = true;
                    this.b3.Enabled = true;
                }
            }
        }
        else
        {
            base.Response.Write("<script>alert('您没有查看权限');window.location='FlowList.aspx?action=verify';</script>");
        }
    }
Esempio n. 5
0
		protected void Save_Btn(object sender, EventArgs e)
		{
			if (this.rpt_steps.Items.Count > 0)
			{
				bool flag = true;
				for (int i = 0; i < this.rpt_steps.Items.Count; i++)
				{
					Label label = this.rpt_steps.Items[i].FindControl("stepid") as Label;
					if (string.IsNullOrEmpty(base.Request.Form["namelist" + label.Text]))
					{
						flag = false;
					}
				}
				if (flag)
				{
					FlowsInfo flowsInfo = new FlowsInfo();
					if (Convert.ToInt32(this.Model_Type.SelectedValue) > 0)
					{
						flowsInfo.ComID = Convert.ToInt32(this.Model_Type.SelectedValue);
					}
					flowsInfo.ModelName = this.ModelFlowList.Items[this.ModelFlowList.SelectedIndex].Text;
					flowsInfo.Flow_Name = this.Flow_Name.Value;
					flowsInfo.CurrentDocPath = this.filepath.Value;
					flowsInfo.DocBody = this.DocBody.Value;
					flowsInfo.ValidTime = DateTime.Now;
					flowsInfo.AddTime = DateTime.Now;
					flowsInfo.ViewUserList = this.userlist.Value;
					if (Utils.IsDate(this.ValidTime.Value))
					{
						flowsInfo.ValidTime = Convert.ToDateTime(this.ValidTime.Value);
						flowsInfo.IsValid = 1;
					}
					flowsInfo.Remark = this.FlowRemark.Value;
					flowsInfo.CreatorID = Convert.ToInt32(this.Uid);
					flowsInfo.CreatorRealName = this.RealName;
					flowsInfo.CreatorDepName = this.DepName;
					flowsInfo.HasOperatedUserList = "";
					flowsInfo.Flow_Files = this.UpdateFiles();
					Flows.Init().Add(flowsInfo);
					for (int i = 0; i < this.rpt_steps.Items.Count; i++)
					{
						Label label = this.rpt_steps.Items[i].FindControl("stepid") as Label;
						Label label2 = this.rpt_steps.Items[i].FindControl("isuseredit") as Label;
						Label label3 = this.rpt_steps.Items[i].FindControl("IsHead") as Label;
						Label label4 = this.rpt_steps.Items[i].FindControl("IsEnd") as Label;
						Label label5 = this.rpt_steps.Items[i].FindControl("MailAlert") as Label;
						Label label6 = this.rpt_steps.Items[i].FindControl("RightToFinish") as Label;
						Label label7 = this.rpt_steps.Items[i].FindControl("Step_Orders") as Label;
						Label label8 = this.rpt_steps.Items[i].FindControl("Step_Name") as Label;
						Label label9 = this.rpt_steps.Items[i].FindControl("IsUserFile") as Label;
						string text = label.Text;
						Flows_StepInfo flows_StepInfo = new Flows_StepInfo();
						flows_StepInfo.Flow_ID = flowsInfo.id;
						flows_StepInfo.IsEnd = Convert.ToInt32(label4.Text);
						flows_StepInfo.IsHead = Convert.ToInt32(label3.Text);
						flows_StepInfo.IsUserEdit = Convert.ToInt32(label2.Text);
						flows_StepInfo.IsUserFile = Convert.ToInt32(label9.Text);
						flows_StepInfo.MailAlert = Convert.ToInt32(label5.Text);
						flows_StepInfo.RightToFinish = Convert.ToInt32(label6.Text);
						flows_StepInfo.Step_Name = label8.Text;
						flows_StepInfo.Step_Orders = Convert.ToInt32(label7.Text);
						flows_StepInfo.userlist = base.Request.Form["userlist" + text];
						flows_StepInfo.namelist = base.Request.Form["namelist" + text];
						flows_StepInfo.Acts = Guid.NewGuid().ToString();
						Flows_Step.Init().Add(flows_StepInfo);
						if (i == 0)
						{
							Flows_StepInfo flows_StepInfo2 = this.MakeNewFsi(flows_StepInfo);
							flowsInfo.CurrentStepID = flows_StepInfo2.id;
							flowsInfo.CurrentStepName = flows_StepInfo2.Step_Name;
							flowsInfo.CurrentStepUserList = flows_StepInfo2.userlist;
							Help.FlowMobleSend(flows_StepInfo2.userlist, flowsInfo.Flow_Name);
						}
					}
					Flows.Init().Update(flowsInfo);
					Flows_DocInfo flows_DocInfo = new Flows_DocInfo();
					flows_DocInfo.AddTime = DateTime.Now;
					flows_DocInfo.DocPath = flowsInfo.Flow_Files;
					flows_DocInfo.DocBody = flowsInfo.DocBody;
					flows_DocInfo.Flow_ID = flowsInfo.id;
					flows_DocInfo.UserDepName = this.DepName;
					flows_DocInfo.UserID = Convert.ToInt32(this.Uid);
					flows_DocInfo.UserRealName = this.RealName;
					Flows_Doc.Init().Add(flows_DocInfo);
					string str = HttpContext.Current.Server.HtmlEncode("您好!新建工作流程成功!");
					base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
				}
				else
				{
					base.Response.Write("<script>alert('审批人员 不能为空!')</script>");
				}
			}
			else
			{
				base.Response.Write("<script>alert('工作流程没有审批步骤!');window.location='Flow_Manage.aspx'</script>");
			}
		}
Esempio n. 6
0
    private void Show(string fid)
    {
        SqlParameter sqlParameter = new SqlParameter();

        sqlParameter.ParameterName = "@uid";
        sqlParameter.Size          = 50;
        sqlParameter.Value         = this.Uid;
        SqlParameter sqlParameter2 = new SqlParameter();

        sqlParameter2.Direction     = ParameterDirection.Output;
        sqlParameter2.ParameterName = "@pt1";
        sqlParameter2.Size          = 4;
        SqlParameter sqlParameter3 = new SqlParameter();

        sqlParameter3.Direction     = ParameterDirection.Output;
        sqlParameter3.ParameterName = "@pt2";
        sqlParameter3.Size          = 4;
        SqlParameter sqlParameter4 = new SqlParameter();

        sqlParameter4.Direction     = ParameterDirection.Output;
        sqlParameter4.ParameterName = "@pt3";
        sqlParameter4.Size          = 4;
        SqlParameter sqlParameter5 = new SqlParameter();

        sqlParameter5.Direction     = ParameterDirection.Output;
        sqlParameter5.ParameterName = "@pt4";
        sqlParameter5.Size          = 4;
        SqlParameter[] cmdParms = new SqlParameter[]
        {
            sqlParameter2,
            sqlParameter3,
            sqlParameter4,
            sqlParameter5,
            sqlParameter
        };
        MsSqlOperate.ExecuteNonQuery(CommandType.StoredProcedure, "Flows_GetUserFlowBoxCount", cmdParms);
        this.wdpy.InnerText = string.Concat(sqlParameter2.Value);
        this.yjpy.InnerText = string.Concat(sqlParameter3.Value);
        this.wdsq.InnerText = string.Concat(sqlParameter4.Value);
        this.view.InnerText = string.Concat(sqlParameter5.Value);
        FlowsInfo byId = Flows.Init().GetById(Convert.ToInt32(fid));

        if (byId.CurrentStepUserList.Contains("#" + this.Uid + "#") || byId.HasOperatedUserList.Contains("#" + this.Uid + "#") || byId.ViewUserList.Contains("#" + this.Uid + "#") || byId.CreatorID == Convert.ToInt32(this.Uid) || this.Modules.Contains("28"))
        {
            this.ViewState["Flow"]    = byId;
            this.filepath.Value       = byId.CurrentDocPath;
            this.DocBody.Value        = byId.DocBody;
            this.Flow_Name1.InnerText = byId.Flow_Name;
            this.ModelType.InnerText  = this.GetModelType(byId.ComID);
            this.ke_isread            = ", afterCreate : function(id) { KE.toolbar.disable(id, []); KE.readonly(id); KE.g[id].newTextarea.disabled = true; } ";
            this.url = this.url.ToLower().Replace("/manage/flow", "");
            this.LoadOriginalFile   = this.url + byId.CurrentDocPath.Replace("~", "");
            this.tuli.InnerHtml     = " <a href='Flow_Graph.aspx?fl=" + byId.id + "' target=_blank>[点击查看]</a>";
            this.flowNo.InnerText   = byId.AddTime.Year + "-" + (100000 + byId.id);
            this.status.InnerText   = this.GetStatus(byId.Status);
            this.creator.InnerText  = byId.CreatorRealName + "(" + byId.CreatorDepName + ")";
            this.addtime.InnerText  = Utils.ConvertDate2(byId.AddTime);
            this.vlidtime.InnerText = "永不过期";
            if (byId.IsValid == 1)
            {
                this.vlidtime.InnerText = byId.ValidTime.ToString("yyyy-MM-dd") + " 之前";
            }
            this.currentstepname.InnerText = byId.CurrentStepName;
            if (!string.IsNullOrEmpty(byId.Remark))
            {
                this.bodys.InnerHtml = byId.Remark.Replace("\n", "<br>");
            }
            IList          all           = Flows_Doc.Init().GetAll("flow_id=" + byId.id, "order by id asc");
            List <TmpInfo> list          = new List <TmpInfo>();
            List <TmpInfo> list2         = new List <TmpInfo>();
            List <TmpInfo> list3         = new List <TmpInfo>();
            Flows_DocInfo  flows_DocInfo = null;
            int            j;
            for (int i = 0; i < all.Count; i++)
            {
                Flows_DocInfo flows_DocInfo2 = all[i] as Flows_DocInfo;
                if (i == all.Count - 1)
                {
                    flows_DocInfo = flows_DocInfo2;
                }
                if (flows_DocInfo2.DocPath.Contains("|"))
                {
                    string[] array = flows_DocInfo2.DocPath.Split(new char[]
                    {
                        '|'
                    });
                    for (j = 0; j < array.Length; j++)
                    {
                        if (array[j].Trim() != "")
                        {
                            TmpInfo tmpInfo = new TmpInfo();
                            int     num     = array[j].LastIndexOf('/') + 1;
                            string  tmp     = array[j].Substring(num, array[j].Length - num);
                            string  s       = array[j].Replace("~", "");
                            tmpInfo.Tmp1 = array[j];
                            tmpInfo.Tmp2 = tmp;
                            tmpInfo.Tmp3 = base.Server.UrlEncode(s);
                            tmpInfo.Tmp4 = string.Concat(new string[]
                            {
                                " &nbsp;&nbsp; <span style='color:#999'> &nbsp; - (",
                                flows_DocInfo2.UserRealName,
                                "&nbsp;",
                                Utils.ConvertDate1(flows_DocInfo2.AddTime),
                                ")</span>"
                            });
                            list.Add(tmpInfo);
                        }
                    }
                }
            }
            if (flows_DocInfo != null && flows_DocInfo.DocPath.Contains("|"))
            {
                string[] array = flows_DocInfo.DocPath.Split(new char[]
                {
                    '|'
                });
                for (j = 0; j < array.Length; j++)
                {
                    if (array[j].Trim() != "")
                    {
                        TmpInfo tmpInfo = new TmpInfo();
                        int     num     = array[j].LastIndexOf('/') + 1;
                        string  tmp     = array[j].Substring(num, array[j].Length - num);
                        string  s       = array[j].Replace("~", "");
                        tmpInfo.Tmp1 = array[j];
                        tmpInfo.Tmp2 = tmp;
                        tmpInfo.Tmp3 = base.Server.UrlEncode(s);
                        tmpInfo.Tmp4 = string.Concat(new string[]
                        {
                            " &nbsp;&nbsp; <span style='color:#999'> &nbsp; - (",
                            flows_DocInfo.UserRealName,
                            "&nbsp;",
                            Utils.ConvertDate1(flows_DocInfo.AddTime),
                            ")</span>"
                        });
                        list2.Add(tmpInfo);
                    }
                }
            }
            j = 0;
            //IL_74B:
            while (j < list2.Count)
            {
                TmpInfo tmpInfo2 = list2[j];
                for (int i = 0; i < list.Count; i++)
                {
                    TmpInfo tmpInfo3 = list[i];
                    if (tmpInfo2.Tmp1 == tmpInfo3.Tmp1)
                    {
                        tmpInfo2.Tmp4 = tmpInfo3.Tmp4;
                        //                     //IL_73C:
                        //list3.Add(tmpInfo2);
                        //j++;
                        ////goto IL_74B;
                        break;
                    }
                }
                list3.Add(tmpInfo2);
                j++;
                //goto IL_73C;
            }
            if (list3.Count > 0)
            {
                this.rpt.DataSource = list3;
                this.rpt.DataBind();
            }
            Flows_StepInfo byId2 = Flows_Step.Init().GetById(byId.CurrentStepID);
            this.ViewState["CurrentStep"] = byId2;
            string text = "";
            IList  all2 = Flows_StepAction.Init().GetAll(string.Concat(new object[]
            {
                "OperationStepID=",
                byId.CurrentStepID,
                " and FlowID=",
                byId.id
            }), "order by id asc");
            string[] array2 = byId.CurrentStepUserList.Split(new char[]
            {
                ','
            });
            List <string> list4 = new List <string>();
            for (j = 0; j < array2.Length; j++)
            {
                if (array2[j].Contains("#"))
                {
                    list4.Add(array2[j].Split(new char[]
                    {
                        '#'
                    })[0].Trim());
                }
            }
            foreach (object current in all2)
            {
                Flows_StepActionInfo flows_StepActionInfo = current as Flows_StepActionInfo;
                if (flows_StepActionInfo.Operation == 1)
                {
                    text = text + flows_StepActionInfo.UserRealName + "[已签/同意], ";
                    if (list4.Contains(flows_StepActionInfo.UserRealName.Trim()))
                    {
                        list4.Remove(flows_StepActionInfo.UserRealName.Trim());
                    }
                }
                if (flows_StepActionInfo.Operation == -1)
                {
                    text = text + flows_StepActionInfo.UserRealName + "[已签/不同意], ";
                    if (list4.Contains(flows_StepActionInfo.UserRealName.Trim()))
                    {
                        list4.Remove(flows_StepActionInfo.UserRealName.Trim());
                    }
                }
            }
            foreach (string current2 in list4)
            {
                text = text + current2 + "[未审批], ";
            }
            this.currentuserlist.InnerHtml = text;
            IList         all3           = Flows_StepAction.Init().GetAll("FlowID=" + byId.id, "order by id asc");
            IList         all4           = Flows_Doc.Init().GetAll("StepAction_ID=0 and flow_id=" + byId.id, null);
            Flows_DocInfo flows_DocInfo3 = all4[0] as Flows_DocInfo;
            base.Server.UrlEncode(flows_DocInfo3.DocPath.Replace("~", ""));
            object obj = this.yjs;
            this.yjs = string.Concat(new object[]
            {
                obj,
                "0、<u>流程申请</u> &nbsp;&nbsp; ",
                byId.CreatorRealName,
                " 在 ",
                Utils.ConvertDate2(byId.AddTime),
                " 发起流程(申请人) &nbsp;&nbsp; <a href='../../Manage/Flow/DocBodyView.aspx?gid=",
                flows_DocInfo3.id,
                "' target='_blank' ><strong>查看申请人原件</strong></a> <br>"
            });
            foreach (object current in all3)
            {
                Flows_StepActionInfo flows_StepActionInfo = current as Flows_StepActionInfo;
                IList all5 = Flows_Doc.Init().GetAll("StepAction_ID=" + flows_StepActionInfo.id, null);
                if (all5.Count == 0)
                {
                    obj      = this.yjs;
                    this.yjs = string.Concat(new object[]
                    {
                        obj,
                        all3.IndexOf(current) + 1,
                        "、<u>",
                        flows_StepActionInfo.OperationStepName,
                        "</u> &nbsp;&nbsp; ",
                        flows_StepActionInfo.UserRealName,
                        " 在 ",
                        Utils.ConvertDate2(flows_StepActionInfo.AddTime),
                        " 已审  &nbsp;&nbsp;<strong style='color:#ff0000'>",
                        flows_StepActionInfo.OperationWord,
                        "</strong><br>"
                    });
                }
                else
                {
                    Flows_DocInfo flows_DocInfo4 = all5[0] as Flows_DocInfo;
                    base.Server.UrlEncode(flows_DocInfo4.DocPath.Replace("~", ""));
                    obj      = this.yjs;
                    this.yjs = string.Concat(new object[]
                    {
                        obj,
                        all3.IndexOf(current) + 1,
                        "、<u>",
                        flows_StepActionInfo.OperationStepName,
                        "</u> &nbsp;&nbsp; ",
                        flows_StepActionInfo.UserRealName,
                        " 在 ",
                        Utils.ConvertDate2(flows_StepActionInfo.AddTime),
                        " 已审 ",
                        flows_StepActionInfo.OperationWord,
                        " &nbsp;&nbsp; <a href='../../Manage/Flow/DocBodyView.aspx?gid=",
                        flows_DocInfo4.id,
                        "' target='_blank' ><strong>查看文件变动</strong></a> <br>"
                    });
                }
            }
            if (byId.ViewUserList.Contains(","))
            {
                string[] array3 = byId.ViewUserList.Split(new char[]
                {
                    ','
                });
                for (j = 0; j < array3.Length; j++)
                {
                    if (array3[j].Contains("#"))
                    {
                        HtmlGenericControl expr_CF1 = this.viewuserlist;
                        expr_CF1.InnerText = expr_CF1.InnerText + array3[j].Split(new char[]
                        {
                            '#'
                        })[0] + ",";
                    }
                }
            }
            if (list4.Contains(this.RealName.Trim()) && byId.Status == 0)
            {
                this.ke_isread       = "";
                this.display.Visible = true;
                this.b1.Enabled      = true;
                this.b2.Enabled      = true;
                IList all6 = Sys_Seal.Init().GetAll("uid=" + this.Uid + " and status=1", null);
                if (all6.Count > 0)
                {
                    this.seal.Visible            = true;
                    this.seallist.DataSource     = all6;
                    this.seallist.DataTextField  = "SealName";
                    this.seallist.DataValueField = "id";
                    this.seallist.DataBind();
                }
                if (byId2.RightToFinish == 1)
                {
                    this.b3.Enabled = true;
                }
                if (byId2.IsUserFile == 1)
                {
                    for (j = 0; j < this.rpt.Items.Count; j++)
                    {
                        HtmlInputCheckBox htmlInputCheckBox = this.rpt.Items[j].FindControl("chk") as HtmlInputCheckBox;
                        htmlInputCheckBox.Disabled = false;
                    }
                }
            }
        }
        else
        {
            base.Response.Write("<script>alert('您没有查看权限');window.location='Flow_List.aspx?action=verify';</script>");
        }
    }
Esempio n. 7
0
    protected void RefuseStep_Btn(object sender, EventArgs e)
    {
        FlowsInfo     byId = Flows.Init().GetById(Convert.ToInt32(base.Request.QueryString["fl"]));
        string        a    = "";
        List <string> list = new List <string>();

        if (byId.CurrentStepUserList.Contains(",") && byId.CurrentStepUserList.Contains("#") && byId.Status == 0)
        {
            string[] array = byId.CurrentStepUserList.Split(new char[]
            {
                ','
            });
            string[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                string text = array2[i];
                if (text.Contains("#"))
                {
                    list.Add(text.Split(new char[]
                    {
                        '#'
                    })[1]);
                }
            }
        }
        if (list.Contains(this.Uid))
        {
            a = this.Uid;
        }
        if (a != "")
        {
            Flows_StepInfo       flows_StepInfo       = this.ViewState["CurrentStep"] as Flows_StepInfo;
            Flows_StepActionInfo flows_StepActionInfo = new Flows_StepActionInfo();
            flows_StepActionInfo.AddTime           = DateTime.Now;
            flows_StepActionInfo.FlowID            = Convert.ToInt32(base.Request.QueryString["fl"]);
            flows_StepActionInfo.Operation         = -1;
            flows_StepActionInfo.OperationStepID   = flows_StepInfo.id;
            flows_StepActionInfo.OperationWord     = "(不同意) :" + base.Request.Form["FlowRemark"];
            flows_StepActionInfo.UserDepName       = this.DepName;
            flows_StepActionInfo.UserID            = Convert.ToInt32(this.Uid);
            flows_StepActionInfo.UserRealName      = this.RealName;
            flows_StepActionInfo.OperationStepName = flows_StepInfo.Step_Name;
            if (flows_StepInfo.IsHead == 1)
            {
                Flows_StepAction.Init().Add(flows_StepActionInfo);
                this.AddDoc(flows_StepActionInfo.FlowID, flows_StepActionInfo.id);
                byId.CurrentDocPath = this.filepath.Value;
                byId.DocBody        = this.DocBody.Value;
                Flows.Init().Update(byId);
                this.BackFlow();
                string str = HttpContext.Current.Server.HtmlEncode("您好!操作成功,流程已退回!");
                base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
            }
            else
            {
                IList all = Flows_Step.Init().GetAll("isact=0 and flow_id=" + base.Request.QueryString["fl"], "order by id asc");
                if (all != null)
                {
                    int num = -1;
                    foreach (object current in all)
                    {
                        Flows_StepInfo flows_StepInfo2 = current as Flows_StepInfo;
                        if (flows_StepInfo2.Acts == flows_StepInfo.Acts)
                        {
                            num = all.IndexOf(current) - 1;
                        }
                    }
                    if (num >= 0)
                    {
                        Flows_StepInfo flows_StepInfo3 = this.MakeNewFsi((Flows_StepInfo)all[num]);
                        Flows_StepAction.Init().Add(flows_StepActionInfo);
                        FlowsInfo flowsInfo = byId;
                        this.AddDoc(flows_StepActionInfo.FlowID, flows_StepActionInfo.id);
                        flowsInfo.CurrentDocPath      = this.filepath.Value;
                        flowsInfo.DocBody             = this.DocBody.Value;
                        flowsInfo.CurrentStepID       = flows_StepInfo3.id;
                        flowsInfo.CurrentStepName     = flows_StepInfo3.Step_Name;
                        flowsInfo.CurrentStepUserList = flows_StepInfo3.userlist;
                        FlowsInfo expr_3A7            = flowsInfo;
                        string    hasOperatedUserList = expr_3A7.HasOperatedUserList;
                        expr_3A7.HasOperatedUserList = string.Concat(new string[]
                        {
                            hasOperatedUserList,
                            this.RealName,
                            "#",
                            this.Uid,
                            "#",
                            this.DepName,
                            ","
                        });
                        Flows.Init().Update(flowsInfo);
                        Help.FlowMobleSend(flows_StepInfo3.userlist, flowsInfo.Flow_Name);
                        string str = HttpContext.Current.Server.HtmlEncode("您好!操作成功,流程已返回!");
                        base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
                    }
                }
            }
        }
    }