예제 #1
0
        /// <summary>
        /// 写入酒店供应商信息,正值时成功,负值或0时失败
        /// </summary>
        /// <param name="info">酒店供应商信息业务实体</param>
        /// <returns>正值:成功 负值或0:失败</returns>
        public int InsertHotelInfo(EyouSoft.Model.SupplierStructure.SupplierHotelInfo info)
        {
            using (TransactionScope AddTran = new TransactionScope())
            {
                bool dalResult = false;
                EyouSoft.BLL.CompanyStructure.SupplierBaseHandle basicbll = new EyouSoft.BLL.CompanyStructure.SupplierBaseHandle();
                info.Id  = basicbll.AddSupplierBase(info);
                basicbll = null;

                if (info.Id < 1)
                {
                    return(-1);
                }

                dalResult = dal.InsertHotelPertain(info);
                if (!dalResult)
                {
                    return(-2);
                }

                dalResult = dal.InsertRoomTypes(info.Id, info.RoomTypes);
                if (!dalResult)
                {
                    return(-3);
                }

                AddTran.Complete();
            }

            return(1);
        }
예제 #2
0
        private void loadXls()
        {
            string data = Utils.GetFormValue("dataxls");

            string[] s = data.Split(';');
            EyouSoft.BLL.SupplierStructure.SupplierHotel hotelbll = new EyouSoft.BLL.SupplierStructure.SupplierHotel();
            IList <EyouSoft.Model.SupplierStructure.SupplierHotelInfo> hotelinfo = new List <EyouSoft.Model.SupplierStructure.SupplierHotelInfo>();

            for (int i = 0; i < s.Length; i++)
            {
                string[] smodel = s[i].Split(',');
                if (smodel.Length == 18 && !string.IsNullOrEmpty(smodel[0]) && !string.IsNullOrEmpty(smodel[1]) && !string.IsNullOrEmpty(smodel[2]))
                {
                    EyouSoft.Model.SupplierStructure.SupplierHotelInfo modelhotel = new EyouSoft.Model.SupplierStructure.SupplierHotelInfo();
                    modelhotel.ProvinceName = HttpUtility.UrlDecode(smodel[0]);
                    modelhotel.CityName     = HttpUtility.UrlDecode(smodel[1]);
                    modelhotel.UnitName     = HttpUtility.UrlDecode(smodel[2]);
                    modelhotel.Star         = Utils.GetEnumValue <EyouSoft.Model.EnumType.SupplierStructure.HotelStar>(HttpUtility.UrlDecode(smodel[3]), EyouSoft.Model.EnumType.SupplierStructure.HotelStar.挂3);
                    modelhotel.UnitAddress  = HttpUtility.UrlDecode(smodel[4]);
                    modelhotel.Introduce    = HttpUtility.UrlDecode(smodel[5]);
                    modelhotel.TourGuide    = HttpUtility.UrlDecode(smodel[6]);

                    modelhotel.SupplierContact = new List <EyouSoft.Model.CompanyStructure.SupplierContact>();
                    EyouSoft.Model.CompanyStructure.SupplierContact scmodel = new EyouSoft.Model.CompanyStructure.SupplierContact();
                    scmodel.ContactName   = HttpUtility.UrlDecode(smodel[7]);
                    scmodel.JobTitle      = HttpUtility.UrlDecode(smodel[8]);
                    scmodel.ContactTel    = HttpUtility.UrlDecode(smodel[9]);
                    scmodel.ContactMobile = HttpUtility.UrlDecode(smodel[10]);
                    scmodel.QQ            = HttpUtility.UrlDecode(smodel[11]);
                    scmodel.Email         = HttpUtility.UrlDecode(smodel[12]);
                    scmodel.CompanyId     = SiteUserInfo.CompanyID;
                    modelhotel.SupplierContact.Add(scmodel);

                    modelhotel.OperatorId   = SiteUserInfo.ID;
                    modelhotel.IssueTime    = System.DateTime.Now;
                    modelhotel.CompanyId    = SiteUserInfo.CompanyID;
                    modelhotel.TradeNum     = 0;
                    modelhotel.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.酒店;
                    modelhotel.SupplierPic  = null;

                    modelhotel.RoomTypes = new List <EyouSoft.Model.SupplierStructure.SupplierHotelRoomTypeInfo>();
                    EyouSoft.Model.SupplierStructure.SupplierHotelRoomTypeInfo roomtype = new EyouSoft.Model.SupplierStructure.SupplierHotelRoomTypeInfo();
                    roomtype.Name            = HttpUtility.UrlDecode(smodel[13]);
                    roomtype.SellingPrice    = Utils.GetDecimal(HttpUtility.UrlDecode(smodel[14]));
                    roomtype.AccountingPrice = Utils.GetDecimal(HttpUtility.UrlDecode(smodel[15]));
                    roomtype.IsBreakfast     = HttpUtility.UrlDecode(smodel[16]) == "是" ? true : false;
                    modelhotel.RoomTypes.Add(roomtype);
                    modelhotel.Remark = HttpUtility.UrlDecode(smodel[17]);

                    hotelinfo.Add(modelhotel);
                }
            }
            int res = 0;

            res = hotelbll.InsertHotels(hotelinfo);

            Response.Clear();
            Response.Write(string.Format("{{\"res\":{0}}}", res > 0 ? 1 : -1));
            Response.End();
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //实例化酒店业务逻辑类和实体类
            HotelModle = new EyouSoft.Model.SupplierStructure.SupplierHotelInfo();
            HotelBll   = new EyouSoft.BLL.SupplierStructure.SupplierHotel();

            //权限判断
            if (!CheckGrant(global::Common.Enum.TravelPermission.供应商管理_酒店_栏目))
            {
                Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.供应商管理_酒店_栏目, true);
            }

            grantadd    = CheckGrant(global::Common.Enum.TravelPermission.供应商管理_酒店_新增);
            grantdel    = CheckGrant(global::Common.Enum.TravelPermission.供应商管理_酒店_删除);
            grantmodify = CheckGrant(global::Common.Enum.TravelPermission.供应商管理_酒店_修改);
            grantto     = CheckGrant(global::Common.Enum.TravelPermission.供应商管理_酒店_导出);
            grantload   = CheckGrant(global::Common.Enum.TravelPermission.供应商管理_酒店_导入);

            this.ucProvince1.CompanyId = CurrentUserCompanyID;
            this.ucProvince1.IsFav     = true;
            this.ucCity1.CompanyId     = CurrentUserCompanyID;
            this.ucCity1.IsFav         = true;

            if (!this.Page.IsPostBack)
            {
                BindHotelStart();

                //操作类型变量 删除 导出excel
                action = Utils.GetQueryStringValue("action");
                switch (action)
                {
                case "toexcel":
                {
                    if (grantto)
                    {
                        CreateExcel("Hotel" + DateTime.Now.ToShortDateString());
                    }
                }
                break;

                case "hoteldel":
                {
                    if (grantdel)
                    {
                        HotelDel();
                    }
                }
                break;

                default:
                    DataInit();
                    break;
                }
            }
        }
