示例#1
0
        public void ReloadConnectWayListCache()
        {
            string key = GlobalKey.CONNECTWAY_LIST;

            MangaCache.Remove(key);
            GetList(true);
        }
示例#2
0
        public void ReloadIbuytimeListCache()
        {
            string key = GlobalKey.IBUYTIME_LIST;

            MangaCache.Remove(key);
            GetList(true);
        }
示例#3
0
        /// <summary>
        /// 重新加载省份列表缓存
        /// </summary>
        public void ReloadProvinceListCache()
        {
            string key = GlobalKey.PROVINCE_LIST;

            MangaCache.Remove(key);
            GetProvinceList(true);
        }
示例#4
0
        public void ReloadInfoTypeListCache()
        {
            string key = GlobalKey.INFOTYPE_LIST;

            MangaCache.Remove(key);
            GetList(true);
        }
示例#5
0
        /// <summary>
        /// 更新指定公司的客户线索缓存
        /// </summary>
        /// <param name="corpid"></param>
        public void ReloadCustomerListByCorporationCache(int corpid)
        {
            string key = GlobalKey.CUSTOMER_LIST + "_corp" + corpid;

            MangaCache.Remove(key);
            GetCustomerListByCorporation(corpid, true);
        }
示例#6
0
文件: Cars.cs 项目: shaohaiou/comopp
        public void ReloadCarModelListCache()
        {
            string key = GlobalKey.CARMODEL_LIST;

            MangaCache.Remove(key);
            GetCarModelList(true);
        }
示例#7
0
文件: Cars.cs 项目: shaohaiou/comopp
        public void ReloadCarSeriesListCache()
        {
            string key = GlobalKey.CARSERIES_LIST;

            MangaCache.Remove(key);
            GetCarSeriesList(true);
        }
示例#8
0
        public void ReloadTracktagListCache()
        {
            string key = GlobalKey.TRACKTAG_LIST;

            MangaCache.Remove(key);
            GetList(true);
        }
示例#9
0
        /// <summary>
        /// 重新加载城市列表缓存
        /// </summary>
        public void ReloadCityListCache()
        {
            string key = GlobalKey.CITY_LIST;

            MangaCache.Remove(key);
            GetCityList(true);
        }
示例#10
0
        public void ReloadCustomerLevelListCache()
        {
            string key = GlobalKey.CUSTOMERLEVEL_LIST;

            MangaCache.Remove(key);
            GetList(true);
        }
示例#11
0
        public void ReloadModuleListCache()
        {
            string key = GlobalKey.MODULE_LIST;

            MangaCache.Remove(key);
            GetList(true);
        }
示例#12
0
文件: Talks.cs 项目: shaohaiou/comopp
        public void ReloadTalkListCache()
        {
            string key = GlobalKey.TALK_LIST;

            MangaCache.Remove(key);
            GetList(true);
        }
示例#13
0
        public void ReloadGiveupCauseListCache()
        {
            string key = GlobalKey.GIVEUPCAUSE_LIST;

            MangaCache.Remove(key);
            GetList(true);
        }
示例#14
0
        public void ReloadNoticeListCache()
        {
            string key = GlobalKey.NOTICE_LIST;

            MangaCache.Remove(key);
            GetList(true);
        }
示例#15
0
        public void ReloadPaymentWayListCache()
        {
            string key = GlobalKey.PAYMENTWAY_LIST;

            MangaCache.Remove(key);
            GetList(true);
        }
示例#16
0
文件: Cars.cs 项目: shaohaiou/comopp
        public void ReloadCarBrandListCache()
        {
            string key = GlobalKey.CARBRAND_LIST;

            MangaCache.Remove(key);
            GetCarBrandList(true);
        }
示例#17
0
        public void ReloadInfoSourceListCache()
        {
            string key = GlobalKey.INFOSOURCE_LIST;

            MangaCache.Remove(key);
            GetList(true);
        }
示例#18
0
        public void ReloadPowerGroupListCache()
        {
            string key = GlobalKey.POWERGROUP_LIST;

            MangaCache.Remove(key);
            GetList(true);
        }
