PactAllInfo.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. using System.Data.SqlClient;
  12. public partial class Module_ProRes_PactAllInfo : System.Web.UI.Page
  13. {
  14.     protected void Page_Load(object sender, EventArgs e)
  15.     {
  16.         if (Session["UserName"] != null)
  17.         {
  18.             if (Session["Popedom"].ToString() == "0")
  19.             {
  20.                 this.Panel1.Visible = true;
  21.             }
  22.         }
  23.         else
  24.         {
  25.             Response.Write("<script language=javascript>top.location.href='../../Index.aspx'</script>");
  26.         }
  27.         if (!IsPostBack)
  28.         {
  29.             SqlData da = new SqlData();
  30.             string str = Request["ID"].ToString();
  31.             string cmdtxt1 = "select * from tb_Pact where ID='" + str + "'";
  32.             SqlCommand Com1 = new SqlCommand(cmdtxt1, da.ExceCon());
  33.             SqlDataReader dr1 = Com1.ExecuteReader();
  34.             dr1.Read();
  35.             if (dr1.HasRows)
  36.             {
  37.                 this.txtPactTitle.Text = dr1["PactName"].ToString();
  38.                 this.txtSignAddress.Text = dr1["SingAddress"].ToString();
  39.                 this.txtFir.Text = dr1["Fir"].ToString();
  40.                 this.txtSec.Text = dr1["Sec"].ToString();
  41.                 this.txtFirTime.Text = Convert.ToDateTime(dr1["FirSignTime"]).ToString("yyyy-MM-dd");
  42.                 this.txtSecTime.Text = Convert.ToDateTime(dr1["SecSignTime"]).ToString("yyyy-MM-dd");
  43.                 this.txtPactContent.Text = dr1["PactContent"].ToString();
  44.                 this.txtEndTime.Text = Convert.ToDateTime(dr1["EndTime"]).ToString("yyyy-MM-dd");
  45.             }
  46.             dr1.Close();
  47.         }
  48.     }
  49.     protected void btnEdit_Click(object sender, EventArgs e)
  50.     {
  51.         this.txtEndTime.ReadOnly = false;
  52.         this.txtFir.ReadOnly = false;
  53.         this.txtFirTime.ReadOnly = false;
  54.         this.txtPactContent.ReadOnly = false;
  55.         this.txtPactTitle.ReadOnly = false;
  56.         this.txtSec.ReadOnly = false;
  57.         this.txtSecTime.ReadOnly = false;
  58.         this.txtSignAddress.ReadOnly = false;
  59.         this.btnDelete.Enabled = true;
  60.         this.btnSave.Enabled = true;
  61.     }
  62.     protected void btnDelete_Click(object sender, EventArgs e)
  63.     {
  64.         string cmdtxt = "DELETE FROM tb_Pact where ID='" + Request["ID"].ToString() + "'";
  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, 3, 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 btnSave_Click(object sender, EventArgs e)
  77.     {
  78.         string cmdtxt = "Update tb_Pact set PactName='" + this.txtPactTitle.Text + "',SingAddress='" + this.txtSignAddress.Text + "'";
  79.         cmdtxt += ",Fir='" + this.txtFir.Text + "',Sec='" + this.txtSec.Text + "'";
  80.         cmdtxt += ",FirSignTime='" + this.txtFirTime.Text + "',SecSignTime='" + this.txtSecTime.Text + "'";
  81.         cmdtxt +=",EndTime='" + this.txtEndTime.Text + "',PactContent='" + this.txtPactContent.Text + "'";
  82.         cmdtxt +="where ID='" + Request["ID"].ToString() + "'";
  83.         SqlData da = new SqlData();
  84.         if (da.ExceSQL(cmdtxt))
  85.         {
  86.             Response.Write("<script language=javascript>alert('操作成功!');location='PactManage.aspx'</script>");
  87.             CommonClass.WriteNote(this.txtPactTitle.Text, 1, Session["UserName"].ToString());
  88.             
  89.         }
  90.         else
  91.         {
  92.             Response.Write("<script language=javascript>alert('操作失败!');location='javascript:history.go(-1)'</script>");
  93.         }
  94.     }
  95.     protected void btnBack_Click(object sender, EventArgs e)
  96.     {
  97.         Response.Write("<script>this.parent.rightFrame.location='PactManage.aspx'</script>");
  98.     }
  99. }