예제 #4
0
        /// <summary>
        /// 写入酒店供应商附加信息
        /// </summary>
        /// <param name="info">酒店供应商信息业务实体</param>
        /// <returns></returns>
        public bool InsertHotelPertain(EyouSoft.Model.SupplierStructure.SupplierHotelInfo info)
        {
            DbCommand cmd = this._db.GetSqlStringCommand(SQL_INSERT_InsertHotelPertain);

            this._db.AddInParameter(cmd, "SupplierId", DbType.Int32, info.Id);
            this._db.AddInParameter(cmd, "Star", DbType.Byte, info.Star);
            this._db.AddInParameter(cmd, "Introduce", DbType.String, info.Introduce);
            this._db.AddInParameter(cmd, "TourGuide", DbType.String, info.TourGuide);

            return(DbHelper.ExecuteSql(cmd, this._db) == 1 ? true : false);
        }
예제 #5
0
        protected bool show = false;//是否查看

        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            //实例化酒店业务逻辑类和实体类
            Hotelinfo = new EyouSoft.Model.SupplierStructure.SupplierHotelInfo();
            HotelBll  = new EyouSoft.BLL.SupplierStructure.SupplierHotel();

            //初始化省份城市
            this.ucProvince1.CompanyId = CurrentUserCompanyID;
            this.ucProvince1.IsFav     = true;
            this.ucCity1.CompanyId     = CurrentUserCompanyID;
            this.ucCity1.IsFav         = true;

            if (!IsPostBack)
            {
                BindHotelStart();
                //操作权限判断
                if (CheckGrant(global::Common.Enum.TravelPermission.供应商管理_酒店_栏目))
                {
                    type = Utils.GetQueryStringValue("type");
                    switch (type)
                    {
                    case "modify":
                        if (CheckGrant(global::Common.Enum.TravelPermission.供应商管理_酒店_修改))
                        {
                            Databind();
                        }
                        else
                        {
                            Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.供应商管理_酒店_修改, false);
                        }
                        break;

                    case "show":
                        show = true;
                        Databind();
                        break;

                    default:
                        if (!CheckGrant(global::Common.Enum.TravelPermission.供应商管理_酒店_新增))
                        {
                            Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.供应商管理_酒店_新增, false);
                        }
                        photo_row = 0;
                        break;
                    }
                }
            }
        }