示例#19
0
        /// <summary>
        /// 重新加载地区列表缓存
        /// </summary>
        public void ReloadDistrictListCache()
        {
            string key = GlobalKey.DISTRICT_LIST;

            MangaCache.Remove(key);
            GetDistrictList(true);
        }
示例#20
0
        public void ReloadCorporationListCache()
        {
            string key = GlobalKey.CORPORATION_LIST;

            MangaCache.Remove(key);
            GetList(true);
        }
示例#21
0
        /// <summary>
        /// 加载配置文件,并且封装配置信息
        /// </summary>
        /// <returns></returns>
        public static CommConfig GetConfig()
        {
            CommConfig config = MangaCache.GetLocal(GlobalKey.COMMCONFIG) as CommConfig;//尝试从缓存获取配置信息类

            if (config == null)
            {
                //当缓存中不存在时建立
                string      path = GetFilePath();
                XmlDocument doc  = new XmlDocument();
                doc.Load(path);
                config = new CommConfig(doc);
                MangaCache.MaxLocalWithFile(GlobalKey.COMMCONFIG, config, path);
            }
            return(config);
        }
示例#22
0
        public static void Write(EventLogEntry entry)
        {
            try
            {
                if (entry.ApplicationType != ApplicationType.NoSet && (entry.EventType == EventType.Information || entry.EventType == EventType.Debug))
                {
                    entry.Uniquekey = "";
                    CommConfig config = CommConfig.GetConfig();
                    CommonDataProvider.Instance().WriteEventLogEntry(entry);
                    return;
                }
                string key = string.Empty;
                if (entry.EventType == EventType.Warning)
                {
                    key = GlobalKey.EVENTLOG_KEY + "_" + string.Format("{0}-{1}-{2}-{3}-{4}", entry.ApplicationID, entry.EntryID, entry.EventID, (int)entry.EventType, entry.Message.GetHashCode());
                }
                else if (entry.EventType == EventType.Error && entry.Ex != null)
                {
                    key           = GlobalKey.EVENTLOG_KEY + "_" + string.Format("{0}-{1}-{2}-{3}-{4}-{5}", entry.ApplicationID, entry.EntryID, entry.EventID, (int)entry.EventType, entry.Ex.StackTrace.GetHashCode(), entry.Ex.Message.GetHashCode());
                    entry.Message = entry.Ex.Message + "-" + entry.Ex.StackTrace + "\r\n" + entry.Message;
                }
                else
                {
                    key = GlobalKey.EVENTLOG_KEY + "_" + string.Format("{0}-{1}", (int)entry.EventType, entry.Message.GetHashCode());
                }

                EventLogEntry oldentry = MangaCache.Get(key) as EventLogEntry;

                if (oldentry != null)
                {
                    oldentry.PCount++;
                    oldentry.LastUpdateTime = DateTime.Now;
                }
                else
                {
                    DateTime time = DateTime.Now;
                    entry.PCount         = 1;
                    entry.Uniquekey      = key;
                    entry.AddTime        = time;
                    entry.LastUpdateTime = time;
                    CommConfig config = CommConfig.GetConfig();
                    CommonDataProvider.Instance().WriteEventLogEntry(entry);
                    entry.PCount = 0;
                    MangaCache.Add(key, entry, 30, TimeSpan.Zero, System.Web.Caching.CacheItemPriority.AboveNormal, new CacheItemRemovedCallback(RemovedCallback));
                }
            }
            catch { }
        }
示例#23
0
        public List <PowerGroupInfo> GetList(bool fromCache = false)
        {
            if (!fromCache)
            {
                return(CommonDataProvider.Instance().GetPowerGroupList().OrderBy(l => l.Sort).ToList());
            }

            string key = GlobalKey.POWERGROUP_LIST;
            List <PowerGroupInfo> list = MangaCache.Get(key) as List <PowerGroupInfo>;

            if (list == null)
            {
                list = CommonDataProvider.Instance().GetPowerGroupList().OrderBy(l => l.Sort).ToList();
                MangaCache.Max(key, list);
            }
            return(list);
        }
