Ejemplo n.º 1
0
        //根据条件分页查询
        public void BindGv(int pageSize, int pageindex)
        {
            Shwere();
            string sort                   = "order_id";
            string order                  = "DESC";
            int    currentPage            = Pager.CurrentPageIndex;
            IList <Model.occu_infor> list = brBll.GetBookRoomPager(sort, order, currentPage, pageSize, stwhere);

            foreach (Model.occu_infor item in list)
            {
                if (orsort == "")
                {
                    orsort = item.occ_id.ToString();
                }
                else
                {
                    orsort += "," + item.occ_id.ToString();
                }
            }
            if (list.Count > 0)
            {
                GetListRoom(list);
            }
            #region

            DataSet dt = brBll.GetLists(stwhere);
            foreach (DataRow dr in dt.Tables[0].Rows)
            {
                try
                {
                    if (dr["amount_rece"] == null || dr["amount_rece"].ToString() == "")
                    {
                        dr["amount_rece"] = 0;
                    }
                    if (dr["amount_money"] == null || dr["amount_money"].ToString() == "")
                    {
                        dr["amount_money"] = 0;
                    }
                    //Days += ldDays(Convert.ToDateTime(dr["occ_time"].ToString()));
                    //FjMoneys += Convert.ToDouble(dr["real_price"]);
                    //CSGZMoneys += GetFZ(ldDays(Convert.ToDateTime(dr["occ_time"].ToString())), dr["real_price"]);
                    //YEMoneys += GetYE(dr["occ_no"]);
                    //SKMoneys += GetSK(dr["occ_no"]);
                    //XFMoneys += GetXF(dr["occ_no"]);
                }
                catch { }
            }



            Pager.RecordCount           = brBll.GetRecordCount(stwhere);
            Pager.ShowCustomInfoSection = Wuqi.Webdiyer.ShowCustomInfoSection.Right;
            //Pager.PageSize = pageSize;
            //Pager.CurrentPageIndex = pageindex;
            #endregion
            if (Pager != null)
            {
                if (Pager.RecordCount != 0)
                {
                    Pager.ShowPageIndex          = true;
                    Pager.ShowDisabledButtons    = true;
                    Pager.CustomInfoSectionWidth = new System.Web.UI.WebControls.Unit("40%");
                    Pager.ShowPageIndexBox       = Wuqi.Webdiyer.ShowPageIndexBox.Always;
                    Pager.CustomInfoHTML         = "&nbsp;记录总数:<b>" + Pager.RecordCount.ToString() + "</b>";
                    Pager.CustomInfoHTML        += " 总页数:<b>" + Pager.PageCount.ToString() + "</b>";
                    Pager.CustomInfoHTML        += " 当前页:<font color=\"red\"><b>" + Pager.CurrentPageIndex.ToString() + "</b></font>";
                }
                else
                {
                    Pager.ShowPageIndex          = false;
                    Pager.ShowDisabledButtons    = false;
                    Pager.ShowPageIndexBox       = Wuqi.Webdiyer.ShowPageIndexBox.Never;
                    Pager.CustomInfoSectionWidth = new System.Web.UI.WebControls.Unit("100%");
                    Pager.CustomInfoHTML         = "<div class='norecord'><span>当前无记录</span></div>";
                }
            }
            return;
        }