예제 #6
0
        /// <summary>
        /// 获取酒店供应商附加信息(含房型信息集合,不含供应商基本信息)
        /// </summary>
        /// <param name="supplierId">供应商编号</param>
        /// <returns></returns>
        public EyouSoft.Model.SupplierStructure.SupplierHotelInfo GetHotelPertainInfo(int supplierId)
        {
            EyouSoft.Model.SupplierStructure.SupplierHotelInfo info = null;
            DbCommand cmd = this._db.GetSqlStringCommand(SQL_SELECT_GetHotelPertainInfo);

            this._db.AddInParameter(cmd, "SupplierId", DbType.Int32, supplierId);

            using (IDataReader rdr = DbHelper.ExecuteReader(cmd, this._db))
            {
                if (rdr.Read())
                {
                    info = new EyouSoft.Model.SupplierStructure.SupplierHotelInfo()
                    {
                        Id        = supplierId,
                        Star      = (EyouSoft.Model.EnumType.SupplierStructure.HotelStar)rdr.GetByte(rdr.GetOrdinal("Star")),
                        Introduce = rdr["Introduce"].ToString(),
                        TourGuide = rdr["TourGuide"].ToString(),
                        RoomTypes = new List <EyouSoft.Model.SupplierStructure.SupplierHotelRoomTypeInfo>()
                    };
                }

                if (info != null && rdr.NextResult())
                {
                    while (rdr.Read())
                    {
                        info.RoomTypes.Add(new EyouSoft.Model.SupplierStructure.SupplierHotelRoomTypeInfo()
                        {
                            AccountingPrice = rdr.GetDecimal(rdr.GetOrdinal("AccountingPrice")),
                            IsBreakfast     = this.GetBoolean(rdr.GetString(rdr.GetOrdinal("IsBreakfast"))),
                            Name            = rdr["Name"].ToString(),
                            RoomTypeId      = rdr.GetInt32(rdr.GetOrdinal("RoomTypeId")),
                            SellingPrice    = rdr.GetDecimal(rdr.GetOrdinal("SellingPrice"))
                        });
                    }
                }
            }

            return(info);
        }
예제 #7
0
 private void Databind()
 {
     tid = Utils.GetInt(Utils.GetQueryStringValue("tid"));
     if (tid > 0)
     {
         Hotelinfo = HotelBll.GetHotelInfo(tid);
         this.ucProvince1.ProvinceId = Hotelinfo.ProvinceId;
         this.ucCity1.CityId         = Hotelinfo.CityId;
         this.ucCity1.ProvinceId     = Hotelinfo.ProvinceId;
         if (this.HotelStart.Items.FindByValue(((int)Hotelinfo.Star).ToString()) != null)
         {
             this.HotelStart.Items.FindByValue(((int)Hotelinfo.Star).ToString()).Selected = true;
         }
         if (Hotelinfo.SupplierPic != null && Hotelinfo.SupplierPic.Count > 0)
         {
             BindPhoto(Hotelinfo.SupplierPic);
         }
         else
         {
             photo_row = 0;
         }
     }
 }