示例#24
0
文件: Talks.cs 项目: shaohaiou/comopp
        public List <TalkInfo> GetList(bool fromCache = false)
        {
            if (!fromCache)
            {
                return(CommonDataProvider.Instance().GetTalkList());
            }

            string          key  = GlobalKey.TALK_LIST;
            List <TalkInfo> list = MangaCache.Get(key) as List <TalkInfo>;

            if (list == null)
            {
                list = CommonDataProvider.Instance().GetTalkList();
                MangaCache.Max(key, list);
            }
            return(list);
        }
示例#25
0
        public List <GiveupCauseInfo> GetList(bool fromCache = false)
        {
            if (!fromCache)
            {
                return(CommonDataProvider.Instance().GetGiveupCauseList());
            }

            string key = GlobalKey.GIVEUPCAUSE_LIST;
            List <GiveupCauseInfo> list = MangaCache.Get(key) as List <GiveupCauseInfo>;

            if (list == null)
            {
                list = CommonDataProvider.Instance().GetGiveupCauseList();
                MangaCache.Max(key, list);
            }
            return(list);
        }
示例#26
0
        public List <CorporationInfo> GetList(bool fromCache = false)
        {
            if (!fromCache)
            {
                return(CommonDataProvider.Instance().GetCorporationList().OrderBy(l => l.Sort).ToList());
            }

            string key = GlobalKey.CORPORATION_LIST;
            List <CorporationInfo> list = MangaCache.Get(key) as List <CorporationInfo>;

            if (list == null)
            {
                list = CommonDataProvider.Instance().GetCorporationList().OrderBy(l => l.Sort).ToList();
                MangaCache.Max(key, list);
            }
            return(list);
        }
示例#27
0
        public List <PaymentWayInfo> GetList(bool fromCache = false)
        {
            if (!fromCache)
            {
                return(CommonDataProvider.Instance().GetPaymentWayList());
            }

            string key = GlobalKey.PAYMENTWAY_LIST;
            List <PaymentWayInfo> list = MangaCache.Get(key) as List <PaymentWayInfo>;

            if (list == null)
            {
                list = CommonDataProvider.Instance().GetPaymentWayList();
                MangaCache.Max(key, list);
            }
            return(list);
        }
示例#28
0
        public List <ModuleInfo> GetList(bool fromCache = false)
        {
            if (!fromCache)
            {
                return(CommonDataProvider.Instance().GetModuleList().OrderBy(l => l.Sort).ToList());
            }

            string            key  = GlobalKey.MODULE_LIST;
            List <ModuleInfo> list = MangaCache.Get(key) as List <ModuleInfo>;

            if (list == null)
            {
                list = CommonDataProvider.Instance().GetModuleList().OrderBy(l => l.Sort).ToList();
                MangaCache.Max(key, list);
            }
            return(list);
        }
示例#29
0
        public List <CustomerLevelInfo> GetList(bool fromCache = false)
        {
            if (!fromCache)
            {
                return(CommonDataProvider.Instance().GetCustomerLevelList().OrderBy(l => l.Sort).ToList());
            }

            string key = GlobalKey.CUSTOMERLEVEL_LIST;
            List <CustomerLevelInfo> list = MangaCache.Get(key) as List <CustomerLevelInfo>;

            if (list == null)
            {
                list = CommonDataProvider.Instance().GetCustomerLevelList().OrderBy(l => l.Sort).ToList();
                MangaCache.Max(key, list);
            }
            return(list);
        }
示例#30
0
文件: Cars.cs 项目: shaohaiou/comopp
        public List <CarBrandInfo> GetCarBrandList(bool fromCache = false)
        {
            if (!fromCache)
            {
                return(CommonDataProvider.Instance().GetCarBrandList().OrderBy(l => l.NameIndex).ThenBy(l => l.Name).ToList());
            }

            string key = GlobalKey.CARBRAND_LIST;
            List <CarBrandInfo> list = MangaCache.Get(key) as List <CarBrandInfo>;

            if (list == null)
            {
                list = CommonDataProvider.Instance().GetCarBrandList().OrderBy(l => l.NameIndex).ThenBy(l => l.Name).ToList();
                MangaCache.Max(key, list);
            }
            return(list);
        }