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

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.         if (!IsPostBack)
  28.         {
  29.             string cmdtxt1 = "select * from tb_Pact where PactStyle='人事合同'";
  30.             this.GridView1.DataSource = da.ExceDS(cmdtxt1, "tb_Pact");
  31.             this.GridView1.DataKeyNames = new string[] { "ID" };
  32.             this.GridView1.DataBind();
  33.         }
  34.     }
  35.     protected void btnFind_Click(object sender, EventArgs e)
  36.     {
  37.         if (this.txtKeyWord.Text == "")
  38.         {
  39.             Response.Write("<script language=javascript>alert('关键字不能为空');location='PactManage.aspx'</script>");
  40.             return;
  41.         }
  42.         SqlData da = new SqlData();
  43.         string search = this.dropClass.SelectedValue;
  44.         switch (search)
  45.         {
  46.             case "合同ID":
  47.                 da.BindData(this.GridView1, "Select * From tb_Pact Where ID  Like  '%" + this.txtKeyWord.Text + "%' And PactStyle='人事合同'", "tb_Pact");
  48.                 break;
  49.             case "合同标题":
  50.                 da.BindData(this.GridView1, "Select * From tb_Pact Where PactName  Like  '%" + this.txtKeyWord.Text + "%' And PactStyle='人事合同'", "tb_Pact");
  51.                 break;
  52.             default:
  53.                 Response.Write("<script lanuage=javascript>alert('出错拉!');location='javascript:history.go(-1)'</script>");
  54.                 break;
  55.         }
  56.     }
  57.     protected void lnkbtnAdd_Click1(object sender, EventArgs e)
  58.     {
  59.         this.Panel1.Visible = true;
  60.         this.Panel2.Visible = false;
  61.     }
  62.     protected void btnOK_Click(object sender, EventArgs e)
  63.     {
  64.         string cmdtxt = "INSERT INTO tb_Pact(PactName,SingAddress,Fir,Sec,FirName,SecName,FirSignTime,SecSignTime,PactStyle,PactContent,EndTime)";
  65.         cmdtxt +=" VALUES('" + this.txtPactTitle.Text + "','" + this.txtSignAddress.Text + "','" + this.txtFir.Text + "','" + this.txtSec.Text + "'";
  66.         cmdtxt += ",'" + this.txtFirName.Text + "','" + this.txtSecName.Text + "','" + this.txtFirTime.Text + "','" + this.txtSecTime.Text + "'";
  67.         cmdtxt += ",'人事合同','" + this.txtPactContent.Text + "','"+this.txtEndTime.Text+"')";
  68.         SqlData da = new SqlData();
  69.         if (da.ExceSQL(cmdtxt))
  70.         {
  71.             Response.Write("<script language=javascript>alert('操作成功!');location='PactManage.aspx'</script>");
  72.             CommonClass.WriteNote(this.txtPactTitle.Text, 0, Session["UserName"].ToString());
  73.         }
  74.         else
  75.         {
  76.             Response.Write("<script language=javascript>alert('操作失败!');location='javascript:history.go(-1)'</script>");
  77.         }
  78.     }
  79.     protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
  80.     {
  81.         this.GridView1.PageIndex = e.NewPageIndex;
  82.         SqlData da = new SqlData();
  83.         string search = this.dropClass.SelectedValue;
  84.         switch (search)
  85.         {
  86.             case "合同ID":
  87.                 da.BindData(this.GridView1, "Select * From tb_Pact Where ID  Like  '%" + this.txtKeyWord.Text + "%' where PactStyle='人事合同'", "tb_Pact");
  88.                 break;
  89.             case "合同标题":
  90.                 da.BindData(this.GridView1, "Select * From tb_Pact Where PactName  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. }