示例#1
0
		private Gov_StepInfo MakeNewFsi(Gov_StepInfo fsi)
		{
			Gov_StepInfo gov_StepInfo = new Gov_StepInfo();
			gov_StepInfo.Flow_ID = fsi.Flow_ID;
			gov_StepInfo.IsAct = 1;
			gov_StepInfo.IsEnd = fsi.IsEnd;
			gov_StepInfo.IsHead = fsi.IsHead;
			gov_StepInfo.IsUserEdit = fsi.IsUserEdit;
			gov_StepInfo.IsUserFile = fsi.IsUserFile;
			gov_StepInfo.MailAlert = fsi.MailAlert;
			gov_StepInfo.namelist = fsi.namelist;
			gov_StepInfo.RightToFinish = fsi.RightToFinish;
			gov_StepInfo.Step_Name = fsi.Step_Name;
			gov_StepInfo.Step_Orders = 1;
			gov_StepInfo.Step_Remark = fsi.Step_Remark;
			gov_StepInfo.userlist = fsi.userlist;
			gov_StepInfo.Acts = fsi.Acts;
			Gov_Step.Init().Add(gov_StepInfo);
			return gov_StepInfo;
		}
示例#2
0
 private void Show()
 {
     if (!string.IsNullOrEmpty(base.Request.QueryString["fm"]))
     {
         this.model_flow.Visible = true;
         this.flow.Visible       = false;
         Gov_ModelInfo byId = Gov_Model.Init().GetById(Convert.ToInt32(base.Request.QueryString["fm"]));
         this.fm_name.InnerText = byId.Flow_Name;
         IList all = Gov_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;
         GovInfo byId2 = Gov.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 = Gov_Step.Init().GetAll("isact=0 and flow_id=" + byId2.id, "order by id asc");
         this.rpt_f.DataSource = all;
         this.rpt_f.DataBind();
     }
 }
示例#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
		protected void VerifyStep_Btn(object sender, EventArgs e)
		{
			GovInfo byId = Gov.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 != "")
			{
				Gov_StepInfo gov_StepInfo = this.ViewState["CurrentStep"] as Gov_StepInfo;
				Gov_StepActionInfo gov_StepActionInfo = new Gov_StepActionInfo();
				gov_StepActionInfo.AddTime = DateTime.Now;
				gov_StepActionInfo.FlowID = Convert.ToInt32(base.Request.QueryString["fl"]);
				gov_StepActionInfo.Operation = 1;
				gov_StepActionInfo.OperationStepID = gov_StepInfo.id;
				gov_StepActionInfo.OperationWord = "(同意) :" + base.Request.Form["FlowRemark"];
				gov_StepActionInfo.UserDepName = this.DepName;
				gov_StepActionInfo.UserID = Convert.ToInt32(this.Uid);
				gov_StepActionInfo.UserRealName = this.RealName;
				gov_StepActionInfo.OperationStepName = gov_StepInfo.Step_Name;
				if (gov_StepInfo.IsEnd == 1)
				{
					Gov_StepAction.Init().Add(gov_StepActionInfo);
					GovInfo govInfo = byId;
					this.AddDoc(govInfo.id, gov_StepActionInfo.id);
					govInfo.CurrentDocPath = this.filepath.Value;
					if (!this.IsAllVerifid())
					{
						GovInfo expr_219 = govInfo;
						string hasOperatedUserList = expr_219.HasOperatedUserList;
						expr_219.HasOperatedUserList = string.Concat(new string[]
						{
							hasOperatedUserList,
							this.RealName,
							"#",
							this.Uid,
							"#",
							this.DepName,
							","
						});
						govInfo.Flow_Files = this.UpdateFiles();
						Gov.Init().Update(govInfo);
						MessageBox.ShowAndRedirect(this, "公文成功审批!", "AppMenu.aspx");
					}
					else
					{
						GovInfo expr_2A4 = govInfo;
						string hasOperatedUserList = expr_2A4.HasOperatedUserList;
						expr_2A4.HasOperatedUserList = string.Concat(new string[]
						{
							hasOperatedUserList,
							this.RealName,
							"#",
							this.Uid,
							"#",
							this.DepName,
							","
						});
						govInfo.Flow_Files = this.UpdateFiles();
						Gov.Init().Update(govInfo);
						this.FinishFlow();
						MessageBox.ShowAndRedirect(this, "成功操作,公文已签发!", "AppMenu.aspx");
					}
				}
				else
				{
					IList all = Gov_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)
						{
							Gov_StepInfo gov_StepInfo2 = current as Gov_StepInfo;
							if (gov_StepInfo2.Acts == gov_StepInfo.Acts)
							{
								num = all.IndexOf(current) + 1;
							}
						}
						if (num != 0)
						{
							Gov_StepAction.Init().Add(gov_StepActionInfo);
							GovInfo govInfo = byId;
							this.AddDoc(govInfo.id, gov_StepActionInfo.id);
							govInfo.CurrentDocPath = this.filepath.Value;
							if (this.IsAllVerifid())
							{
								Gov_StepInfo gov_StepInfo3 = this.MakeNewFsi((Gov_StepInfo)all[num]);
								govInfo.CurrentStepID = gov_StepInfo3.id;
								govInfo.CurrentStepName = gov_StepInfo3.Step_Name;
								govInfo.CurrentStepUserList = gov_StepInfo3.userlist;
							}
							GovInfo expr_462 = govInfo;
							string hasOperatedUserList = expr_462.HasOperatedUserList;
							expr_462.HasOperatedUserList = string.Concat(new string[]
							{
								hasOperatedUserList,
								this.RealName,
								"#",
								this.Uid,
								"#",
								this.DepName,
								","
							});
							govInfo.Flow_Files = this.UpdateFiles();
							Gov.Init().Update(govInfo);
							MessageBox.ShowAndRedirect(this, "已成功操作!", "AppMenu.aspx");
						}
					}
				}
			}
		}
示例#5
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>");
			}
		}