protected void GetView() { int Tid = 0; if (string.IsNullOrEmpty(TMailList.SelectedNodeID)) { Tid = 0; } else { Tid = int.Parse(TMailList.SelectedNodeID); } Maticsoft.BLL.tPicture BLL = new Maticsoft.BLL.tPicture(); if (Tid == 0) { Grid.RecordCount = BLL.GetRecordCount(""); Grid.DataSource = BLL.GetListByPage("", " Sort desc,Id desc ", Grid.PageIndex * Grid.PageSize, (Grid.PageIndex + 1) * Grid.PageSize); } else { Grid.RecordCount = BLL.GetRecordCount(" PicTyID=" + Tid); Grid.DataSource = BLL.GetListByPage(" PicTyID=" + Tid, " Sort desc, Id desc ", Grid.PageIndex * Grid.PageSize, (Grid.PageIndex + 1) * Grid.PageSize); } Grid.DataBind(); }
protected void btnSelect_Click(object sender, EventArgs e) { string txtVal = this.txtValue.Text.Trim(); if (txtVal == "") { GetView(); } int Tid = 0; if (string.IsNullOrEmpty(TMailList.SelectedNodeID)) { Tid = 0; } else { Tid = int.Parse(TMailList.SelectedNodeID); } Maticsoft.BLL.tPicture BLL = new Maticsoft.BLL.tPicture(); if (Tid == 0) { Grid.RecordCount = BLL.GetRecordCount(String.Format(" Name like '%{0}%' ", txtVal)); Grid.DataSource = BLL.GetListByPage(String.Format(" Name like '%{0}%' ", txtVal), " Sort desc,Id desc ", Grid.PageIndex * Grid.PageSize, (Grid.PageIndex + 1) * Grid.PageSize); } else { Grid.RecordCount = BLL.GetRecordCount(String.Format(" Name like '%{0}%' and PicTyID=" + Tid, txtVal)); Grid.DataSource = BLL.GetListByPage(String.Format(" Name like '%{0}%' and PicTyID=" + Tid, txtVal), " Sort desc, Id desc ", Grid.PageIndex * Grid.PageSize, (Grid.PageIndex + 1) * Grid.PageSize); } Grid.DataBind(); }
protected void BindGridByTid(int Tid) { Maticsoft.BLL.tPicture BLL = new Maticsoft.BLL.tPicture(); if (Tid == 0) { Grid.RecordCount = BLL.GetRecordCount(""); Grid.DataSource = BLL.GetListByPage("", " Sort desc,Id desc ", Grid.PageIndex * Grid.PageSize, (Grid.PageIndex + 1) * Grid.PageSize); } else { Grid.RecordCount = BLL.GetRecordCount(" PicTyID=" + Tid); Grid.DataSource = BLL.GetListByPage(" PicTyID=" + Tid, " Sort desc, Id desc ", Grid.PageIndex * Grid.PageSize, (Grid.PageIndex + 1) * Grid.PageSize); } Grid.DataBind(); }