Пример #1
0
		private void AddDoc(int fid, int stepid)
		{
			GovInfo govInfo = this.ViewState["Flow"] as GovInfo;
			Gov_DocInfo gov_DocInfo = new Gov_DocInfo();
			gov_DocInfo.AddTime = DateTime.Now;
			gov_DocInfo.DocPath = this.filepath.Value;
			gov_DocInfo.DocBody = govInfo.DocBody;
			gov_DocInfo.Flow_ID = fid;
			gov_DocInfo.StepAction_ID = stepid;
			gov_DocInfo.UserDepName = this.DepName;
			gov_DocInfo.UserRealName = this.RealName;
			gov_DocInfo.UserID = Convert.ToInt32(this.Uid);
			Gov_Doc.Init().Add(gov_DocInfo);
		}
Пример #2
0
    protected void Del(object sender, EventArgs e)
    {
        LinkButton        linkButton        = sender as LinkButton;
        RepeaterItem      repeaterItem      = linkButton.Parent as RepeaterItem;
        HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox;
        string            value             = htmlInputCheckBox.Value;

        try
        {
            int     num  = Convert.ToInt32(value);
            GovInfo byId = Gov.Init().GetById(num);
            if (byId != null)
            {
                Help.DeleteFiles(byId.Flow_Files);
                Help.DeleteFiles(byId.CurrentDocPath);
            }
            IList all = Gov_Doc.Init().GetAll("flow_id=" + num, null);
            if (all != null && all.Count > 0)
            {
                foreach (object current in all)
                {
                    Gov_DocInfo gov_DocInfo = current as Gov_DocInfo;
                    Help.DeleteFiles(gov_DocInfo.DocPath);
                }
            }
        }
        catch
        {
        }
        string text  = "delete from Gov where id=" + value + ";";
        string text2 = "delete from Gov_Step where Flow_ID=" + value + ";";
        string text3 = "delete from Gov_StepAction where FlowID=" + value + ";";
        string text4 = "delete from Gov_Doc where Flow_ID=" + value + ";";
        string text5 = "delete from Gov_Recipient where Flow_ID=" + value + ";";

        MsSqlOperate.ExecuteNonQuery(CommandType.Text, string.Concat(new string[]
        {
            text,
            text2,
            text3,
            text4,
            text5
        }), new SqlParameter[0]);
        this.Show();
    }
