Пример #1
0
 /// <summary>
 /// 构造参数
 /// </summary>
 public BaseDbDal()
 {
     if (_economicalleagueEntity == null)
     {
         _economicalleagueEntity = new EconomicalleagueContainer();
     }
 }
Пример #2
0
 /// <summary>
 /// 构造参数
 /// </summary>
 public BaseRedisDal()
 {
     if (_zuoTopProjectEntity == null)
     {
         _zuoTopProjectEntity = new EconomicalleagueContainer();
     }
 }
Пример #3
0
 public static void AddLoginLog(Log_LoginLog Log)
 {
     if (Log != null)
     {
         EconomicalleagueContainer entity = new EconomicalleagueContainer();
         entity.Log_LoginLog.Add(Log);
         entity.SaveChanges();
     }
 }
Пример #4
0
 /// <summary>
 /// 构造参数
 /// </summary>
 public BaseDbDal(EconomicalleagueContainer entity)
 {
     if (entity != null)
     {
         _economicalleagueEntity = entity;
     }
     else
     {
         _economicalleagueEntity = new EconomicalleagueContainer();
     }
 }
Пример #5
0
 /// <summary>
 /// 构造参数
 /// </summary>
 public BaseRedisDal(EconomicalleagueContainer entity)
 {
     if (entity != null)
     {
         _zuoTopProjectEntity = entity;
     }
     else
     {
         _zuoTopProjectEntity = new EconomicalleagueContainer();
     }
 }
Пример #6
0
        public DateTime?CustomerLastLoginTime(out string lastLoginIp, long customerId)
        {
            lastLoginIp = "127.0.0.1";
            DateTime?lastLoginTime           = DateTime.Now;
            EconomicalleagueContainer entity = new EconomicalleagueContainer();
            Log_LoginLog log = entity.Log_LoginLog.Where(x => x.LoginCustomer == customerId).OrderByDescending(t => t.OccurTime).FirstOrDefault();

            if (log != null)
            {
                lastLoginIp   = log.RemoteAddr;
                lastLoginTime = log.OccurTime.Value;
            }
            return(lastLoginTime);
        }
Пример #7
0
 private static void AddExceptionLog(Log_ExceptionLog exLog)
 {
     if (exLog != null)
     {
         EconomicalleagueContainer entity = new EconomicalleagueContainer();
         //var exceptionLogInfo = new Log_ExceptionLog()
         //{
         //    ControllerName = exLog.ControllerName,
         //    ActionName = exLog.ActionName,
         //    Message = exLog.Message,
         //    StackTrace = exLog.StackTrace,
         //    RemoteAddr = exLog.RemoteAddr,
         //    RequestID = exLog.RequestID,
         //    LoginUser = exLog.LoginUser,
         //    OccurTime = exLog.OccurTime,
         //    AppId = exLog.AppId,
         //};
         entity.Log_ExceptionLog.Add(exLog);
         entity.SaveChanges();
     }
 }
Пример #8
0
        protected void Application_Start()
        {
            // 配置log4net
            log4net.Config.XmlConfigurator.Configure();

            //AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);

            GlobalConfiguration.Configure(WebApiConfig.Register);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            //BundleConfig.RegisterBundles(BundleTable.Bundles);

            //EF数据库启动时预热
            using (var dbContext = new EconomicalleagueContainer())
            {
                var objectContext     = ((IObjectContextAdapter)dbContext).ObjectContext;
                var mappingCollection = (StorageMappingItemCollection)objectContext.MetadataWorkspace.GetItemCollection(DataSpace.CSSpace);
                mappingCollection.GenerateViews(new List <EdmSchemaError>());
            }
            GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings = new Newtonsoft.Json.JsonSerializerSettings
            {
                DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Include
            };
        }
Пример #9
0
 /// <summary>
 /// 重新初始化数据库操作实体
 /// </summary>
 public void ReInitBZoneEntity()
 {
     _economicalleagueEntity = new EconomicalleagueContainer();
 }
Пример #10
0
 /// <summary>
 /// 重新初始化数据库操作实体
 /// </summary>
 public void ReInitZuoTopProjectEntity()
 {
     _zuoTopProjectEntity = new EconomicalleagueContainer();
 }
Пример #11
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="entity"></param>
 public TokenRedisDal(EconomicalleagueContainer entity) : base(entity)
 {
 }