Beispiel #1
0
        /// <summary>
        /// 初始化
        /// </summary>
        private void PageInit()
        {
            pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1);
            int?ProvinceId = Utils.GetIntNull(Utils.GetQueryStringValue("sltProvince"));
            int?CityId     = Utils.GetIntNull(Utils.GetQueryStringValue("sltCity"));
            int?CountryId  = Utils.GetIntNull(Utils.GetQueryStringValue("sltCountry"));

            EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType?selCrmType = (EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType?)Utils.GetEnumValueNull(typeof(EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType), Utils.GetQueryStringValue("selCrmType"));
            EyouSoft.Model.SmsStructure.MLBDaoRuLxrSearchInfo  search     = new EyouSoft.Model.SmsStructure.MLBDaoRuLxrSearchInfo();
            search.CityId     = CityId;
            search.CountryId  = CountryId;
            search.ProvinceId = ProvinceId;
            search.DanWeiType = selCrmType;
            var list = new EyouSoft.BLL.SmsStructure.BDaoRuLxr().GetLxrs(CurrentUserCompanyID, pageSize, pageIndex, ref recordCount, search);

            if (list == null || list.Count == 0)
            {
                this.ExporPageInfoSelect1.Visible = false;
                this.repList.EmptyText            = "<tr><td colspan=\"5\" align=\"center\">暂无相关记录!</td></tr>";
            }
            else
            {
                this.repList.DataSource = list;
                this.repList.DataBind();
                BindPage();
            }
        }
Beispiel #2
0
        /// <summary>
        /// 获取导入客户管理号码集合
        /// </summary>
        /// <param name="companyId">公司编号</param>
        /// <param name="pageSize">页记录数</param>
        /// <param name="pageIndex">页索引</param>
        /// <param name="recordCount">总记录数</param>
        /// <param name="searchInfo">查询信息</param>
        /// <returns></returns>
        public IList<EyouSoft.Model.SmsStructure.MLBDaoRuLxrInfo> GetLxrs(string companyId, int pageSize, int pageIndex, ref int recordCount, EyouSoft.Model.SmsStructure.MLBDaoRuLxrSearchInfo searchInfo)
        {
            if (string.IsNullOrEmpty(companyId)) return null;

            var items = dal.GetLxrs(companyId, pageSize, pageIndex, ref recordCount, searchInfo);

            if (items != null && items.Count > 0)
            {
                var citybll = new EyouSoft.BLL.ComStructure.BComCity();
                foreach (var item in items)
                {
                    item.CPCD = citybll.GetCPCD(companyId, item.CountryId, item.ProvinceId, item.CityId, item.DistrictId);
                }
            }
            return items;
        }
Beispiel #3
0
        /// <summary>
        /// 获取导入客户管理号码集合
        /// </summary>
        /// <param name="companyId">公司编号</param>
        /// <param name="pageSize">页记录数</param>
        /// <param name="pageIndex">页索引</param>
        /// <param name="recordCount">总记录数</param>
        /// <param name="searchInfo">查询信息</param>
        /// <returns></returns>
        public IList <EyouSoft.Model.SmsStructure.MLBDaoRuLxrInfo> GetLxrs(string companyId, int pageSize, int pageIndex, ref int recordCount, EyouSoft.Model.SmsStructure.MLBDaoRuLxrSearchInfo searchInfo)
        {
            IList <EyouSoft.Model.SmsStructure.MLBDaoRuLxrInfo> items = new List <EyouSoft.Model.SmsStructure.MLBDaoRuLxrInfo>();

            string        tableName     = "view_Crm_Source_Sms_Lxr";
            string        fields        = "CountryId,ProvinceId,CityId,DistrictId,DanWeiName,LxrName,DanWeiType,MingXiType,Mobile";
            string        orderByString = "IssueTime DESC";
            StringBuilder query         = new StringBuilder();

            #region SQL
            query.AppendFormat(" CompanyId='{0}' ", companyId);

            if (searchInfo != null)
            {
                if (searchInfo.CityId.HasValue)
                {
                    query.AppendFormat(" AND CityId={0} ", searchInfo.CityId.Value);
                }
                if (searchInfo.CountryId.HasValue)
                {
                    query.AppendFormat(" AND CountryId={0} ", searchInfo.CountryId.Value);
                }
                if (searchInfo.DanWeiType.HasValue)
                {
                    int _danWeiType = -1;
                    int _mingXiType = -1;
                    switch (searchInfo.DanWeiType.Value)
                    {
                    case EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.餐馆:
                        _danWeiType = 1;
                        _mingXiType = (int)EyouSoft.Model.EnumType.SourceStructure.SourceType.餐馆;
                        break;

                    case EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.车队:
                        _danWeiType = 1;
                        _mingXiType = (int)EyouSoft.Model.EnumType.SourceStructure.SourceType.车队;
                        break;

                    case EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.单位直客:
                        _danWeiType = 0;
                        _mingXiType = (int)EyouSoft.Model.EnumType.CrmStructure.CrmType.单位直客;
                        break;

                    case EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.地接社:
                        _danWeiType = 1;
                        _mingXiType = (int)EyouSoft.Model.EnumType.SourceStructure.SourceType.地接社;
                        break;

                    case EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.个人会员:
                        _danWeiType = 0;
                        _mingXiType = (int)EyouSoft.Model.EnumType.CrmStructure.CrmType.个人会员;
                        break;

                    case EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.购物:
                        _danWeiType = 1;
                        _mingXiType = (int)EyouSoft.Model.EnumType.SourceStructure.SourceType.购物;
                        break;

                    case EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.景点:
                        _danWeiType = 1;
                        _mingXiType = (int)EyouSoft.Model.EnumType.SourceStructure.SourceType.景点;
                        break;

                    case EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.酒店:
                        _danWeiType = 1;
                        _mingXiType = (int)EyouSoft.Model.EnumType.SourceStructure.SourceType.酒店;
                        break;

                    case EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.票务:
                        _danWeiType = 1;
                        _mingXiType = (int)EyouSoft.Model.EnumType.SourceStructure.SourceType.票务;
                        break;

                    case EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.其他:
                        _danWeiType = 1;
                        _mingXiType = (int)EyouSoft.Model.EnumType.SourceStructure.SourceType.其他;
                        break;

                    case EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.行客户:
                        _danWeiType = 0;
                        _mingXiType = (int)EyouSoft.Model.EnumType.CrmStructure.CrmType.行客户;
                        break;

                    case EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.游轮:
                        _danWeiType = 1;
                        _mingXiType = (int)EyouSoft.Model.EnumType.SourceStructure.SourceType.游轮;
                        break;

                    default: break;

                    case EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.系统用户:
                        _danWeiType = 2;
                        break;
                    }

                    if (_danWeiType > -1)
                    {
                        query.AppendFormat(" AND DanWeiType={0} ", _danWeiType);
                    }

                    if (_mingXiType > -1)
                    {
                        query.AppendFormat(" AND MingXiType={0} ", _mingXiType);
                    }
                }
                if (searchInfo.DistrictId.HasValue)
                {
                    query.AppendFormat(" AND DistrictId={0} ", searchInfo.DistrictId.Value);
                }
                if (searchInfo.ProvinceId.HasValue)
                {
                    query.AppendFormat(" AND ProvinceId={0} ", searchInfo.ProvinceId.Value);
                }
            }

            #endregion

            using (IDataReader rdr = DbHelper.ExecuteReader(_db, pageSize, pageIndex, ref recordCount, tableName, string.Empty, fields, query.ToString(), orderByString))
            {
                while (rdr.Read())
                {
                    EyouSoft.Model.SmsStructure.MLBDaoRuLxrInfo item = new EyouSoft.Model.SmsStructure.MLBDaoRuLxrInfo();

                    item.CityId     = rdr.GetInt32(rdr.GetOrdinal("CityId"));
                    item.CountryId  = rdr.GetInt32(rdr.GetOrdinal("CountryId"));
                    item.CPCD       = null;
                    item.DanWeiName = rdr["DanWeiName"].ToString();
                    item.DanWeiType = EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.系统用户;
                    item.DistrictId = rdr.GetInt32(rdr.GetOrdinal("DistrictId"));
                    item.LxrName    = rdr["LxrName"].ToString();
                    item.Mobile     = rdr["Mobile"].ToString().Trim();
                    item.ProvinceId = rdr.GetInt32(rdr.GetOrdinal("ProvinceId"));

                    //类型转换
                    int _danWeiType = rdr.GetInt32(rdr.GetOrdinal("DanWeiType"));
                    int _mingXiType = rdr.GetByte(rdr.GetOrdinal("MingXiType"));

                    if (_danWeiType == 0)
                    {
                        EyouSoft.Model.EnumType.CrmStructure.CrmType crmType = (EyouSoft.Model.EnumType.CrmStructure.CrmType)_mingXiType;

                        switch (crmType)
                        {
                        case EyouSoft.Model.EnumType.CrmStructure.CrmType.单位直客: item.DanWeiType = EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.单位直客; break;

                        case EyouSoft.Model.EnumType.CrmStructure.CrmType.个人会员: item.DanWeiType = EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.个人会员; break;

                        case EyouSoft.Model.EnumType.CrmStructure.CrmType.行客户: item.DanWeiType = EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.行客户; break;
                        }
                    }
                    else if (_danWeiType == 1)
                    {
                        EyouSoft.Model.EnumType.SourceStructure.SourceType sourceType = (EyouSoft.Model.EnumType.SourceStructure.SourceType)_mingXiType;

                        switch (sourceType)
                        {
                        case EyouSoft.Model.EnumType.SourceStructure.SourceType.餐馆: item.DanWeiType = EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.餐馆; break;

                        case EyouSoft.Model.EnumType.SourceStructure.SourceType.车队: item.DanWeiType = EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.车队; break;

                        case EyouSoft.Model.EnumType.SourceStructure.SourceType.地接社: item.DanWeiType = EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.地接社; break;

                        case EyouSoft.Model.EnumType.SourceStructure.SourceType.购物: item.DanWeiType = EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.购物; break;

                        case EyouSoft.Model.EnumType.SourceStructure.SourceType.景点: item.DanWeiType = EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.景点; break;

                        case EyouSoft.Model.EnumType.SourceStructure.SourceType.酒店: item.DanWeiType = EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.酒店; break;

                        case EyouSoft.Model.EnumType.SourceStructure.SourceType.票务: item.DanWeiType = EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.票务; break;

                        case EyouSoft.Model.EnumType.SourceStructure.SourceType.其他: item.DanWeiType = EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.其他; break;

                        case EyouSoft.Model.EnumType.SourceStructure.SourceType.游轮: item.DanWeiType = EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.游轮; break;
                        }
                    }
                    else if (_danWeiType == 2)
                    {
                        item.DanWeiType = EyouSoft.Model.EnumType.SmsStructure.DaoRuKeHuType.系统用户;
                    }

                    items.Add(item);
                }
            }

            return(items);
        }