Пример #3
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 && this.userlist.Value.Contains(","))
				{
					GovInfo govInfo = new GovInfo();
					if (Convert.ToInt32(this.Model_Type.SelectedValue) > 0)
					{
						govInfo.ComID = Convert.ToInt32(this.Model_Type.SelectedValue);
					}
					govInfo.ModelName = this.ModelFlowList.Items[this.ModelFlowList.SelectedIndex].Text;
					govInfo.Flow_Name = this.Flow_Name.Value;
					govInfo.DocNo = this.DocNo.Value;
					govInfo.Secret = base.Request.Form["Secret"];
					govInfo.CurrentDocPath = this.filepath.Value;
					govInfo.DocBody = this.DocBody.Value;
					govInfo.ValidTime = DateTime.Now;
					govInfo.AddTime = DateTime.Now;
					if (Utils.IsDate(this.ValidTime.Value))
					{
						govInfo.ValidTime = Convert.ToDateTime(this.ValidTime.Value);
						govInfo.IsValid = 1;
					}
					govInfo.Remark = this.FlowRemark.Value;
					govInfo.CreatorID = Convert.ToInt32(this.Uid);
					govInfo.CreatorRealName = this.RealName;
					govInfo.CreatorDepName = this.DepName;
					govInfo.HasOperatedUserList = "";
					govInfo.Flow_Files = this.UpdateFiles();
					Gov.Init().Add(govInfo);
					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;
						Gov_StepInfo gov_StepInfo = new Gov_StepInfo();
						gov_StepInfo.Flow_ID = govInfo.id;
						gov_StepInfo.IsEnd = Convert.ToInt32(label4.Text);
						gov_StepInfo.IsHead = Convert.ToInt32(label3.Text);
						gov_StepInfo.IsUserEdit = Convert.ToInt32(label2.Text);
						gov_StepInfo.IsUserFile = Convert.ToInt32(label9.Text);
						gov_StepInfo.MailAlert = Convert.ToInt32(label5.Text);
						gov_StepInfo.RightToFinish = Convert.ToInt32(label6.Text);
						gov_StepInfo.Step_Name = label8.Text;
						gov_StepInfo.Step_Orders = Convert.ToInt32(label7.Text);
						gov_StepInfo.userlist = base.Request.Form["userlist" + text];
						gov_StepInfo.namelist = base.Request.Form["namelist" + text];
						gov_StepInfo.Acts = Guid.NewGuid().ToString();
						Gov_Step.Init().Add(gov_StepInfo);
						if (i == 0)
						{
							Gov_StepInfo gov_StepInfo2 = this.MakeNewFsi(gov_StepInfo);
							govInfo.CurrentStepID = gov_StepInfo2.id;
							govInfo.CurrentStepName = gov_StepInfo2.Step_Name;
							govInfo.CurrentStepUserList = gov_StepInfo2.userlist;
						}
					}
					Gov.Init().Update(govInfo);
					Gov_DocInfo gov_DocInfo = new Gov_DocInfo();
					gov_DocInfo.AddTime = DateTime.Now;
					gov_DocInfo.DocPath = govInfo.CurrentDocPath;
					gov_DocInfo.DocBody = govInfo.DocBody;
					gov_DocInfo.Flow_ID = govInfo.id;
					gov_DocInfo.UserDepName = this.DepName;
					gov_DocInfo.UserID = Convert.ToInt32(this.Uid);
					gov_DocInfo.UserRealName = this.RealName;
					Gov_Doc.Init().Add(gov_DocInfo);
					string[] array = this.userlist.Value.Split(new char[]
					{
						','
					});
					for (int i = 0; i < array.Length; i++)
					{
						if (array[i].Trim() != "")
						{
							string[] array2 = array[i].Split(new char[]
							{
								'#'
							});
							Gov_RecipientInfo gov_RecipientInfo = new Gov_RecipientInfo();
							gov_RecipientInfo.Flow_ID = govInfo.id;
							gov_RecipientInfo.SignTime = DateTime.Now;
							gov_RecipientInfo.UserRealName = array2[0];
							gov_RecipientInfo.UserID = Convert.ToInt32(array2[1].Trim());
							gov_RecipientInfo.UserDepName = array2[2];
							Gov_Recipient.Init().Add(gov_RecipientInfo);
						}
					}
					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='Gov_Manage.aspx'</script>");
			}
		}
