示例#1
0
        //查询顾客
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (this.TextBox1.Text != "" && this.TextBox2.Text == "" && this.TextBox5.Text == "" && this.TextBox6.Text == "")
            {
                this.Label1.Text = "Gid";
                int       idd = Convert.ToInt32(this.TextBox1.Text);
                DataTable dt  = BLL_Hotel.Cha_GuestInfoByGid(idd);
                this.GridView1.DataSource = BLL_Hotel.Cha_GuestInfoByGid(idd, 1);;
                int ye = fenye(dt.Rows.Count);
                this.TextBox3.Text = ye.ToString();
                this.GridView1.DataBind();
                ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "$('.tcdPageCode').createPage({pageCount:" + ye + ",current:1,});", true);
            }
            else if (this.TextBox1.Text == "" && this.TextBox2.Text != "" && this.TextBox5.Text == "" && this.TextBox6.Text == "")
            {
                string Gname = this.TextBox2.Text;
                this.Label1.Text = "Gname";
                DataTable dt = BLL_Hotel.Cha_GuestInfoByGname(Gname);
                this.GridView1.DataSource = BLL_Hotel.Cha_GuestInfoByGname(Gname, 1);
                int ye = fenye(dt.Rows.Count);
                this.TextBox3.Text = ye.ToString();
                this.GridView1.DataBind();
                ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "$('.tcdPageCode').createPage({pageCount:" + ye + ",current:1,});", true);
            }

            else if (this.TextBox1.Text == "" && this.TextBox2.Text == "" && this.TextBox5.Text != "" && this.TextBox6.Text == "")
            {
                string Mobile = this.TextBox5.Text;
                this.Label1.Text = "Mobile";
                DataTable dt = BLL_Hotel.Cha_GuestInfoByMobile(Mobile);
                this.GridView1.DataSource = BLL_Hotel.Cha_GuestInfoByMobile(Mobile, 1);
                int ye = fenye(dt.Rows.Count);
                this.TextBox3.Text = ye.ToString();
                this.GridView1.DataBind();
                ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "$('.tcdPageCode').createPage({pageCount:" + ye + ",current:1,});", true);
            }
            else if (this.TextBox1.Text == "" && this.TextBox2.Text == "" && this.TextBox5.Text == "" && this.TextBox6.Text != "")
            {
                string pid = this.TextBox6.Text;
                this.Label1.Text = "Pid";
                DataTable dt = BLL_Hotel.Cha_GuestInfoByPid(pid);
                this.GridView1.DataSource = BLL_Hotel.Cha_GuestInfoByPid(pid, 1);
                int ye = fenye(dt.Rows.Count);
                this.TextBox3.Text = ye.ToString();
                this.GridView1.DataBind();
                ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "$('.tcdPageCode').createPage({pageCount:" + ye + ",current:1,});", true);
            }
            else
            {
                bind();
            }
        }
