public Message Remove(Login_Log item) { try { _context.Entry(item).State = EntityState.Deleted; _context.SaveChanges(); return(Message.Success); } catch (DbUpdateException) { return(Message.ErrorInRemove); } catch (Exception) { return(Message.ErrorInRemove); } }
public Message Update(Login_Log item) { try { _context.Login_Logs.Attach(item); _context.Entry(item).State = EntityState.Modified; _context.SaveChanges(); return(Message.Success); } catch (DbUpdateException ex) { Microsoft.Data.Sqlite.SqliteException sqliteEX = ex.GetBaseException() as Microsoft.Data.Sqlite.SqliteException; int ErrorCode = sqliteEX.SqliteErrorCode; return(Message.unKnow); } catch (Exception) { return(Message.unKnow); } }
public Message Add(Login_Log item) { try { if (CheckUserID(item.UserID)) { _context.Login_Logs.Add(item); _context.SaveChanges(); return(Message.Success); } return(Message.UserNotFound); } catch (DbUpdateException ex) { Microsoft.Data.Sqlite.SqliteException sqliteEX = ex.GetBaseException() as Microsoft.Data.Sqlite.SqliteException; int ErrorCode = sqliteEX.SqliteErrorCode; return(Message.unKnow); } catch (Exception) { return(Message.unKnow); } }