Пример #4
0
		private void Show(string fid)
		{
			GovInfo byId = Gov.Init().GetById(Convert.ToInt32(fid));
			if (byId.CurrentStepUserList.Contains("#" + this.Uid + "#") || byId.HasOperatedUserList.Contains("#" + this.Uid + "#") || byId.CreatorID == Convert.ToInt32(this.Uid) || this.Modules.Contains("38"))
			{
				this.ViewState["Flow"] = byId;
				this.filepath.Value = byId.CurrentDocPath;
				this.DocBody.InnerHtml = byId.DocBody;
				this.Flow_Name1.InnerText = byId.Flow_Name;
				this.ModelType.InnerText = this.GetModelType(byId.ComID);
				this.secret.InnerText = byId.Secret;
				this.status.InnerText = this.GetStatus(byId.Status);
				this.creator.InnerText = byId.CreatorRealName + "(" + byId.CreatorDepName + ")";
				this.addtime.InnerText = Utils.ConvertDate2(byId.AddTime);
				this.DocNo.InnerText = byId.DocNo;
				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>");
				}
				if (!string.IsNullOrEmpty(byId.Flow_Files) && byId.Flow_Files.Contains("|"))
				{
					List<TmpInfo> list = new List<TmpInfo>();
					string[] array = byId.Flow_Files.Split(new char[]
					{
						'|'
					});
					for (int i = 0; i < array.Length; i++)
					{
						if (array[i].Trim() != "")
						{
							TmpInfo tmpInfo = new TmpInfo();
							int num = array[i].LastIndexOf('/') + 1;
							string tmp = array[i].Substring(num, array[i].Length - num);
							string s = array[i].Replace("~", "");
							tmpInfo.Tmp1 = array[i];
							tmpInfo.Tmp2 = tmp;
							tmpInfo.Tmp3 = base.Server.UrlEncode(s);
							list.Add(tmpInfo);
						}
					}
					this.rpt.DataSource = list;
					this.rpt.DataBind();
				}
				Gov_StepInfo byId2 = Gov_Step.Init().GetById(byId.CurrentStepID);
				this.ViewState["CurrentStep"] = byId2;
				string text = "";
				IList all = Gov_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> list2 = new List<string>();
				for (int i = 0; i < array2.Length; i++)
				{
					if (array2[i].Contains("#"))
					{
						list2.Add(array2[i].Split(new char[]
						{
							'#'
						})[0].Trim());
					}
				}
				foreach (object current in all)
				{
					Gov_StepActionInfo gov_StepActionInfo = current as Gov_StepActionInfo;
					if (gov_StepActionInfo.Operation == 1)
					{
						text = text + gov_StepActionInfo.UserRealName + "[已审/同意], ";
						if (list2.Contains(gov_StepActionInfo.UserRealName.Trim()))
						{
							list2.Remove(gov_StepActionInfo.UserRealName.Trim());
						}
					}
					if (gov_StepActionInfo.Operation == -1)
					{
						text = text + gov_StepActionInfo.UserRealName + "[已阅/不同意], ";
						if (list2.Contains(gov_StepActionInfo.UserRealName.Trim()))
						{
							list2.Remove(gov_StepActionInfo.UserRealName.Trim());
						}
					}
				}
				foreach (string current2 in list2)
				{
					text = text + current2 + "[未操作], ";
				}
				this.currentuserlist.InnerHtml = text;
				IList all2 = Gov_StepAction.Init().GetAll("FlowID=" + byId.id, "order by id asc");
				IList all3 = Gov_Doc.Init().GetAll("StepAction_ID=0 and flow_id=" + byId.id, null);
				Gov_DocInfo gov_DocInfo = all3[0] as Gov_DocInfo;
				base.Server.UrlEncode(gov_DocInfo.DocPath.Replace("~", ""));
				string text2 = this.yjs;
				this.yjs = string.Concat(new string[]
				{
					text2,
					"0、<u>发文拟稿</u> &nbsp;",
					byId.CreatorRealName,
					" 在 ",
					Utils.ConvertDate2(byId.AddTime),
					" 发起公文(初稿) &nbsp;<br>"
				});
				foreach (object current in all2)
				{
					Gov_StepActionInfo gov_StepActionInfo = current as Gov_StepActionInfo;
					IList all4 = Gov_Doc.Init().GetAll("StepAction_ID=" + gov_StepActionInfo.id, null);
					if (all4.Count == 0)
					{
						object obj = this.yjs;
						this.yjs = string.Concat(new object[]
						{
							obj,
							all2.IndexOf(current) + 1,
							"、<u>",
							gov_StepActionInfo.OperationStepName,
							"</u> &nbsp;",
							gov_StepActionInfo.UserRealName,
							" 在 ",
							Utils.ConvertDate2(gov_StepActionInfo.AddTime),
							" 已阅 &nbsp;<strong style='color:#ff0000'>",
							gov_StepActionInfo.OperationWord,
							"</strong><br>"
						});
					}
					else
					{
						Gov_DocInfo gov_DocInfo2 = all4[0] as Gov_DocInfo;
						base.Server.UrlEncode(gov_DocInfo2.DocPath.Replace("~", ""));
						object obj = this.yjs;
						this.yjs = string.Concat(new object[]
						{
							obj,
							all2.IndexOf(current) + 1,
							"、<u>",
							gov_StepActionInfo.OperationStepName,
							"</u> &nbsp;&nbsp; ",
							gov_StepActionInfo.UserRealName,
							" 在 ",
							Utils.ConvertDate2(gov_StepActionInfo.AddTime),
							" 已阅 &nbsp;<strong style='color:#ff0000'>",
							gov_StepActionInfo.OperationWord,
							"</strong><br>"
						});
					}
				}
				if (list2.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='AppList.aspx?action=verify';</script>");
			}
		}