public bool SuaQuyen(Quyens q) { try { db.Entry(q).State = EntityState.Modified; db.SaveChanges(); return(true); } catch (Exception) { return(false); throw; } }
public bool ThemQuyen(Quyens q) { try { var a = db.Quyens.FirstOrDefault(x => x.TenTW == q.TenTW && x.TenVT == q.TenVT); if (a == null) { db.Quyens.Add(q); db.SaveChanges(); return(true); } return(false); } catch (Exception) { return(false); throw; } }