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

📄 pactmanage.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;

public partial class Module_ProRes_PersonPact : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserName"] != null)
        {
            if (Session["Popedom"].ToString() == "0")
            {
                this.lnkbtnAdd.Visible = true;
            }
        }
        else
        {
            Response.Write("<script language=javascript>top.location.href='../../Index.aspx'</script>");
        }
        SqlData da = new SqlData();
        string cmdtxt1 = "select * from tb_Pact where PactStyle='企业合同'";
        this.GridView1.DataSource = da.ExceDS(cmdtxt1, "tb_Pact");
        this.GridView1.DataKeyNames = new string[] { "ID" };
        this.GridView1.DataBind();
    }
    protected void btnFind_Click(object sender, EventArgs e)
    {
        if (this.txtKeyWord.Text == "")
        {
            Response.Write("<script language=javascript>alert('关键字不能为空!');location='PactManage.aspx'</script>");
            return;
        }

        SqlData da = new SqlData();
        string search = this.dropClass.SelectedValue;
        switch (search)
        {
            case "合同ID":
                da.BindData(this.GridView1, "Select * From tb_Pact Where ID  Like  '%" + this.txtKeyWord.Text + "%' where PactStyle='企业合同'", "tb_Pact");
                break;
            case "合同标题":
                da.BindData(this.GridView1, "Select * From tb_Pact Where PactName  Like  '%" + this.txtKeyWord.Text + "%' where PactStyle='企业合同'", "tb_Pact");
                break;
            default:
                Response.Write("<script lanuage=javascript>alert('出错拉!');location='javascript:history.go(-1)'</script>");
                break;
        }
    }
    protected void lnkbtnAdd_Click1(object sender, EventArgs e)
    {
        this.Panel1.Visible = true;
        this.Panel2.Visible = false;
    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        string cmdtxt = "INSERT INTO tb_Pact(PactName,SingAddress,Fir,Sec,FirName,SecName,FirSignTime,SecSignTime,PactStyle,PactContent,EndTime)";
        cmdtxt +=" VALUES('" + this.txtPactTitle.Text + "','" + this.txtSignAddress.Text + "','" + this.txtFir.Text + "','" + this.txtSec.Text + "'";
        cmdtxt += ",'" + this.txtFirName.Text + "','" + this.txtSecName.Text + "','" + this.txtFirTime.Text + "','" + this.txtSecTime.Text + "'";
        cmdtxt += ",'企业合同','" + this.txtPactContent.Text + "','" + this.txtEndTime.Text + "')";
        SqlData da = new SqlData();
        if (da.ExceSQL(cmdtxt))
        {
            Response.Write("<script language=javascript>alert('操作成功!');location='PactManage.aspx'</script>");
            CommonClass.WriteNote(this.txtPactTitle.Text, 0, Session["UserName"].ToString());
        }
        else
        {
            Response.Write("<script language=javascript>alert('操作失败!');location='javascript:history.go(-1)'</script>");
        }
    }
    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.GridView1.PageIndex = e.NewPageIndex;
        SqlData da = new SqlData();
        string search = this.dropClass.SelectedValue;
        switch (search)
        {
            case "合同ID":
                da.BindData(this.GridView1, "Select * From tb_Pact Where ID  Like  '%" + this.txtKeyWord.Text + "%' where PactStyle='企业合同'", "tb_Pact");
                break;
            case "合同标题":
                da.BindData(this.GridView1, "Select * From tb_Pact Where PactName  Like  '%" + this.txtKeyWord.Text + "%' where PactStyle='企业合同'", "tb_Pact");
                break;
            case "合同类型":
                da.BindData(this.GridView1, "Select * From tb_Pact Where EndTime  Like  '%" + this.txtKeyWord.Text + "%' where PactStyle='企业合同'", "tb_Pact");
                break;
            default:
                Response.Write("<script lanuage=javascript>alert('出错拉!');location='javascript:history.go(-1)'</script>");
                break;
        }

    }
    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 + -