Exemplo n.º 1
0
 public void DeleteUnit()
 {
     using (var DbContext = new HomeOfficeContext())
     {
         DbContext.Remove(this);
         DbContext.SaveChanges();
     }
 }
Exemplo n.º 2
0
 private void DeletePasswordOfUser(User user)
 {
     using (var DbContext = new HomeOfficeContext())
     {
         Password password = new Password(user.ID);
         DbContext.Remove(password);
         DbContext.SaveChanges();
     }
 }
Exemplo n.º 3
0
 public override void DeleteUser(User user)
 {
     DeletePasswordOfUser(user);
     using (var DbContext = new HomeOfficeContext())
     {
         DbContext.Remove(user);
         DbContext.SaveChanges();
     }
 }
Exemplo n.º 4
0
 public override void AddPassword(Password password)
 {
     using (var DbContext = new HomeOfficeContext())
     {
         DbContext.Database.EnsureCreated();
         DbContext.Passwords.Add(password);
         DbContext.SaveChanges();
     }
 }
Exemplo n.º 5
0
 public override void AddUser(User user)
 {
     using (var DbContext = new HomeOfficeContext())
     {
         DbContext.Database.EnsureCreated();
         DbContext.Users.Add(user);
         DbContext.SaveChanges();
     }
 }
Exemplo n.º 6
0
 public void AddTaskDictionary()
 {
     using (var DbContext = new HomeOfficeContext())
     {
         DbContext.Database.EnsureCreated();
         DbContext.TaskDictionary.Add(this);
         DbContext.SaveChanges();
     }
 }
Exemplo n.º 7
0
        public void AddUnit()
        {
            using (var DbContext = new HomeOfficeContext())
            {
                DbContext.Database.EnsureCreated();

                DbContext.Units.Add(this);
                DbContext.SaveChanges();
            }
        }
Exemplo n.º 8
0
 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();
     }
 }
Exemplo n.º 9
0
 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();
         }
     }
 }
Exemplo n.º 10
0
 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();
         }
     }
 }