Ejemplo n.º 1
0
        public void WriteGeneralLog(long accountId, string ipAddress, Nullable <long> characterId, string logType, string logData)
        {
            try
            {
                using (var context = DataAccessHelper.CreateContext())
                {
                    GeneralLog log = new GeneralLog()
                    {
                        AccountId   = accountId,
                        IpAddress   = ipAddress,
                        Timestamp   = DateTime.Now,
                        LogType     = logType,
                        LogData     = logData,
                        CharacterId = characterId
                    };

                    context.GeneralLog.Add(log);
                    context.SaveChanges();
                }
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }
Ejemplo n.º 2
0
 public GeneralLogDTO Insert(GeneralLogDTO generallog)
 {
     using (var context = DataAccessHelper.CreateContext())
     {
         GeneralLog entity = _mapper.Map <GeneralLog>(generallog);
         context.GeneralLog.Add(entity);
         context.SaveChanges();
         return(_mapper.Map <GeneralLogDTO>(generallog));
     }
 }
Ejemplo n.º 3
0
 public GeneralLogDTO Insert(GeneralLogDTO generallog)
 {
     try
     {
         using (var context = DataAccessHelper.CreateContext())
         {
             GeneralLog entity = _mapper.Map <GeneralLog>(generallog);
             context.GeneralLog.Add(entity);
             context.SaveChanges();
             return(_mapper.Map <GeneralLogDTO>(generallog));
         }
     }
     catch (Exception e)
     {
         Logger.Error(e);
         return(null);
     }
 }
Ejemplo n.º 4
0
        public void WriteGeneralLog(long accountId, string ipAddress, long?CharacterId, string logType, string logData)
        {
            using (var context = DataAccessHelper.CreateContext())
            {
                GeneralLog log = new GeneralLog()
                {
                    AccountId   = accountId,
                    IpAddress   = ipAddress,
                    Timestamp   = DateTime.Now,
                    LogType     = logType,
                    LogData     = logData,
                    CharacterId = CharacterId
                };

                context.GeneralLog.Add(log);
                context.SaveChanges();
            }
        }