예제 #8
0
        /// <summary>
        /// 获取酒店供应商信息业务实体
        /// </summary>
        /// <param name="supplierId">供应商编号</param>
        /// <returns></returns>
        public EyouSoft.Model.SupplierStructure.SupplierHotelInfo GetHotelInfo(int supplierId)
        {
            if (supplierId < 1)
            {
                return(null);
            }

            EyouSoft.Model.SupplierStructure.SupplierHotelInfo info      = dal.GetHotelPertainInfo(supplierId);
            EyouSoft.BLL.CompanyStructure.SupplierBaseHandle   basicbll  = new EyouSoft.BLL.CompanyStructure.SupplierBaseHandle();
            EyouSoft.Model.CompanyStructure.SupplierBasic      basicinfo = basicbll.GetSupplierBase(supplierId);
            basicbll = null;

            if (basicinfo != null && info != null)
            {
                info.CityId          = basicinfo.CityId;
                info.CityName        = basicinfo.CityName;
                info.CompanyId       = basicinfo.CompanyId;
                info.Id              = basicinfo.Id;
                info.IsDelete        = basicinfo.IsDelete;
                info.IssueTime       = basicinfo.IssueTime;
                info.OperatorId      = basicinfo.OperatorId;
                info.ProvinceId      = basicinfo.ProvinceId;
                info.ProvinceName    = basicinfo.ProvinceName;
                info.Remark          = basicinfo.Remark;
                info.SupplierContact = basicinfo.SupplierContact;
                info.SupplierPic     = basicinfo.SupplierPic;
                info.SupplierType    = basicinfo.SupplierType;
                info.TradeNum        = basicinfo.TradeNum;
                info.UnitAddress     = basicinfo.UnitAddress;
                info.UnitName        = basicinfo.UnitName;

                return(info);
            }

            return(null);
        }
