⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pactallinfo.aspx.cs

📁 本系统有两种操作用户
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Data.SqlClient;

public partial class Module_ProRes_PactAllInfo : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserName"] != null)
        {
            if (Session["Popedom"].ToString() == "0")
            {
                this.Panel1.Visible = true;
            }
        }
        else
        {
            Response.Write("<script language=javascript>top.location.href='../../Index.aspx'</script>");
        }
        if (!IsPostBack)
        {
            SqlData da = new SqlData();
            string str = Request["ID"].ToString();
            string cmdtxt1 = "select * from tb_Pact where ID='" + str + "'";
            SqlCommand Com1 = new SqlCommand(cmdtxt1, da.ExceCon());
            SqlDataReader dr1 = Com1.ExecuteReader();
            dr1.Read();
            if (dr1.HasRows)
            {
                this.txtPactTitle.Text = dr1["PactName"].ToString();
                this.txtSignAddress.Text = dr1["SingAddress"].ToString();
                this.txtFir.Text = dr1["Fir"].ToString();
                this.txtSec.Text = dr1["Sec"].ToString();
                this.txtFirName.Text = dr1["FirName"].ToString();
                this.txtSecName.Text = dr1["SecName"].ToString();
                this.txtFirTime.Text = Convert.ToDateTime(dr1["FirSignTime"]).ToString("yyyy-MM-dd");
                this.txtSecTime.Text = Convert.ToDateTime(dr1["SecSignTime"]).ToString("yyyy-MM-dd");
                this.txtPactContent.Text = dr1["PactContent"].ToString();
                this.txtEndTime.Text = Convert.ToDateTime(dr1["EndTime"]).ToString("yyyy-MM-dd");
            }
            dr1.Close();

        }
    }
    protected void btnEdit_Click(object sender, EventArgs e)
    {
        this.txtEndTime.ReadOnly = false;
        this.txtFir.ReadOnly = false;
        this.txtFirName.ReadOnly = false;
        this.txtFirTime.ReadOnly = false;
        this.txtPactContent.ReadOnly = false;
        this.txtPactTitle.ReadOnly = false;
        this.txtSec.ReadOnly = false;
        this.txtSecName.ReadOnly = false;
        this.txtSecTime.ReadOnly = false;
        this.txtSignAddress.ReadOnly = false;
        this.btnDelete.Enabled = true;
        this.btnSave.Enabled = true;
    }
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        string cmdtxt = "DELETE FROM tb_Pact where ID='" + Request["ID"].ToString() + "'";
        SqlData da = new SqlData();
        if (da.ExceSQL(cmdtxt))
        {
            Response.Write("<script language=javascript>alert('操作成功!');location='PactManage.aspx'</script>");
            CommonClass.WriteNote(this.txtPactTitle.Text, 3, Session["UserName"].ToString());
        }
        else
        {
            Response.Write("<script language=javascript>alert('操作失败!');location='javascript:history.go(-1)'</script>");

        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string cmdtxt = "Update tb_Pact set PactName='" + this.txtPactTitle.Text + "',SingAddress='" + this.txtSignAddress.Text + "'";
        cmdtxt += ",Fir='" + this.txtFir.Text + "',Sec='" + this.txtSec.Text + "',FirName='" + this.txtFirName.Text + "'";
        cmdtxt += ",SecName='" + this.txtSecName.Text + "',FirSignTime='" + this.txtFirTime.Text + "',SecSignTime='" + this.txtSecTime.Text + "'";
        cmdtxt +=",EndTime='" + this.txtEndTime.Text + "',PactContent='" + this.txtPactContent.Text + "'";
        cmdtxt +="where ID='" + Request["ID"].ToString() + "'";
        SqlData da = new SqlData();
        if (da.ExceSQL(cmdtxt))
        {
            Response.Write("<script language=javascript>alert('操作成功!');location='PactManage.aspx'</script>");
            CommonClass.WriteNote(this.txtPactTitle.Text, 1, Session["UserName"].ToString());
            
        }
        else
        {
            Response.Write("<script language=javascript>alert('操作失败!');location='javascript:history.go(-1)'</script>");
        }

    }
    protected void btnBack_Click(object sender, EventArgs e)
    {
        Response.Write("<script>this.parent.rightFrame.location='PactManage.aspx'</script>");
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -