コード例 #1
0
        public void LoadPSchoduyet()
        {
            Pager_choduyet.PageSize = Global.MembersPerPage;
            HPCBusinessLogic.DAL.T_Album_CategoriesDAL _cateDAL = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL();
            DataSet _ds;

            _ds = _cateDAL.Bind_T_Album_CategoriesDynamic(Pager_choduyet.PageIndex, Pager_choduyet.PageSize, WhereCondition(1));
            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_choduyet.PageIndex - 1, Pager_choduyet.PageSize, WhereCondition(1));
            }
            DataGrid_choduyet.DataSource = _ds;
            DataGrid_choduyet.DataBind(); _ds.Clear();
            Pager_choduyet.TotalRecords     = CurrentPage_choduyet.TotalRecords = TotalRecords;
            CurrentPage_choduyet.TotalPages = Pager_choduyet.CalculateTotalPages();
            CurrentPage_choduyet.PageIndex  = Pager_choduyet.PageIndex;
            GetTotal();
            foreach (DataGridItem item in DataGrid_choduyet.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");
            }
        }
コード例 #2
0
        public void Load_Choduyet()
        {
            Pager_Choduyet.PageSize = 5;
            T_MultimediaDAL _untilDAL = new T_MultimediaDAL();
            DataSet         _ds;

            _ds = _untilDAL.BindGridT_Multimedia(Pager_Choduyet.PageIndex, Pager_Choduyet.PageSize, WhereCondition(1));
            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 = _untilDAL.BindGridT_Multimedia(Pager_Choduyet.PageIndex - 1, Pager_Choduyet.PageSize, WhereCondition(1));
            }
            DataGrid_choduyet.DataSource = _ds.Tables[0];
            DataGrid_choduyet.DataBind(); _ds.Clear();
            Pager_Choduyet.TotalRecords     = CurrentPage_Choduyet.TotalRecords = TotalRecords;
            CurrentPage_Choduyet.TotalPages = Pager_Choduyet.CalculateTotalPages();
            CurrentPage_Choduyet.PageIndex  = Pager_Choduyet.PageIndex;
            GetTotal();
        }