예제 #9
0
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            //接受参数
            tid = Utils.GetInt(Utils.GetQueryStringValue("tid"));
            if (tid > 0)
            {
                Hotelinfo    = HotelBll.GetHotelInfo(tid);
                Hotelinfo.Id = tid;
            }
            else
            {
                Hotelinfo.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.酒店;
            }
            //省份编号
            Hotelinfo.ProvinceId = this.ucProvince1.ProvinceId;
            EyouSoft.Model.CompanyStructure.Province Provincemodel = new EyouSoft.BLL.CompanyStructure.Province().GetModel(this.ucProvince1.ProvinceId);
            if (Provincemodel != null)
            {
                Hotelinfo.ProvinceName = Provincemodel.ProvinceName;
            }
            //城市编号
            Hotelinfo.CityId = this.ucCity1.CityId;
            EyouSoft.Model.CompanyStructure.City citymodel = new EyouSoft.BLL.CompanyStructure.City().GetModel(this.ucCity1.CityId);
            if (citymodel != null)
            {
                Hotelinfo.CityName = citymodel.CityName;
            }

            //单位名称
            string unionname = Utils.GetFormValue("unionname");
            //酒店星级
            int HotelStart = Utils.GetInt(Utils.GetFormValue(this.HotelStart.UniqueID));
            //酒店地址
            string TxtHotelAddress = Utils.GetFormValue("TxtHotelAddress");
            //酒店简介
            string HotelIntroduction = Utils.GetFormValue("HotelIntroduction");

            #region 酒店图片
            if (Request.Files.Count > 0)
            {
                string msg = "";
                if (!EyouSoft.Common.Function.UploadFile.CheckFileType(Request.Files, "file_landspace", new[] { ".gif", ".jpg", ".jpeg", ".png" }, null, out msg))
                {
                    MessageBox.ResponseScript(this, ";alert('" + msg + "');");
                    BindHotelStart();
                    return;
                }
                Hotelinfo.SupplierPic = new List <EyouSoft.Model.SupplierStructure.SupplierPic>();
                EyouSoft.Model.SupplierStructure.SupplierPic SupplierPic = new EyouSoft.Model.SupplierStructure.SupplierPic();
                string filepath    = string.Empty;
                string oldfilename = string.Empty;
                //if (EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["HotelImage"], "SupplierControlFile", out filepath, out oldfilename))
                //{
                //    if (filepath.Trim() != "" && oldfilename.Trim() != "")
                //    {
                //        SupplierPic.PicPath = filepath;
                //        SupplierPic.PicName = oldfilename;
                //        Hotelinfo.SupplierPic.Add(SupplierPic);
                //    }
                //}
                //遍历files取出file.
                for (int i = 0; i < Request.Files.Count; i++)
                {
                    bool result_landspace = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files[i], "SightImg", out filepath, out oldfilename);
                    if (result_landspace)
                    {
                        Hotelinfo.SupplierPic = DisonseImg_Sight_Add(filepath, oldfilename, Hotelinfo.SupplierPic);
                    }
                }
            }
            //判断是新增还是修改,修改调用下马的方法
            if (tid > 0)
            {
                //取出页面上未修改的图片
                Hotelinfo.SupplierPic = GetImg_Photo(this.hidImgPhoto.Value, Hotelinfo.SupplierPic);
            }
            #endregion

            //导游词
            string TourGuids = Utils.GetFormValue("TourGuids");

            //当前公司编号
            Hotelinfo.CompanyId = this.SiteUserInfo.CompanyID;
            //当前操作人编号
            Hotelinfo.OperatorId = this.SiteUserInfo.ID;

            #region 联系人信息
            Hotelinfo.SupplierContact = new List <EyouSoft.Model.CompanyStructure.SupplierContact>();
            string[] UserName   = Utils.GetFormValues("inname");
            string[] Userdate   = Utils.GetFormValues("indate");
            string[] Userphone  = Utils.GetFormValues("inphone");
            string[] Usermobile = Utils.GetFormValues("inmobile");
            string[] Userqq     = Utils.GetFormValues("inqq");
            string[] Usermail   = Utils.GetFormValues("inemail");
            string[] Userfax    = Utils.GetFormValues("inefax");
            for (int i = 0; i < UserName.Length; i++)
            {
                EyouSoft.Model.CompanyStructure.SupplierContact scmodel = new EyouSoft.Model.CompanyStructure.SupplierContact();
                scmodel.CompanyId     = SiteUserInfo.CompanyID;
                scmodel.ContactName   = UserName[i];
                scmodel.JobTitle      = Userdate[i];
                scmodel.ContactTel    = Userphone[i];
                scmodel.ContactMobile = Usermobile[i];
                scmodel.QQ            = Userqq[i];
                scmodel.Email         = Usermail[i];
                scmodel.ContactFax    = Userfax[i];
                scmodel.SupplierType  = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.酒店;
                Hotelinfo.SupplierContact.Add(scmodel);
            }
            #endregion

            #region 价格信息
            Hotelinfo.RoomTypes = new List <EyouSoft.Model.SupplierStructure.SupplierHotelRoomTypeInfo>();
            string[] Chamber         = Utils.GetFormValues("Chamber");
            string[] SalaesPrices    = Utils.GetFormValues("SalaesPrices");
            string[] SettlementPrice = Utils.GetFormValues("SettlementPrice");
            string[] radiobtnValue   = Utils.GetFormValues("hd_rbtn");
            for (int j = 0; j < Chamber.Length; j++)
            {
                EyouSoft.Model.SupplierStructure.SupplierHotelRoomTypeInfo roomtype = new EyouSoft.Model.SupplierStructure.SupplierHotelRoomTypeInfo();
                roomtype.AccountingPrice = Utils.GetDecimal(SettlementPrice[j]);
                if (radiobtnValue[j] == "1")
                {
                    roomtype.IsBreakfast = true;
                }
                else
                {
                    roomtype.IsBreakfast = false;
                }
                roomtype.Name         = Chamber[j];
                roomtype.SellingPrice = Utils.GetDecimal(SalaesPrices[j]);
                Hotelinfo.RoomTypes.Add(roomtype);
            }
            #endregion

            //备注
            string HotelRemarks = Utils.GetFormValue("HotelRemarks");

            Hotelinfo.UnitName    = unionname;
            Hotelinfo.UnitAddress = TxtHotelAddress;
            Hotelinfo.Star        = (EyouSoft.Model.EnumType.SupplierStructure.HotelStar)Enum.Parse(typeof(EyouSoft.Model.EnumType.SupplierStructure.HotelStar), HotelStart.ToString());
            Hotelinfo.Introduce   = HotelIntroduction;
            Hotelinfo.TourGuide   = TourGuids;
            Hotelinfo.Remark      = HotelRemarks;
            Hotelinfo.IssueTime   = System.DateTime.Now;

            int res = 0;
            if (tid > 0)
            {
                //修改酒店信息
                res = HotelBll.UpdateHotelInfo(Hotelinfo);
            }
            else
            {
                //添加酒店信息
                res = HotelBll.InsertHotelInfo(Hotelinfo);
            }

            if (res > 0)
            {
                MessageBox.ResponseScript(this, string.Format(";alert('{0}');window.parent.Boxy.getIframeDialog('{1}').hide(); {2}", "保存成功!", Utils.GetQueryStringValue("iframeId"), tid > 0 ? "window.parent.location.reload();" : "window.parent.location.href='/SupplierControl/Hotels/HotelList.aspx';"));
            }
            else
            {
                MessageBox.ResponseScript(this, ";alert('保存失败!');");
            }
        }
