Beispiel #1
0
        public string HotelLevel(int level)
        {
            EyouSoft.Model.CompanyStructure.HotelLevel HotelLevel = new EyouSoft.Model.CompanyStructure.HotelLevel();

            HotelLevel = (EyouSoft.Model.CompanyStructure.HotelLevel)Enum.Parse(typeof(EyouSoft.Model.CompanyStructure.HotelLevel), Enum.GetName(typeof(EyouSoft.Model.CompanyStructure.HotelLevel), level));

            int count = 0;

            switch (HotelLevel)
            {
            case EyouSoft.Model.CompanyStructure.HotelLevel.星以下: break;

            case EyouSoft.Model.CompanyStructure.HotelLevel.准三星: count = 3; break;

            case EyouSoft.Model.CompanyStructure.HotelLevel.星或同级: count = 3; break;

            case EyouSoft.Model.CompanyStructure.HotelLevel.准四星: count = 4; break;

            case EyouSoft.Model.CompanyStructure.HotelLevel.四星或同级: count = 4; break;

            case EyouSoft.Model.CompanyStructure.HotelLevel.五星或同级: count = 5; break;

            default: break;
            }

            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < count; i++)
            {
                sb.Append("<img src=\"" + this.ImageServerPath + "/images/UserPublicCenter/xing.gif\" width=\"16\" height=\"16\" style=\"margin-bottom: -3px;\" />");
            }
            if (count == 0)
            {
                sb.Append("三星以下");
            }
            if (sb.ToString() != "")
            {
                return(sb.ToString());
            }
            return("");
        }