示例#2
0
 //查询顾客
 protected void btnSearch_Click(object sender, EventArgs e)
 {
     if (this.txtGid.Text != "" && this.txtGname.Text == "" && this.txtMobile.Text == "" && this.txtPid.Text == "")
     {
         this.Label1.Text = "Gid";
         int       idd = Convert.ToInt32(this.txtGid.Text);
         DataTable dt  = BLL_Hotel.Cha_GuestInfoByGid(idd);                //根据顾客编号查询顾客信息
         this.GridView1.DataSource = BLL_Hotel.Cha_GuestInfoByGid(idd, 1); //根据顾客编号查询顾客信息(分页)
         int ye = fenye(dt.Rows.Count);                                    //获取分页后总页数
         this.txtPages.Text = ye.ToString();
         this.GridView1.DataBind();
         ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "$('.tcdPageCode').createPage({pageCount:" + ye + ",current:1,});", true);
     }
     else if (this.txtGid.Text == "" && this.txtGname.Text != "" && this.txtMobile.Text == "" && this.txtPid.Text == "")
     {
         string Gname = this.txtGname.Text;
         this.Label1.Text = "Gname";
         DataTable dt = BLL_Hotel.Cha_GuestInfoByGname(Gname);                 //根据顾客姓名查询顾客信息
         this.GridView1.DataSource = BLL_Hotel.Cha_GuestInfoByGname(Gname, 1); //根据顾客姓名查询顾客信息(分页)
         int ye = fenye(dt.Rows.Count);                                        //获取分页后总页数
         this.txtPages.Text = ye.ToString();
         this.GridView1.DataBind();
         ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "$('.tcdPageCode').createPage({pageCount:" + ye + ",current:1,});", true);
     }
     else if (this.txtGid.Text == "" && this.txtGname.Text == "" && this.txtMobile.Text != "" && this.txtPid.Text == "")
     {
         string Mobile = this.txtMobile.Text;
         this.Label1.Text = "Mobile";
         DataTable dt = BLL_Hotel.Cha_GuestInfoByMobile(Mobile);                 //根据顾客手机号查询顾客信息
         this.GridView1.DataSource = BLL_Hotel.Cha_GuestInfoByMobile(Mobile, 1); //根据顾客手机号查询顾客信息(分页)
         int ye = fenye(dt.Rows.Count);                                          //获取分页后总页数
         this.txtPages.Text = ye.ToString();
         this.GridView1.DataBind();
         ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "$('.tcdPageCode').createPage({pageCount:" + ye + ",current:1,});", true);
     }
     else if (this.txtGid.Text == "" && this.txtGname.Text == "" && this.txtMobile.Text == "" && this.txtPid.Text != "")
     {
         string pid = this.txtPid.Text;
         this.Label1.Text = "Pid";
         DataTable dt = BLL_Hotel.Cha_GuestInfoByPid(pid);                 //根据顾客身份证号查询顾客信息
         this.GridView1.DataSource = BLL_Hotel.Cha_GuestInfoByPid(pid, 1); //根据顾客身份证号查询顾客信息(分页)
         int ye = fenye(dt.Rows.Count);                                    //获取分页后总页数
         this.txtPages.Text = ye.ToString();
         this.GridView1.DataBind();
         ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "$('.tcdPageCode').createPage({pageCount:" + ye + ",current:1,});", true);
     }
     else
     {
         bind();
     }
 }
示例#3
0
        protected void Button4_Click(object sender, EventArgs e)
        {
            if (this.Label1.Text == "Gid")
            {
                ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "$('.tcdPageCode').createPage({pageCount:" + this.TextBox3.Text + ",current:" + this.TextBox7.Text + "});", true);
                int       hehe = Convert.ToInt32(this.TextBox7.Text);
                DataTable dt   = BLL_Hotel.Cha_GuestInfoByGid(Convert.ToInt32(this.TextBox1.Text), hehe);
                this.GridView1.DataSource = dt;
                this.GridView1.DataBind();
            }

            else if (this.Label1.Text == "Gname")
            {
                ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "$('.tcdPageCode').createPage({pageCount:" + this.TextBox3.Text + ",current:" + this.TextBox7.Text + "});", true);
                int       hehe = Convert.ToInt32(this.TextBox7.Text);
                DataTable dt   = BLL_Hotel.Cha_GuestInfoByGname(this.TextBox2.Text, hehe);
                this.GridView1.DataSource = dt;
                this.GridView1.DataBind();
            }
            else if (this.Label1.Text == "Mobile")
            {
                ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "$('.tcdPageCode').createPage({pageCount:" + this.TextBox3.Text + ",current:" + this.TextBox7.Text + "});", true);
                int       hehe = Convert.ToInt32(this.TextBox7.Text);
                DataTable dt   = BLL_Hotel.Cha_GuestInfoByMobile(this.TextBox5.Text, hehe);
                this.GridView1.DataSource = dt;
                this.GridView1.DataBind();
            }
            else if (this.Label1.Text == "Pid")
            {
                ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "$('.tcdPageCode').createPage({pageCount:" + this.TextBox3.Text + ",current:" + this.TextBox7.Text + "});", true);
                int       hehe = Convert.ToInt32(this.TextBox7.Text);
                DataTable dt   = BLL_Hotel.Cha_GuestInfoByPid(this.TextBox6.Text, hehe);
                this.GridView1.DataSource = dt;
                this.GridView1.DataBind();
            }
            else
            {
                int       hehe = Convert.ToInt32(this.TextBox7.Text);
                DataTable dt   = BLL_Hotel.Cha_CusFenYe(hehe);
                this.GridView1.DataSource = dt;
                this.GridView1.DataBind();
            }
        }