Beispiel #1
0
        public void BindGV(int pageSize, int CurrentPageIndex)
        {
            string sort        = "id";
            string order       = "asc";
            int    currentPage = Pager.CurrentPageIndex;

            GrdCostRoom.DataSource      = fmtype.GetBookRoomPager(sort, order, currentPage, pageSize, " where 1=1");
            Pager.RecordCount           = fmtype.GetRecordCount("1=1");
            Pager.ShowCustomInfoSection = Wuqi.Webdiyer.ShowCustomInfoSection.Right;
            Pager.PageSize = 20;
            GrdCostRoom.DataBind();
            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>";
                }
            }
        }
Beispiel #2
0
        public void BindGV()
        {
            string sort                  = "id";
            string order                 = "DESC";
            int    currentPage           = Pager.CurrentPageIndex;
            IList <Model.room_type> list = fmtype.GetBookRoomPager(sort, order, currentPage, pageSize, " where 1=1");

            GrdCostRoom.DataSource = list;
            GrdCostRoom.DataBind();
        }
        /// <summary>
        /// 退房绑定
        /// </summary>
        public void BandTF()
        {
            int    count     = 0;
            string roomsName = "";
            //and tuifaId in(" + hidid + ")
            //and tuifaId in(0,1)
            string  a  = fmOc.GetModel(ids).lordRoomid;
            DataSet dt = fmOc.GetList(" occ_with='否' and order_id='" + orderid + "'  ");

            foreach (DataRow dr in dt.Tables[0].Rows)
            {
                if (dr["lordRoomid"].ToString() == dr["room_number"].ToString())
                {
                    dr["lordRoomid"] = "主";
                }
                else
                {
                    dr["lordRoomid"] = "从";
                }

                if (dr["state_id"].ToString() == "3")
                {
                    dr["mem_cardno"] = "已退房";
                }
                if (dr["state_id"].ToString() == "0")
                {
                    dr["mem_cardno"] = "在住";
                }
                count++;
                //if (hidids == "" ||hidids==null)
                //{
                //    hidids = dr["order_id"].ToString();
                //    //hidid = dr["occ_id"].ToString();
                //}
                //else
                //{
                //    hidids += "," + dr["order_id"].ToString();
                //   // hidid =","+ dr["occ_id"].ToString();
                //}
                txt_num.InnerText = count.ToString();
                if (roomsName == "")
                {
                    roomsName = dr["room_number"].ToString();
                }
                else
                {
                    roomsName += "," + dr["room_number"].ToString();
                }
                sboption.Append("<option value='" + dr["room_number"] + "'>" + dr["room_number"] + "</option>");
                roomNumed.InnerText = roomsName;
            }
            if (count > 2)
            {
                btngd.Attributes.Add("display", "block");
            }
            GrdCostRoom.DataSource = dt;
            GrdCostRoom.DataBind();
            for (int i = 0; i < GrdCostRoom.Rows.Count; i++)
            {
                CheckBox    cbxCheck  = GrdCostRoom.Rows[i].FindControl("cbxCheck") as CheckBox;
                HiddenField hidNewsId = GrdCostRoom.Rows[i].FindControl("hidId") as HiddenField;
                if (fmOc.GetModel(Convert.ToInt32(hidNewsId.Value)).state_id == 3 || fmOc.GetModel(Convert.ToInt32(hidNewsId.Value)).state_id == 2)
                {
                    cbxCheck.Enabled = false;
                    cbxCheck.Checked = true;
                }
            }
        }