Beispiel #1
0
        //根据条件分页查询
        public void BookDataBind(int pageSize, int pageindex)
        {
            string sort        = "book_id";
            string order       = "DESC";
            int    currentPage = Pager.CurrentPageIndex;

            string strWhere = " WHERE 1=1 ";

            if (this.book_name.Value.Trim().Length > 0)
            {
                strWhere += " AND book_Name LIKE '%" + this.book_name.Value.Trim() + "%'";
            }

            if (this.date1.Value.Trim().ToString().Length > 0 && this.date2.Value.Trim().ToString().Length > 0)
            {
                strWhere += "AND  CONVERT(VARCHAR(100), time_to, 23)   >= '" + this.date1.Value.Trim() + "' and CONVERT(VARCHAR(100), time_to, 23)  <= '" + this.date2.Value.Trim() + "'";
            }

            if (this.book_no.Value.Trim().Length > 0)
            {
                strWhere += " AND book_no LIKE '%" + this.book_no.Value.Trim() + "%'";
            }

            if (this.tele_no.Value.Trim().Length > 0)
            {
                strWhere += " AND tele_no LIKE '%" + this.tele_no.Value.Trim() + "%'";
            }
            if (!IsPostBack)
            {
                string value1 = this.RoomStateDdl.Items.FindByText("普通预定").Value;
                string value2 = this.RoomStateDdl.Items.FindByText("确认预定").Value;
                strWhere += " AND (state_id IN ('" + value1 + "','" + value2 + "')) ";
            }
            else
            {
                if (this.RoomStateDdl.SelectedValue.Trim().Length > 0)
                {
                    if (this.RoomStateDdl.SelectedValue.Trim() != "全部")
                    {
                        strWhere += " AND (state_id IN (SELECT state_id FROM room_state WHERE state_id='" + this.RoomStateDdl.SelectedValue.Trim() + "')) ";
                    }
                }
            }
            if (this.fengfangddl.SelectedValue.Trim() == "是")
            {
                strWhere += " AND room_number IS NOT NULL";
            }

            if (this.fengfangddl.SelectedValue.Trim() == "否")
            {
                strWhere += " AND room_number IS NULL";
            }

            IList <Model.book_room> list = brBll.GetBookRoomPager(sort, order, currentPage, pageSize, strWhere);

            if (list.Count > 0)
            {
                foreach (Model.book_room item in list)
                {
                    item.ListBr = brdBll.GetListModel("Book_no='" + item.book_no + "'");
                }
                GetListRoom(list);
            }
            Pager.RecordCount           = sum;
            Pager.ShowCustomInfoSection = Wuqi.Webdiyer.ShowCustomInfoSection.Right;
            //Pager.PageSize = pageSize;
            //Pager.CurrentPageIndex = pageindex;
            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;
        }
Beispiel #2
0
        public void bindInfo()
        {
            Model.room_number mod = new Model.room_number();

            BindYXGV();
            if (Request.QueryString["type"].ToString() == "yding")
            {
                IList <Model.book_room> list = brBll.GetBookRoomPager("book_id", "Desc", 1, 1, " WHERE book_no='" + Request.QueryString["ydbookno"].ToString() + "' ");
                if (list.Count > 0)
                {
                    foreach (Model.book_room item in list)
                    {
                        item.ListBr = fmrdet.GetListModel("Book_no='" + item.book_no + "' and Room_number in (" + Request.QueryString["xqid"].ToString() + ") and Room_typeid=1");
                        foreach (Model.Book_Rdetail br in item.ListBr)
                        {
                            contents += br.Room_number + "#"
                                        + (br.Real_type_Id.ToString()) + "#"
                                        + (item.source_id.ToString()) + "#"
                                        + (br.Real_Scheme_Id.ToString()) + "#"
                                        + br.Real_Price.ToString() + "#"
                                        + "否" + "#"
                                        + (item.real_time.ToString()) + "#"
                                        + 1 + "#"
                                        + (item.time_from.ToString()) + "#"
                                        + item.book_Name + "#"
                                        + this.txt_Sex.Value + "#"
                                        + this.txt_Date2.Value + "#"
                                        + this.txt_mingzhu.Value + "#"
                                        + (this.DDlSFz.SelectedValue) + "#"
                                        + (this.txt_CardId.Value) + "#"

                                        + item.remark + "#"
                                        + (item.meth_pay_id.ToString()) + "#"
                                        + txt_address.Value + "#"
                                        + item.ListBr[0].Room_number + "#" + item.tele_no + "|";
                        }
                    }
                }
            }
            if (Request.QueryString["type"].ToString() == "0")
            {
                txt_roomid.Value         = fhBll.GetModel(Convert.ToInt32(ids)).Rn_roomNum;
                ddroomtype.SelectedValue = fhBll.GetModel(Convert.ToInt32(ids)).Rn_room.ToString();
                txt_money.Value          = fhBll.GetModel(Convert.ToInt32(ids)).Rn_price.ToString();
                txt_rzdate.Value         = System.DateTime.Now.ToString();
                txt_roomnumber.Value     = ids.ToString();
                txt_zfzhanghao.Value     = txt_roomid.Value;

                contents += this.txt_roomid.Value + "#"
                            + (this.ddroomtype.SelectedValue) + "#"


                            + "否" + "#"
                            + (this.txt_rzdate.Value) + "#"
                            + (this.txt_Day.Value) + "#"
                            + (this.txt_ylDate.Value) + "#"
                            + this.txt_name.Value + "#"
                            + this.txt_Sex.Value + "#"
                            + this.txt_Date2.Value + "#"
                            + this.txt_mingzhu.Value + "#"
                            + (this.DDlSFz.SelectedValue) + "#"
                            + (this.txt_CardId.Value) + "#"

                            + this.txt_Remaker.Value + "#"
                            + (DDlZffs.SelectedValue) + "#"
                            + txt_address.Value + "#"
                            + txt_zfzhanghao.Value + "#" + txt_lxphone.Value + "|";
            }
        }