public void DeleteUnit() { using (var DbContext = new HomeOfficeContext()) { DbContext.Remove(this); DbContext.SaveChanges(); } }
private void DeletePasswordOfUser(User user) { using (var DbContext = new HomeOfficeContext()) { Password password = new Password(user.ID); DbContext.Remove(password); DbContext.SaveChanges(); } }
public override void DeleteUser(User user) { DeletePasswordOfUser(user); using (var DbContext = new HomeOfficeContext()) { DbContext.Remove(user); DbContext.SaveChanges(); } }
public override void AddPassword(Password password) { using (var DbContext = new HomeOfficeContext()) { DbContext.Database.EnsureCreated(); DbContext.Passwords.Add(password); DbContext.SaveChanges(); } }
public override void AddUser(User user) { using (var DbContext = new HomeOfficeContext()) { DbContext.Database.EnsureCreated(); DbContext.Users.Add(user); DbContext.SaveChanges(); } }
public void AddTaskDictionary() { using (var DbContext = new HomeOfficeContext()) { DbContext.Database.EnsureCreated(); DbContext.TaskDictionary.Add(this); DbContext.SaveChanges(); } }
public void AddUnit() { using (var DbContext = new HomeOfficeContext()) { DbContext.Database.EnsureCreated(); DbContext.Units.Add(this); DbContext.SaveChanges(); } }
public override void AssignActivity(TaskDictionary task, User u) { Tasks.Task t = new Tasks.Task(u.ID, task.ID); using (var DbContext = new HomeOfficeContext()) { DbContext.Database.EnsureCreated(); DbContext.Tasks.Add(t); DbContext.SaveChanges(); } }
public override void UnassignActivity(Tasks.Task t) { using (var DbContext = new HomeOfficeContext()) { var result = DbContext.Tasks.SingleOrDefault(b => b.Users_ID == t.Users_ID && b.TaskDictionary_ID == t.TaskDictionary_ID); if (result != null) { result.Status = true; DbContext.SaveChanges(); } } }
public void ResetPassword() { using (var DbContext = new HomeOfficeContext()) { var result = DbContext.Passwords.SingleOrDefault(p => p.ID == ID); if (result != null) { result.Password_ = Password_; DbContext.SaveChanges(); } } }