예제 #1
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);
        }
예제 #2
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);
        }
예제 #3
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);
        }
예제 #4
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);
        }
예제 #5
0
파일: Modules.cs 프로젝트: shaohaiou/comopp
        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);
        }
예제 #6
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);
        }
예제 #7
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);
        }
예제 #8
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);
        }
예제 #9
0
        public List <CustomerConnectRecordInfo> GetListByCustomerID(int cid, bool fromCache = false)
        {
            if (!fromCache)
            {
                return(CommonDataProvider.Instance().GetCustomerConnectRecordListByCustomerID(cid));
            }

            string key = GlobalKey.CUSTOMERCONNECTRECORD_LIST + "_c" + cid;
            List <CustomerConnectRecordInfo> list = MangaCache.Get(key) as List <CustomerConnectRecordInfo>;

            if (list == null)
            {
                list = CommonDataProvider.Instance().GetCustomerConnectRecordListByCustomerID(cid);
                MangaCache.Max(key, list);
            }

            return(list);
        }
예제 #10
0
        public List <CustomerInfo> GetCustomerListByCorporation(int cid, bool fromCache = false)
        {
            if (!fromCache)
            {
                return(CommonDataProvider.Instance().GetCustomerListByCorporation(cid));
            }

            string key = GlobalKey.CUSTOMER_LIST + "_corp" + cid;
            List <CustomerInfo> list = MangaCache.Get(key) as List <CustomerInfo>;

            if (list == null)
            {
                list = CommonDataProvider.Instance().GetCustomerListByCorporation(cid);
                MangaCache.Max(key, list);
            }

            return(list);
        }
예제 #11
0
        /// <summary>
        /// 从配置文件加载数据库访问提供者类
        /// </summary>
        /// <param name="providerName">提供者名</param>
        /// <returns>漫画提供者</returns>
        public static CommonDataProvider Instance(string providerName)
        {
            string             cachekey = GlobalKey.PROVIDER + "_" + providerName;
            CommonDataProvider objType  = MangaCache.GetLocal(cachekey) as CommonDataProvider;//从缓存读取

            if (objType == null)
            {
                CommConfig config       = CommConfig.GetConfig();
                Provider   dataProvider = (Provider)config.Providers[providerName];
                objType = DataProvider.Instance(dataProvider) as CommonDataProvider;
                string      path    = null;
                HttpContext context = HttpContext.Current;
                if (context != null)
                {
                    path = context.Server.MapPath("~/config/common.config");
                }
                else
                {
                    path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"config\common.config");
                }
                MangaCache.MaxLocalWithFile(cachekey, objType, path);
            }
            return(objType);
        }
예제 #12
0
파일: Admins.cs 프로젝트: shaohaiou/comopp
 /// <summary>
 /// 验证用户登陆
 /// </summary>
 /// <param name="userName">用户名</param>
 /// <param name="password">密码</param>
 /// <returns>用户ID</returns>
 public int ValiUser(string userName, string password)
 {
     return(CommonDataProvider.Instance().ValiAdmin(userName, password));
 }
예제 #13
0
파일: Admins.cs 프로젝트: shaohaiou/comopp
 /// <summary>
 /// 通过ID获取管理员
 /// </summary>
 /// <param name="id">ID</param>
 /// <returns>管理员实体信息</returns>
 public AdminInfo GetAdmin(int id)
 {
     return(CommonDataProvider.Instance().GetAdmin(id));
 }
예제 #14
0
파일: Admins.cs 프로젝트: shaohaiou/comopp
 /// <summary>
 /// 删除管理员
 /// </summary>
 /// <param name="ID"></param>
 /// <returns></returns>
 public bool DeleteAdmin(int ID)
 {
     return(CommonDataProvider.Instance().DeleteAdmin(ID));
 }
예제 #15
0
 public void SetCustomerLevel(int id, int level)
 {
     CommonDataProvider.Instance().SetCustomerLevel(id, level);
 }
예제 #16
0
 public CustomerInfo GetCustomerByID(int id)
 {
     return(CommonDataProvider.Instance().GetCustomerByID(id));
 }
예제 #17
0
 public void Delete(string ids, int corpid, int userid, string username)
 {
     CommonDataProvider.Instance().DeleteCustomer(ids, corpid, userid, username);
 }
예제 #18
0
        /// <summary>
        ///从配置文件加载默认数据库访问提供者类
        /// </summary>
        private static void LoadDefaultProviders()
        {
            if (_defaultprovider == null)
            {
                lock (_lock)
                {
                    if (_defaultprovider == null)
                    {
                        CommConfig config = CommConfig.GetConfig();
                        Provider dataProvider = (Provider)config.Providers[GlobalKey.DEFAULT_PROVDIER_COMMON];
                        _defaultprovider = DataProvider.Instance(dataProvider) as CommonDataProvider;

                    }
                }
            }
        }
예제 #19
0
 public void Update(PaymentWayInfo entity)
 {
     CommonDataProvider.Instance().UpdatePaymentWay(entity);
 }
예제 #20
0
 public void Delete(string ids)
 {
     CommonDataProvider.Instance().DeletePaymentWay(ids);
 }
예제 #21
0
파일: Admins.cs 프로젝트: shaohaiou/comopp
 public void AddLoginRecord(LoginRecordInfo lr)
 {
     CommonDataProvider.Instance().AddLoginRecord(lr);
 }
예제 #22
0
 public void Add(PaymentWayInfo entity)
 {
     CommonDataProvider.Instance().AddPaymentWay(entity);
 }
