Esempio n. 1
0
 protected void Save_Btn(object sender, EventArgs e)
 {
     if (this.ViewState["gi"] != null)
     {
         Gov_RecipientInfo gov_RecipientInfo = this.ViewState["gi"] as Gov_RecipientInfo;
         if (gov_RecipientInfo.Sign == 0)
         {
             gov_RecipientInfo.FeedBack = base.Request.Form["FeedBack"];
             gov_RecipientInfo.Sign     = 1;
             gov_RecipientInfo.SignTime = DateTime.Now;
             Gov_Recipient.Init().Update(gov_RecipientInfo);
             string format = "update gov set status=5 where id={0} and status=1 and IsValid=0 and (select count(*) from Gov_Recipient where flow_id={0} and sign=0)=0";
             MsSqlOperate.ExecuteNonQuery(CommandType.Text, string.Format(format, gov_RecipientInfo.Flow_ID), new SqlParameter[0]);
             MessageBox.ShowAndRedirect(this, "公文已成功签收!", "RecMenu.aspx");
         }
     }
 }
Esempio n. 2
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>");
			}
		}
Esempio n. 3
0
    private void Show(string nid)
    {
        GovInfo byId = Gov.Init().GetById(Convert.ToInt32(nid));

        this.DocBody.InnerHtml = byId.DocBody;
        IList all = Gov_Recipient.Init().GetAll("UserID=" + this.Uid + " and Flow_ID=" + base.Request.QueryString["fl"], null);

        if (all.Count > 0)
        {
            Gov_RecipientInfo gov_RecipientInfo = all[0] as Gov_RecipientInfo;
            this.ViewState["gi"] = gov_RecipientInfo;
            if (gov_RecipientInfo.Sign == 0 && byId.Status == 1)
            {
                this.pals.Visible = true;
            }
        }
        this.NewsTitle.InnerText = byId.Flow_Name;
        this.Creator.InnerText   = byId.CreatorRealName + " (" + byId.CreatorDepName + ")";
        this.addtime.InnerText   = Utils.ConvertDate2(byId.AddTime);
        this.Page.Title          = "公文签收:" + byId.Flow_Name;
        this.fjs = "<span style='color:#006600;'>相关文件</span>:<br>";
        if (!string.IsNullOrEmpty(byId.Flow_Files))
        {
            string[] array = byId.Flow_Files.Split(new char[]
            {
                '|'
            });
            for (int i = 0; i < array.Length; i++)
            {
                if (array[i].Trim() != "")
                {
                    int    num = array[i].LastIndexOf('/') + 1;
                    string arg = array[i].Substring(num, array[i].Length - num);
                    string s   = array[i].Replace("~", "");
                    this.fjs += string.Format(this.fj, base.Server.UrlEncode(s), arg);
                }
            }
        }
        if (!string.IsNullOrEmpty(byId.Remark))
        {
            this.sm = "<span style='color:#006600;'>简要说明</span>:<br>" + byId.Remark + "<br><br>";
        }
        if (byId.IsValid == 0)
        {
            this.gd = "<br><span style='color:#006600;'>归档日期</span>:<br>所有人签收完 自动归档.<br><br>";
        }
        else
        {
            this.gd = "<br><span style='color:#006600;'>归档日期</span>:<br>" + Utils.ConvertDate3(byId.ValidTime) + ".";
        }
        string innerHtml;

        if (!string.IsNullOrEmpty(byId.DocNo))
        {
            innerHtml = "发文字号:" + byId.DocNo;
        }
        else
        {
            innerHtml = "发文字号:无";
        }
        this.top.InnerHtml = innerHtml;
    }