Beispiel #1
0
 public void DataBindToGridview()
 {
     ZWL.BLL.ERPHuiBao MyModel = new ZWL.BLL.ERPHuiBao();
     ZWL.BLL.ERPBuMen BuMenModel = new ZWL.BLL.ERPBuMen();
     string Department_ID = BuMenModel.GetList("BuMenName='" + ZWL.Common.PublicMethod.GetSessionValue("Department") + "'").Tables[0].Rows[0]["ID"].ToString();
     DataSet ds = MyModel.GetList("TitleStr Like '%" + this.TextBox1.Text + "%' and UserName='******'%" + this.TextBox1.Text + "%' and CHARINDEX('" + Department_ID + "',p_depart_ids)>0 order by ID desc");
     if (ds!=null)
     {
         GVData.DataSource = ds;
         GVData.DataBind();
         LabPageSum.Text = Convert.ToString(GVData.PageCount);
         LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1));
         this.GoPage.Text = LabCurrentPage.Text.ToString();
     }
 }
Beispiel #2
0
    public void DataBindToGridview()
    {
        string XiaShuUser = ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select top 1 XiaShuUser from ERPUser where UserName='******'");
        string SSTempSTR = "";
        if (XiaShuUser != "全部")
        {
            SSTempSTR = "and UserName in(" + "'" + XiaShuUser.Replace(",", "','") + "'" + ")";
        }

        ZWL.BLL.ERPHuiBao MyModel = new ZWL.BLL.ERPHuiBao();
        GVData.DataSource = MyModel.GetList("TitleStr Like '%" + this.TextBox1.Text + "%' and UserName like '%" + this.TextBox2.Text + "%' " + SSTempSTR,"ID",true);
        GVData.DataBind();
        LabPageSum.Text = Convert.ToString(GVData.PageCount);
        LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1));
        this.GoPage.Text = LabCurrentPage.Text.ToString();
    }