Beispiel #2
0
        /// <summary>
        /// 分页获取供应商列表
        /// </summary>
        /// <param name="pageSize">每页显示的条数</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="recordCount">总记录数</param>
        /// <param name="CompanyName">供应商名称(用于模糊查询)</param>
        /// <param name="ProvinceId">省份编号</param>
        /// <param name="CityId">城市编号</param>
        /// <param name="CompanyLevel">酒店星级</param>
        /// <param name="CompanyTag">景区主题或者酒店周边环境</param>
        /// <param name="CompanyType">公司性质</param>
        /// <param name="remark">false:null和""不读取(true:不作条件)</param>
        /// <returns></returns>
        public virtual IList <EyouSoft.Model.CompanyStructure.SupplierInfo> GetList(int pageSize, int pageIndex, ref int recordCount, string CompanyName, int ProvinceId, int CityId, int CompanyLevel,
                                                                                    int CompanyTag, EyouSoft.Model.CompanyStructure.BusinessProperties?CompanyType, bool remark)
        {
            IList <EyouSoft.Model.CompanyStructure.SupplierInfo> list = new List <EyouSoft.Model.CompanyStructure.SupplierInfo>();
            string tableName     = "tbl_CompanyInfo";
            string fields        = "ID,CompanyName,CompanyLevel,CompanyBrand,CompanyAddress,Remark,ContactName,ContactTel,ContactFax,(select FieldValue from tbl_CompanyAttachInfo where CompanyId=tbl_CompanyInfo.id and FieldName='CompanyLogo') as CompanyImgThumb,WebSite,(SELECT IsEnabled FROM tbl_CompanyPayService WHERE CompanyId=tbl_CompanyInfo.Id AND ServiceId=2) AS IsHighShop,ProvinceId,CityId,ShortRemark,(select TagId,TagName from tbl_CompanyTag where CompanyId=tbl_CompanyInfo.id for xml path,root('root')) AS CompanyTag";
            string primaryKey    = "ID";
            string orderByString = "(case when(select count(*) from tbl_CompanyPayService where companyid=tbl_CompanyInfo.id and ServiceId=2 and isEnabled='1')>0 then 1 else 0 end) desc,IssueTime DESC";
            Dictionary <string, string> CompanyTagList = new Dictionary <string, string>();

            #region 生成查询条件
            StringBuilder strWhere = new StringBuilder(" IsCheck='1' AND IsDeleted='0'And len(Remark)>0 And CompanyType in(2,3,4,5,6)");
            if (!remark)
            {
                strWhere.Append(" AND ISNULL(Remark,'') <> ''");
            }
            if (!string.IsNullOrEmpty(CompanyName))
            {
                strWhere.AppendFormat(" AND CompanyName like'%{0}%' ", CompanyName);
            }
            if (ProvinceId > 0)
            {
                strWhere.AppendFormat(" AND ProvinceId={0} ", ProvinceId);
            }
            if (CityId > 0)
            {
                strWhere.AppendFormat(" AND CityId={0} ", CityId);
            }
            if (CompanyLevel > -1)
            {
                EyouSoft.Model.CompanyStructure.HotelLevel hotelLevel = (EyouSoft.Model.CompanyStructure.HotelLevel)CompanyLevel;
                if (hotelLevel == EyouSoft.Model.CompanyStructure.HotelLevel.星或同级 ||
                    hotelLevel == EyouSoft.Model.CompanyStructure.HotelLevel.准三星)
                {
                    strWhere.AppendFormat(" AND (CompanyLevel={0} or CompanyLevel={1})", (int)EyouSoft.Model.CompanyStructure.HotelLevel.星或同级, (int)EyouSoft.Model.CompanyStructure.HotelLevel.准三星);
                }
                else if (hotelLevel == EyouSoft.Model.CompanyStructure.HotelLevel.四星或同级 ||
                         hotelLevel == EyouSoft.Model.CompanyStructure.HotelLevel.准四星)
                {
                    strWhere.AppendFormat(" AND (CompanyLevel={0} or CompanyLevel={1})", (int)EyouSoft.Model.CompanyStructure.HotelLevel.四星或同级, (int)EyouSoft.Model.CompanyStructure.HotelLevel.准四星);
                }
                else
                {
                    strWhere.AppendFormat(" AND CompanyLevel={0} ", CompanyLevel);
                }
            }
            if (CompanyTag > 0 && CompanyType != null)
            {
                int classId = -1;
                if (CompanyType.Value == EyouSoft.Model.CompanyStructure.BusinessProperties.酒店)
                {
                    classId = (int)EyouSoft.Model.SystemStructure.SysFieldType.周边环境;
                }
                if (CompanyType.Value == EyouSoft.Model.CompanyStructure.BusinessProperties.景区)
                {
                    classId = (int)EyouSoft.Model.SystemStructure.SysFieldType.景点主题;
                }
                strWhere.AppendFormat(" AND id in(select companyId from tbl_CompanyTag Where TagId={0} and classId={1}) ", CompanyTag, classId);
            }
            if (CompanyType != null)
            {
                strWhere.AppendFormat(" AND CompanyType={0} ", (int)CompanyType.Value);
            }
            #endregion

            using (IDataReader dr = DbHelper.ExecuteReader(this._database, pageSize, pageIndex, ref recordCount, tableName, primaryKey, fields, strWhere.ToString(), orderByString))
            {
                while (dr.Read())
                {
                    EyouSoft.Model.CompanyStructure.SupplierInfo model = new EyouSoft.Model.CompanyStructure.SupplierInfo();
                    model.ID          = dr.GetString(0);
                    model.CompanyName = dr.IsDBNull(1) ? string.Empty : dr.GetString(1);
                    if (!dr.IsDBNull(2))
                    {
                        model.CompanyLevel = int.Parse(dr[2].ToString());
                    }
                    model.CompanyBrand            = dr.IsDBNull(3) ? string.Empty : dr.GetString(3);
                    model.CompanyAddress          = dr.IsDBNull(4) ? string.Empty : dr.GetString(4);
                    model.Remark                  = dr.IsDBNull(5) ? string.Empty : dr.GetString(5);
                    model.ContactInfo.ContactName = dr.IsDBNull(6) ? string.Empty : dr.GetString(6);
                    model.ContactInfo.Tel         = dr.IsDBNull(7) ? string.Empty : dr.GetString(7);
                    model.ContactInfo.Fax         = dr.IsDBNull(8) ? string.Empty : dr.GetString(8);
                    model.CompanyImgThumb         = dr.IsDBNull(9) ? string.Empty : dr.GetString(9);
                    model.WebSite                 = dr.IsDBNull(10) ? string.Empty : dr.GetString(10);
                    if (!dr.IsDBNull(11) && dr.GetString(11) == "1")
                    {
                        model.State.CompanyService.SetServiceItem(
                            new EyouSoft.Model.CompanyStructure.CompanyServiceItem()
                        {
                            IsEnabled = true,
                            Service   = EyouSoft.Model.CompanyStructure.SysService.HighShop
                        });
                    }
                    else
                    {
                        model.State.CompanyService.SetServiceItem(
                            new EyouSoft.Model.CompanyStructure.CompanyServiceItem()
                        {
                            IsEnabled = false,
                            Service   = EyouSoft.Model.CompanyStructure.SysService.HighShop
                        });
                    }
                    model.ProvinceId  = dr.GetInt32(12);
                    model.CityId      = dr.GetInt32(13);
                    model.ShortRemark = dr.IsDBNull(14) ? string.Empty : dr.GetString(14);
                    if (CompanyType.HasValue && CompanyType.Value == EyouSoft.Model.CompanyStructure.BusinessProperties.酒店 && !dr.IsDBNull(15))
                    {
                        CompanyTagList.Add(model.ID, dr.GetString(15));
                    }
                    list.Add(model);
                    model = null;
                }
                for (int i = 0; i < list.Count; i++)
                {
                    if (CompanyTagList.ContainsKey(list[i].ID))
                    {
                        IList <EyouSoft.Model.CompanyStructure.CompanyTag> taglist = new List <EyouSoft.Model.CompanyStructure.CompanyTag>();
                        System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
                        xmlDoc.LoadXml(CompanyTagList[list[i].ID]);
                        System.Xml.XmlNodeList TagList     = xmlDoc.GetElementsByTagName("TagId");
                        System.Xml.XmlNodeList TagNameList = xmlDoc.GetElementsByTagName("TagName");
                        for (int j = 0; j < TagList.Count; j++)
                        {
                            EyouSoft.Model.CompanyStructure.CompanyTag tag = new EyouSoft.Model.CompanyStructure.CompanyTag();
                            tag.FieldId   = Convert.ToInt32(TagList[j].FirstChild.Value);
                            tag.FieldName = TagNameList[j].FirstChild.Value;
                            taglist.Add(tag);
                        }
                        list[i].CompanyTag = taglist;
                    }
                }
            }
            return(list);
        }
