public int add(LOGIN login) { var result = 0; try { context.LOGIN.Add(login); result = context.SaveChanges(); } catch { result = -1; } return(result); }
public int edit(int id, LOGIN login) { var result = 0; try { var exsitinglogin = context.LOGIN.Find(id); exsitinglogin.PASSWORD = login.PASSWORD; exsitinglogin.USERNAME = login.USERNAME; result = context.SaveChanges(); } catch { result = -1; } return(result); }