예제 #23
0
파일: Admins.cs 프로젝트: shaohaiou/comopp
 public List <LoginRecordInfo> GetLoginRecord(int uid)
 {
     return(CommonDataProvider.Instance().GetLoginRecord(uid));
 }
예제 #24
0
 public CustomerInfo GetCustomerByPhone(string phone, int corpid)
 {
     return(CommonDataProvider.Instance().GetCustomerByPhone(phone, corpid));
 }
예제 #25
0
파일: Admins.cs 프로젝트: shaohaiou/comopp
 public AdminInfo GetAdminByName(string name)
 {
     return(CommonDataProvider.Instance().GetAdminByName(name));
 }
예제 #26
0
 public List <CustomerInfo> GetCustomerListForPhoneVest()
 {
     return(CommonDataProvider.Instance().GetCustomerListForPhoneVest());
 }
예제 #27
0
파일: Admins.cs 프로젝트: shaohaiou/comopp
 /// <summary>
 /// 管理员是否已经存在
 /// </summary>
 /// <param name="name">管理员ID</param>
 /// <returns></returns>
 public bool ExistsAdmin(int id)
 {
     return(CommonDataProvider.Instance().ExistsAdmin(id));
 }
예제 #28
0
        /// <summary>
        /// 每天凌晨2点5分开始执行
        /// </summary>
        public void CustomerForcedout()
        {
            if (DateTime.Now.Hour == 2 && DateTime.Now.Minute == 5)
            {
                if (!hasruncustomerforcedout)
                {
                    hasruncustomerforcedout = true;
                    try
                    {
                        EventLogs.JobLog("开始作业-线索强制转出");
                        List <CorporationInfo> list = Corporations.Instance.GetList(true);
                        foreach (CorporationInfo corpinfo in list)
                        {
                            List <CustomerInfo> listForced = new List <CustomerInfo>();
                            List <CustomerInfo> clist      = GetCustomerListByCorporation(corpinfo.ID, true);
                            if (corpinfo.Forcedoffday > 0)
                            {
                                string[] offcustomerlevel = corpinfo.Offcustomerlevel.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                                listForced.AddRange(clist.FindAll(l => l.CustomerStatus == (int)CustomerStatus.清洗_邀约 && DateTime.Today.Subtract(DataConvert.SafeDate(l.PostTime)).TotalDays >= (corpinfo.Forcedoffday - 1) && !offcustomerlevel.Contains(l.LastCustomerLevelID.ToString())));
                            }
                            if (corpinfo.Forcedoutday > 0)
                            {
                                string[] forcedoutdaylevel = corpinfo.Forcedoutdaylevel.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                                listForced.AddRange(clist.FindAll(l => l.CustomerStatus == (int)CustomerStatus.追踪_促成 && DateTime.Today.Subtract(DataConvert.SafeDate(l.PostTime)).TotalDays >= (corpinfo.Forcedoutday - 1) && !forcedoutdaylevel.Contains(l.LastCustomerLevelID.ToString())));
                            }
                            foreach (CustomerInfo entity in listForced)
                            {
                                entity.CustomerStatusSource = entity.CustomerStatus;
                                entity.CustomerStatus       = (int)CustomerStatus.潜客_转出;
                                entity.LurkStatus           = 1;

                                CustomerMoveRecordInfo minfo = new CustomerMoveRecordInfo()
                                {
                                    CustomerID           = entity.ID,
                                    CustomerStatus       = entity.CustomerStatus,
                                    CustomerStatusSource = entity.CustomerStatus,
                                    OwnerID          = entity.OwnerID,
                                    Owner            = entity.Owner,
                                    LastUpdateUserID = entity.LastUpdateUserID,
                                    LastUpdateUser   = entity.LastUpdateUser,
                                    CreateTime       = DateTime.Now.ToString("yyyy-MM-dd HH:mm"),
                                    SystemMsg        = DateTime.Today.ToString("yyyy年MM月dd日") + "线索强制转出"
                                };

                                CustomerMoveRecords.Instance.Add(minfo);

                                entity.SystemRemark = minfo.SystemMsg;

                                CommonDataProvider.Instance().UpdateCustomer(entity);
                            }
                            if (listForced.Count > 0)
                            {
                                ReloadCustomerListByCorporationCache(corpinfo.ID);
                            }
                        }
                        EventLogs.JobLog("完成作业-线索强制转出");
                    }
                    catch (Exception ex)
                    {
                        EventLogs.JobError("作业发生错误-线索强制转出", EventLogs.EVENTID_JOB_ERROR, 0, ex);
                        ExpLog.Write(ex);
                    }
                }
            }
            else
            {
                hasruncustomerforcedout = false;
            }
        }
예제 #29
0
파일: Admins.cs 프로젝트: shaohaiou/comopp
 /// <summary>
 /// 添加管理员
 /// </summary>
 /// <param name="model">后台用户实体类</param>
 /// <returns>添加成功返回ID</returns>
 public int AddAdmin(AdminInfo model)
 {
     return(CommonDataProvider.Instance().AddAdmin(model));
 }
예제 #30
0
 /// <summary>
 /// 更新客户号码归属地
 /// </summary>
 /// <param name="entity"></param>
 public void UpdateCustomerPhoneVest(CustomerInfo entity)
 {
     CommonDataProvider.Instance().UpdateCustomerPhoneVest(entity);
 }
예제 #31
0
파일: Admins.cs 프로젝트: shaohaiou/comopp
 /// <summary>
 /// 更新管理员
 /// </summary>
 /// <param name="model">后台用户实体类</param>
 /// <returns>修改是否成功</returns>
 public bool UpdateAdmin(AdminInfo model)
 {
     return(CommonDataProvider.Instance().UpdateAdmin(model));
 }