PactManage.aspx.cs
上传用户:shjujing
上传日期:2022-07-28
资源大小:11244k
文件大小:5k
源码类别:

Email客户端

开发平台:

Visual C++

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. public partial class Module_ProRes_PersonPact : System.Web.UI.Page
  12. {
  13.     protected void Page_Load(object sender, EventArgs e)
  14.     {
  15.         if (Session["UserName"] != null)
  16.         {
  17.             if (Session["Popedom"].ToString() == "0")
  18.             {
  19.                 this.lnkbtnAdd.Visible = true;
  20.             }
  21.         }
  22.         else
  23.         {
  24.             Response.Write("<script language=javascript>top.location.href='../../Index.aspx'</script>");
  25.         }
  26.         SqlData da = new SqlData();
  27.         string cmdtxt1 = "select * from tb_Pact where PactStyle='企业合同'";
  28.         this.GridView1.DataSource = da.ExceDS(cmdtxt1, "tb_Pact");
  29.         this.GridView1.DataKeyNames = new string[] { "ID" };
  30.         this.GridView1.DataBind();
  31.     }
  32.     protected void btnFind_Click(object sender, EventArgs e)
  33.     {
  34.         if (this.txtKeyWord.Text == "")
  35.         {
  36.             Response.Write("<script language=javascript>alert('关键字不能为空!');location='PactManage.aspx'</script>");
  37.             return;
  38.         }
  39.         SqlData da = new SqlData();
  40.         string search = this.dropClass.SelectedValue;
  41.         switch (search)
  42.         {
  43.             case "合同ID":
  44.                 da.BindData(this.GridView1, "Select * From tb_Pact Where ID  Like  '%" + this.txtKeyWord.Text + "%' where PactStyle='企业合同'", "tb_Pact");
  45.                 break;
  46.             case "合同标题":
  47.                 da.BindData(this.GridView1, "Select * From tb_Pact Where PactName  Like  '%" + this.txtKeyWord.Text + "%' where PactStyle='企业合同'", "tb_Pact");
  48.                 break;
  49.             default:
  50.                 Response.Write("<script lanuage=javascript>alert('出错拉!');location='javascript:history.go(-1)'</script>");
  51.                 break;
  52.         }
  53.     }
  54.     protected void lnkbtnAdd_Click1(object sender, EventArgs e)
  55.     {
  56.         this.Panel1.Visible = true;
  57.         this.Panel2.Visible = false;
  58.     }
  59.     protected void btnOK_Click(object sender, EventArgs e)
  60.     {
  61.         string cmdtxt = "INSERT INTO tb_Pact(PactName,SingAddress,Fir,Sec,FirName,SecName,FirSignTime,SecSignTime,PactStyle,PactContent,EndTime)";
  62.         cmdtxt +=" VALUES('" + this.txtPactTitle.Text + "','" + this.txtSignAddress.Text + "','" + this.txtFir.Text + "','" + this.txtSec.Text + "'";
  63.         cmdtxt += ",'" + this.txtFirName.Text + "','" + this.txtSecName.Text + "','" + this.txtFirTime.Text + "','" + this.txtSecTime.Text + "'";
  64.         cmdtxt += ",'企业合同','" + this.txtPactContent.Text + "','" + this.txtEndTime.Text + "')";
  65.         SqlData da = new SqlData();
  66.         if (da.ExceSQL(cmdtxt))
  67.         {
  68.             Response.Write("<script language=javascript>alert('操作成功!');location='PactManage.aspx'</script>");
  69.             CommonClass.WriteNote(this.txtPactTitle.Text, 0, Session["UserName"].ToString());
  70.         }
  71.         else
  72.         {
  73.             Response.Write("<script language=javascript>alert('操作失败!');location='javascript:history.go(-1)'</script>");
  74.         }
  75.     }
  76.     protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
  77.     {
  78.         this.GridView1.PageIndex = e.NewPageIndex;
  79.         SqlData da = new SqlData();
  80.         string search = this.dropClass.SelectedValue;
  81.         switch (search)
  82.         {
  83.             case "合同ID":
  84.                 da.BindData(this.GridView1, "Select * From tb_Pact Where ID  Like  '%" + this.txtKeyWord.Text + "%' where PactStyle='企业合同'", "tb_Pact");
  85.                 break;
  86.             case "合同标题":
  87.                 da.BindData(this.GridView1, "Select * From tb_Pact Where PactName  Like  '%" + this.txtKeyWord.Text + "%' where PactStyle='企业合同'", "tb_Pact");
  88.                 break;
  89.             case "合同类型":
  90.                 da.BindData(this.GridView1, "Select * From tb_Pact Where EndTime  Like  '%" + this.txtKeyWord.Text + "%' where PactStyle='企业合同'", "tb_Pact");
  91.                 break;
  92.             default:
  93.                 Response.Write("<script lanuage=javascript>alert('出错拉!');location='javascript:history.go(-1)'</script>");
  94.                 break;
  95.         }
  96.     }
  97.     protected void btnBack_Click(object sender, EventArgs e)
  98.     {
  99.         Response.Write("<script>this.parent.rightFrame.location='PactManage.aspx'</script>");
  100.     }
  101. }