コード例 #1
0
        private void RptBind(string _strWhere, string _orderby)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();

            //判断是否已经设置了微留言基本信息
            BLL.wx_hotel_room sbll = new BLL.wx_hotel_room();
            hotelid          = MyCommFun.RequestInt("hotelid");
            _strWhere        = "hotelid=" + hotelid + " " + _strWhere;
            this.page        = MXRequest.GetQueryInt("page", 1);
            txtKeywords.Text = this.keywords;
            DataSet ds = gbll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);

            // DataSet ds = gbll.GetList( _strWhere);
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataRow dr;

                int count = ds.Tables[0].Rows.Count;
                for (int i = 0; i < count; i++)
                {
                    dr = ds.Tables[0].Rows[i];
                }
                ds.AcceptChanges();
            }
            this.rptList.DataSource = ds;
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("hotel_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
コード例 #2
0
ファイル: hotel_room.aspx.cs プロジェクト: yidane/51wine
        private void RptBind(string _strWhere, string _orderby)
        {
            _strWhere = "hotelid=" + hotelid + " " + _strWhere;

            txtKeywords.Text = this.keywords;
            DataSet ds = roomBll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataRow dr;

                ds.Tables[0].Columns.Add(new DataColumn("StatusStr", typeof(string)));
                int count = ds.Tables[0].Rows.Count;
                Model.RoomStatus status = Model.RoomStatus.None;
                for (int i = 0; i < count; i++)
                {
                    dr     = ds.Tables[0].Rows[i];
                    status = (Model.RoomStatus)Enum.Parse(typeof(Model.RoomStatus), dr.Field <int>("Status").ToString());

                    switch (status)
                    {
                    case Model.RoomStatus.Submit:
                        dr["StatusStr"] = "<span class=\"badge sbumit\">提交审核</span>";
                        break;

                    case Model.RoomStatus.Agree:
                        dr["StatusStr"] = "<span class=\"badge agree\">审核通过</span>";
                        break;

                    case Model.RoomStatus.Refuse:
                        dr["StatusStr"] = "<span class=\"badge refuse\">审核不通过</span>";
                        break;

                    case Model.RoomStatus.Publish:
                        dr["StatusStr"] = "<span class=\"badge publish\">已发布</span>";
                        break;

                    case Model.RoomStatus.SoldOut:
                        dr["StatusStr"] = "<span class=\"badge\">已下架</span>";
                        break;
                    }
                }
                ds.AcceptChanges();
            }
            this.rptList.DataSource = ds;
            this.rptList.DataBind();
            EnableOperate();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("hotel_room.aspx", "action={0}&hotelid={1}&keywords={2}&page={3}", action, hotelid.ToString(), this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
コード例 #3
0
        public void hoteList(int hotelid)
        {
            hotel = hotelbll.GetModel(hotelid);
            if (hotel != null)
            {
                //listMode
                shuoming = hotel.orderRemark;
                dizhi    = hotel.hotelAddress;
                xplace   = hotel.xplace.ToString();
                yplace   = hotel.yplace.ToString();
                image    = hotel.coverPic;
                tel      = hotel.hotelPhone;

                yuding += " <li class=\"title\"><span class=\"none\">" + hotel.hotelName.ToString() + "</span></li>";
                yuding += "<li class=\"biaotou\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
                yuding += "<tr><td>类型</td><td class=\"yuanjia\">原价</td><td class=\"youhuijia\">优惠价</td></tr></table></li>";

                DataSet dr = roombll.GetList(hotelid);
                if (dr.Tables[0].Rows.Count > 0)
                {
                    if (hotel.listMode == false)
                    {
                        for (int i = 0; i < dr.Tables[0].Rows.Count; i++)
                        {
                            yuding += "<li class=\"dandanb\"><a href=\"hotel_form.aspx?roomid=" + dr.Tables[0].Rows[i]["id"].ToString() + "&hotelid=" + hotel.id.ToString() + "&openid=" + openid + "\"><span>";
                            yuding += "<table class=\"jiagebiao\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
                            yuding += "<tr><td>" + dr.Tables[0].Rows[i]["roomType"].ToString() + "";
                            yuding += " <p>" + dr.Tables[0].Rows[i]["indroduce"].ToString() + "</b></td>";
                            yuding += " <td class=\"yuanjia\">¥" + dr.Tables[0].Rows[i]["roomPrice"].ToString() + "</td><td class=\"youhuijia\">¥" + dr.Tables[0].Rows[i]["salePrice"].ToString() + "</td>";
                            yuding += "</tr></table></span></a></li>";
                        }
                    }

                    else
                    {
                        for (int i = 0; i < dr.Tables[0].Rows.Count; i++)
                        {
                            yuding += "   <li class=\"dandanb\"><a href=\"hotel_form.aspx?roomid=" + dr.Tables[0].Rows[i]["id"].ToString() + "&hotelid=" + hotel.id.ToString() + "&openid=" + openid + "\"><span>";
                            yuding += " <table class=\"jiagebiao\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
                            yuding += " <tr>";
                            yuding += " <td><div>" + dr.Tables[0].Rows[i]["roomType"].ToString() + "</div>";

                            BLL.wx_hotel_roompic roompic = new BLL.wx_hotel_roompic();
                            DataSet pic = roompic.GetList(Convert.ToInt32(dr.Tables[0].Rows[i]["id"].ToString()));
                            if (pic.Tables[0].Rows.Count > 0)
                            {
                                yuding += " <div><img src=\"" + pic.Tables[0].Rows[0]["roompic"] + "\" class=\"showimg\">";
                            }
                            else
                            {
                                yuding += " <div><img src=\"\" class=\"showimg\">";
                            }


                            yuding += " <p>" + dr.Tables[0].Rows[i]["indroduce"].ToString() + "</p>";
                            yuding += " <p>原价:<a class=\"yuanjia\">¥" + dr.Tables[0].Rows[i]["roomPrice"].ToString() + "</a></p>";
                            yuding += " <p>优惠价:<a class=\"youhuijia\">¥" + dr.Tables[0].Rows[i]["salePrice"].ToString() + "</a></p></td>";
                            yuding += " </tr>";
                            yuding += " </table>";
                            yuding += " </span></a>";
                            yuding += " </li>";
                        }
                    }
                }
            }
        }