public void LoadPSdaduyet() { Pager_daduyet.PageSize = Global.MembersPerPage; HPCBusinessLogic.DAL.T_Album_CategoriesDAL _cateDAL = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL(); DataSet _ds; _ds = _cateDAL.Bind_T_Album_CategoriesDynamic(Pager_daduyet.PageIndex, Pager_daduyet.PageSize, WhereCondition(3)); int TotalRecords = Convert.ToInt32(_ds.Tables[1].Rows[0].ItemArray[0].ToString()); int TotalRecord = Convert.ToInt32(_ds.Tables[0].Rows.Count); if (TotalRecord == 0) { _ds = _cateDAL.Bind_T_Album_CategoriesDynamic(Pager_daduyet.PageIndex - 1, Pager_daduyet.PageSize, WhereCondition(3)); } DataGrid_XB.DataSource = _ds; DataGrid_XB.DataBind(); _ds.Clear(); Pager_daduyet.TotalRecords = CurrentPage_daduyet.TotalRecords = TotalRecords; CurrentPage_daduyet.TotalPages = Pager_daduyet.CalculateTotalPages(); CurrentPage_daduyet.PageIndex = Pager_daduyet.PageIndex; GetTotal(); foreach (DataGridItem item in DataGrid_XB.Items) { ImageButton btnview = (ImageButton)item.FindControl("btnViewPhoto"); Label lblcatid = (Label)item.FindControl("lblcatid"); btnview.Attributes.Add("onclick", "PopupWindow('T_Album_Categories_View.aspx?catps=" + lblcatid.Text + "')"); item.Attributes.Add("onmouseover", "currColor=this.style.backgroundColor;this.style.backgroundColor='" + CommonLib.HPCOnmouseoverGrid() + "'"); item.Attributes.Add("onmouseout", "this.style.backgroundColor=currColor"); } }
public void LoadPSXB() { string where = " 1=1 and Cat_Album_Status_Approve = 4 AND Lang_ID IN (SELECT DISTINCT(T_Nguoidung_NgonNgu.Ma_Ngonngu) FROM T_Nguoidung_NgonNgu WHERE T_Nguoidung_NgonNgu.[Ma_Nguoidung] = " + _user.UserID + ")"; if (!String.IsNullOrEmpty(this.txtSearch_Cate.Text.Trim())) { where += " AND " + string.Format(" Cat_Album_Name like N'%{0}%'", UltilFunc.SqlFormatText(this.txtSearch_Cate.Text.Trim())); } if (cboNgonNgu.SelectedIndex > 0) { where += " AND Lang_ID=" + cboNgonNgu.SelectedValue.ToString(); } where += " Order by Cat_Album_ID DESC"; Pager_DaXB.PageSize = Global.MembersPerPage; HPCBusinessLogic.DAL.T_Album_CategoriesDAL _cateDAL = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL(); DataSet _ds; _ds = _cateDAL.Bind_T_Album_CategoriesDynamic(Pager_DaXB.PageIndex, Pager_DaXB.PageSize, where); int TotalRecords = Convert.ToInt32(_ds.Tables[1].Rows[0].ItemArray[0].ToString()); int TotalRecord = Convert.ToInt32(_ds.Tables[0].Rows.Count); if (TotalRecord == 0) { _ds = _cateDAL.Bind_T_Album_CategoriesDynamic(Pager_DaXB.PageIndex - 1, Pager_DaXB.PageSize, where); } DataGrid_DaXB.DataSource = _ds; DataGrid_DaXB.DataBind(); _ds.Clear(); Pager_DaXB.TotalRecords = curentPages_DaXB.TotalRecords = TotalRecords; curentPages_DaXB.TotalPages = Pager_DaXB.CalculateTotalPages(); curentPages_DaXB.PageIndex = Pager_DaXB.PageIndex; foreach (DataGridItem item in DataGrid_DaXB.Items) { ImageButton btnview = (ImageButton)item.FindControl("btnViewPhoto"); Label lblcatid = (Label)item.FindControl("lblcatid"); btnview.Attributes.Add("onclick", "PopupWindow('T_Album_Categories_View.aspx?catps=" + lblcatid.Text + "')"); item.Attributes.Add("onmouseover", "currColor=this.style.backgroundColor;this.style.backgroundColor='" + CommonLib.HPCOnmouseoverGrid() + "'"); item.Attributes.Add("onmouseout", "this.style.backgroundColor=currColor"); } }