コード例 #1
0
        public bool Handler(Dalyan.Domain.Query.LogLoginDeleteQuery query)
        {
            try
            {
                var obj = new Dalyan.Db.LogLogin();
                obj = _db.LogLogin.FirstOrDefault(x => x.Id == query.Id);

                obj.IsDeleted = true;
                _db.SaveChanges();
                return(true);
            }
            catch (Exception ex)
            {
                throw new ExceptionLog(LogType.DATABASE_DELETE, LogLevel.ERROR, ex, "DeleteQueryHandler");
            }
        }
コード例 #2
0
 public Dalyan.Entities.Models.LogLogin Handler(LogLoginEditQuery query)
 {
     try
     {
         var obj = new Dalyan.Db.LogLogin();
         obj                 = _db.LogLogin.FirstOrDefault(x => x.Id == query.LogLogin.Id);
         obj.Id              = query.LogLogin.Id;
         obj.UserId          = query.LogLogin.UserId;
         obj.LogDate         = query.LogLogin.LogDate;
         obj.LoginLogType    = query.LogLogin.LoginLogType;
         obj.ExceptionString = query.LogLogin.ExceptionString;
         obj.Comment         = query.LogLogin.Comment;
         obj.IsDeleted       = query.LogLogin.IsDeleted;
         _db.SaveChanges();
         return(query.LogLogin);
     }
     catch (Exception ex)
     {
         throw new ExceptionLog(LogType.DATABASE_UPDATE, LogLevel.ERROR, ex, "EditQueryHandler");
     }
 }
コード例 #3
0
 public Dalyan.Entities.Models.LogLogin Handler(LogLoginAddQuery query)
 {
     try
     {
         var obj = new Dalyan.Db.LogLogin();
         obj.Id              = query.LogLogin.Id;
         obj.UserId          = query.LogLogin.UserId;
         obj.LogDate         = query.LogLogin.LogDate;
         obj.LoginLogType    = query.LogLogin.LoginLogType;
         obj.ExceptionString = query.LogLogin.ExceptionString;
         obj.Comment         = query.LogLogin.Comment;
         obj.IsDeleted       = query.LogLogin.IsDeleted;
         _db.LogLogin.Add(obj);
         _db.SaveChanges();
         query.LogLogin.Id = obj.Id;
         return(query.LogLogin);
     }
     catch (Exception ex)
     {
         throw new ExceptionLog(LogType.DATABASE_INSERT, LogLevel.ERROR, ex, "AddQueryHandler");
     }
 }