Beispiel #3
0
        /// <summary>
        /// 供应商单位信息保存
        /// </summary>
        private void SupplyInfoSave()
        {
            if (!IsCompanyCheck)
            {
                Response.Clear();
                Response.Write("[{isSuccess:false,Message:'对不起,新注册用户还未审核,没有权限进入供应商网店管理!'}]");
                Response.End();
            }
            bool   isTrue  = false;
            string webSite = string.Empty;

            EyouSoft.IBLL.CompanyStructure.ISupplierInfo       Ibll  = EyouSoft.BLL.CompanyStructure.SupplierInfo.CreateInstance();
            EyouSoft.Model.CompanyStructure.SupplierInfo       model = new EyouSoft.Model.CompanyStructure.SupplierInfo();
            IList <EyouSoft.Model.CompanyStructure.CompanyTag> lists = new List <EyouSoft.Model.CompanyStructure.CompanyTag>();

            EyouSoft.Model.CompanyStructure.CompanyRole RoleModel = new EyouSoft.Model.CompanyStructure.CompanyRole();
            model.ID             = CompanyID;
            model.CompanyName    = this.SiteUserInfo.CompanyName;//Utils.GetFormValue("MyOwenerShop_CompanyName");
            model.CompanyAddress = Utils.GetFormValue("MyOwenerShop_ConnectAddress");
            string Remark = Server.UrlDecode(Request.Form["MyOwenerShop_Remark"]);

            model.Remark = Utils.EditInputText(Server.UrlDecode(Remark.Substring(0, Remark.Length > 4000 ? 4000 : Remark.Length)));

            model.ContactInfo.Fax         = Utils.GetFormValue("MyOwenerShop_ConnectFax");
            model.ContactInfo.Tel         = Utils.GetFormValue("MyOwenerShop_ConnectTel");
            model.ContactInfo.Email       = Utils.GetFormValue("MyOwenerShop_ConnectEmail");
            model.ContactInfo.Mobile      = Utils.GetFormValue("MyOwenerShop_Mobile");
            model.ContactInfo.ContactName = Utils.GetFormValue("MyOwenerShop_ConnectName");
            model.ProvinceId = Utils.GetInt(Request.Form["ctl00$ContentPlaceHolder1$ProvinceAndCityList1$ddl_ProvinceList"]);
            model.CityId     = Utils.GetInt(Request.Form["ctl00$ContentPlaceHolder1$ProvinceAndCityList1$ddl_CityList"]);
            webSite          = Utils.GetFormValue("MyOwenerShop_WebSite");
            if (webSite != "")
            {
                model.WebSite = (webSite != "" && webSite.Contains("http://")) ? webSite : "http://" + webSite;
            }
            else
            {
                model.WebSite = webSite;
            }
            model.CompanyImgThumb = Utils.GetFormValue("ctl00$ContentPlaceHolder1$Upload_LogoImg$hidFileName");

            model.ShortRemark = Utils.GetFormValue("MyOwenerShop_ShortRemark");
            if (string.IsNullOrEmpty(model.CompanyImgThumb))
            {
                model.CompanyImgThumb = Utils.GetFormValue("hidLogoImg");
            }
            if (companyType == EyouSoft.Model.CompanyStructure.CompanyType.酒店)
            {
                EyouSoft.Model.CompanyStructure.CompanyTag sysModel;
                string[] strCompanyTag = Utils.GetFormValues("cbCompanyTag");
                for (int i = 0; i < strCompanyTag.Length; i++)
                {
                    sysModel           = new EyouSoft.Model.CompanyStructure.CompanyTag();
                    sysModel.FieldId   = Utils.GetInt(strCompanyTag[i]);
                    sysModel.FieldName = Utils.GetFormValue("hidCompanyTag" + strCompanyTag[i]);
                    lists.Add(sysModel);
                    sysModel = null;
                }
                EyouSoft.Model.CompanyStructure.HotelLevel level = (EyouSoft.Model.CompanyStructure.HotelLevel)Enum.Parse(typeof(EyouSoft.Model.CompanyStructure.HotelLevel), Utils.GetFormValue("ctl00$ContentPlaceHolder1$rbl_HotelLevel"));
                model.CompanyLevel = (int)level;
                model.CompanyTag   = lists;
            }
            isTrue = Ibll.Update(model);
            Ibll   = null;
            model  = null;
            lists  = null;
            if (isTrue)
            {
                Response.Clear();
                Response.Write("1");
                Response.End();
            }
        }