public bool UpdateRole(role s) { try { using (QLBH_PHONE_ENTITY data = new QLBH_PHONE_ENTITY()) { data.Entry(s).State = EntityState.Modified; data.SaveChanges(); return true; } } catch (Exception e) { Debug.WriteLine(e); return false; } }
public bool AddRole(role s) { try { using (QLBH_PHONE_ENTITY data = new QLBH_PHONE_ENTITY()) { data.roles.Add(s); data.SaveChanges(); return true; } } catch (Exception e) { Debug.WriteLine(e); return false; } }