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.txtFirName.Text = dr1["FirName"].ToString();
  42.                 this.txtSecName.Text = dr1["SecName"].ToString();
  43.                 this.txtFirTime.Text = Convert.ToDateTime(dr1["FirSignTime"]).ToString("yyyy-MM-dd");
  44.                 this.txtSecTime.Text = Convert.ToDateTime(dr1["SecSignTime"]).ToString("yyyy-MM-dd");
  45.                 this.txtPactContent.Text = dr1["PactContent"].ToString();
  46.                 this.txtEndTime.Text = Convert.ToDateTime(dr1["EndTime"]).ToString("yyyy-MM-dd");
  47.             }
  48.             dr1.Close();
  49.         }
  50.     }
  51.     protected void btnEdit_Click(object sender, EventArgs e)
  52.     {
  53.         this.txtEndTime.ReadOnly = false;
  54.         this.txtFir.ReadOnly = false;
  55.         this.txtFirName.ReadOnly = false;
  56.         this.txtFirTime.ReadOnly = false;
  57.         this.txtPactContent.ReadOnly = false;
  58.         this.txtPactTitle.ReadOnly = false;
  59.         this.txtSec.ReadOnly = false;
  60.         this.txtSecName.ReadOnly = false;
  61.         this.txtSecTime.ReadOnly = false;
  62.         this.txtSignAddress.ReadOnly = false;
  63.         this.btnDelete.Enabled = true;
  64.         this.btnSave.Enabled = true;
  65.     }
  66.     protected void btnDelete_Click(object sender, EventArgs e)
  67.     {
  68.         string cmdtxt = "DELETE FROM tb_Pact where ID='" + Request["ID"].ToString() + "'";
  69.         SqlData da = new SqlData();
  70.         if (da.ExceSQL(cmdtxt))
  71.         {
  72.             Response.Write("<script language=javascript>alert('操作成功!');location='PactManage.aspx'</script>");
  73.             CommonClass.WriteNote(this.txtPactTitle.Text, 3, Session["UserName"].ToString());
  74.         }
  75.         else
  76.         {
  77.             Response.Write("<script language=javascript>alert('操作失败!');location='javascript:history.go(-1)'</script>");
  78.         }
  79.     }
  80.     protected void btnSave_Click(object sender, EventArgs e)
  81.     {
  82.         string cmdtxt = "Update tb_Pact set PactName='" + this.txtPactTitle.Text + "',SingAddress='" + this.txtSignAddress.Text + "'";
  83.         cmdtxt += ",Fir='" + this.txtFir.Text + "',Sec='" + this.txtSec.Text + "',FirName='" + this.txtFirName.Text + "'";
  84.         cmdtxt += ",SecName='" + this.txtSecName.Text + "',FirSignTime='" + this.txtFirTime.Text + "',SecSignTime='" + this.txtSecTime.Text + "'";
  85.         cmdtxt +=",EndTime='" + this.txtEndTime.Text + "',PactContent='" + this.txtPactContent.Text + "'";
  86.         cmdtxt +="where ID='" + Request["ID"].ToString() + "'";
  87.         SqlData da = new SqlData();
  88.         if (da.ExceSQL(cmdtxt))
  89.         {
  90.             Response.Write("<script language=javascript>alert('操作成功!');location='PactManage.aspx'</script>");
  91.             CommonClass.WriteNote(this.txtPactTitle.Text, 1, Session["UserName"].ToString());
  92.             
  93.         }
  94.         else
  95.         {
  96.             Response.Write("<script language=javascript>alert('操作失败!');location='javascript:history.go(-1)'</script>");
  97.         }
  98.     }
  99.     protected void btnBack_Click(object sender, EventArgs e)
  100.     {
  101.         Response.Write("<script>this.parent.rightFrame.location='PactManage.aspx'</script>");
  102.     }
  103. }