예제 #10
0
        /// <summary>
        /// 获取酒店供应商信息集合(供应商基本信息,图片信息,房型信息。同行登录口适用)
        /// </summary>
        /// <param name="companyId">公司(专线)编号</param>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="pageIndex">页索引</param>
        /// <param name="recordCount">总记录数</param>
        /// <param name="info">查询信息</param>
        /// <returns></returns>
        public IList <EyouSoft.Model.SupplierStructure.SupplierHotelInfo> GetSiteHotels(int companyId, int pageSize, int pageIndex, ref int recordCount, EyouSoft.Model.SupplierStructure.SupplierHotelSearchInfo info)
        {
            IList <EyouSoft.Model.SupplierStructure.SupplierHotelInfo> items = new List <EyouSoft.Model.SupplierStructure.SupplierHotelInfo>();

            EyouSoft.Model.SupplierStructure.SupplierHotelInfo tmpModel = null;
            IEnumerable <XElement> xRows = null;
            XElement      xRoot          = null;
            StringBuilder cmdQuery       = new StringBuilder();
            string        tableName      = "tbl_CompanySupplier";
            string        primaryKey     = "Id";
            string        orderByString  = "Id DESC";
            StringBuilder fields         = new StringBuilder();

            #region fields

            fields.Append(" Id,ProvinceId,ProvinceName,CityId,CityName,UnitName,TradeNum,UnitAddress ");
            fields.Append(" ,(select Id,SupplierId,PicName,PicPath from tbl_SupplierAccessory where tbl_SupplierAccessory.SupplierId = tbl_CompanySupplier.Id for xml raw,root('root')) as HotelPics ");
            fields.Append(" ,(select RoomTypeId,SupplierId,Name,SellingPrice,AccountingPrice,IsBreakfast from tbl_SupplierHotelRoomType where tbl_SupplierHotelRoomType.SupplierId = tbl_CompanySupplier.Id for xml raw,root('root')) as HotelRoomTypes ");
            fields.Append(",(SELECT Star,Introduce FROM tbl_SupplierHotel AS B WHERE B.SupplierId=tbl_CompanySupplier.Id for xml raw,root('root')) AS Star");
            #endregion

            #region 拼接查询条件

            cmdQuery.AppendFormat(" CompanyId={0} AND IsDelete='0' AND SupplierType={1} ", companyId, (int)EyouSoft.Model.EnumType.CompanyStructure.SupplierType.酒店);
            info = info ?? new EyouSoft.Model.SupplierStructure.SupplierHotelSearchInfo();
            if (info.CityId.HasValue)
            {
                cmdQuery.AppendFormat(" AND CityId={0} ", info.CityId.Value);
            }
            if (!string.IsNullOrEmpty(info.Name))
            {
                cmdQuery.AppendFormat(" AND UnitName LIKE '%{0}%' ", info.Name);
            }
            if (info.ProvinceId.HasValue)
            {
                cmdQuery.AppendFormat(" AND ProvinceId={0} ", info.ProvinceId.Value);
            }
            if (info.Star.HasValue)
            {
                cmdQuery.AppendFormat(" AND EXISTS(SELECT 1 FROM tbl_SupplierHotel AS A WHERE A.SupplierId=tbl_CompanySupplier.Id AND Star={0}) ", (int)info.Star.Value);
            }

            #endregion

            using (IDataReader rdr = DbHelper.ExecuteReader(this._db, pageSize, pageIndex, ref recordCount, tableName, primaryKey, fields.ToString(), cmdQuery.ToString(), orderByString))
            {
                while (rdr.Read())
                {
                    tmpModel = new EyouSoft.Model.SupplierStructure.SupplierHotelInfo();

                    if (!rdr.IsDBNull(0))
                    {
                        tmpModel.Id = rdr.GetInt32(0);
                    }
                    if (!rdr.IsDBNull(1))
                    {
                        tmpModel.ProvinceId = rdr.GetInt32(1);
                    }
                    if (!rdr.IsDBNull(2))
                    {
                        tmpModel.ProvinceName = rdr.GetString(2);
                    }
                    if (!rdr.IsDBNull(3))
                    {
                        tmpModel.CityId = rdr.GetInt32(3);
                    }
                    if (!rdr.IsDBNull(4))
                    {
                        tmpModel.CityName = rdr.GetString(4);
                    }
                    if (!rdr.IsDBNull(5))
                    {
                        tmpModel.UnitName = rdr.GetString(5);
                    }
                    if (!rdr.IsDBNull(6))
                    {
                        tmpModel.TradeNum = rdr.GetInt32(6);
                    }
                    if (!rdr.IsDBNull(7))
                    {
                        tmpModel.UnitAddress = rdr.GetString(7);
                    }

                    if (!rdr.IsDBNull(8))
                    {
                        tmpModel.SupplierPic = new List <EyouSoft.Model.SupplierStructure.SupplierPic>();
                        EyouSoft.Model.SupplierStructure.SupplierPic spModel = null;
                        xRoot = XElement.Parse(rdr.GetString(8));
                        if (xRoot != null)
                        {
                            xRows = Utils.GetXElements(xRoot, "row");
                            if (xRows != null && xRows.Count() > 0)
                            {
                                foreach (var t in xRows)
                                {
                                    spModel = new EyouSoft.Model.SupplierStructure.SupplierPic();
                                    //Id,SupplierId,PicName,PicPath
                                    spModel.Id         = Utils.GetInt(Utils.GetXAttributeValue(t, "Id"));
                                    spModel.SupplierId = Utils.GetInt(Utils.GetXAttributeValue(t, "SupplierId"));
                                    spModel.PicName    = Utils.GetXAttributeValue(t, "PicName");
                                    spModel.PicPath    = Utils.GetXAttributeValue(t, "PicPath");

                                    tmpModel.SupplierPic.Add(spModel);
                                }
                            }
                        }
                    }
                    if (!rdr.IsDBNull(9))
                    {
                        tmpModel.RoomTypes = new List <Model.SupplierStructure.SupplierHotelRoomTypeInfo>();
                        Model.SupplierStructure.SupplierHotelRoomTypeInfo shrtModel = null;
                        xRoot = XElement.Parse(rdr.GetString(9));
                        if (xRoot != null)
                        {
                            xRows = Utils.GetXElements(xRoot, "row");
                            if (xRows != null && xRows.Count() > 0)
                            {
                                foreach (var t in xRows)
                                {
                                    shrtModel = new EyouSoft.Model.SupplierStructure.SupplierHotelRoomTypeInfo();
                                    //RoomTypeId,SupplierId,Name,SellingPrice,AccountingPrice,IsBreakfast
                                    shrtModel.RoomTypeId      = Utils.GetInt(Utils.GetXAttributeValue(t, "RoomTypeId"));
                                    shrtModel.Name            = Utils.GetXAttributeValue(t, "Name");
                                    shrtModel.SellingPrice    = Utils.GetDecimal(Utils.GetXAttributeValue(t, "SellingPrice"));
                                    shrtModel.AccountingPrice = Utils.GetDecimal(Utils.GetXAttributeValue(t, "AccountingPrice"));
                                    shrtModel.IsBreakfast     = (Utils.GetXAttributeValue(t, "IsBreakfast") == "1" || Utils.GetXAttributeValue(t, "IsBreakfast").ToLower() == "true") ? true : false;

                                    tmpModel.RoomTypes.Add(shrtModel);
                                }
                            }
                        }
                    }
                    if (!rdr.IsDBNull(10))
                    {
                        xRoot = XElement.Parse(rdr.GetString(10));
                        if (xRoot != null)
                        {
                            xRows = Utils.GetXElements(xRoot, "row");
                            if (xRows != null && xRows.Count() > 0)
                            {
                                foreach (var t in xRows)
                                {
                                    tmpModel.Star      = (EyouSoft.Model.EnumType.SupplierStructure.HotelStar)Utils.GetInt(Utils.GetXAttributeValue(t, "Star"));
                                    tmpModel.Introduce = Utils.GetXAttributeValue(t, "Introduce");

                                    break;
                                }
                            }
                        }
                    }


                    items.Add(tmpModel);
                }
            }

            return(items);
        }