public ParentTask UpdateParentTask(ParentTask oTask)
 {
     using (var context = new ProjectManagerContext())
     {
         oTask = context.ParentTasks.Attach(oTask);
         context.Entry(oTask).State = EntityState.Modified;
         context.SaveChanges();
         return(oTask);
     }
 }
 /// <summary>
 /// Update Project
 /// </summary>
 /// <param name="oProject"></param>
 /// <returns></returns>
 public Project UpdateProject(Project oProject)
 {
     using (var context = new ProjectManagerContext())
     {
         context.Projects.Attach(oProject);
         context.Entry(oProject).State = EntityState.Modified;
         context.SaveChanges();
         return(oProject);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// To delete user
 /// </summary>
 /// <param name="oUser"></param>
 /// <returns></returns>
 public bool DeleteUser(User oUser)
 {
     using (var context = new ProjectManagerContext())
     {
         oUser = context.Users.FirstOrDefault(x => x.User_ID == oUser.User_ID);
         context.Users.Remove(oUser);
         context.SaveChanges();
         return(true);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// To update user
 /// </summary>
 /// <param name="oUser"></param>
 /// <returns></returns>
 public User UpdateUser(User oUser)
 {
     using (var context = new ProjectManagerContext())
     {
         context.Users.Attach(oUser);
         context.Entry(oUser).State = EntityState.Modified;
         context.SaveChanges();
         return(oUser);
     }
 }
Exemplo n.º 5
0
 public virtual bool UpdateProject(Project project)
 {
     _context.Set <Project>().Update(project);
     _context.SaveChanges();
     return(true);
 }
Exemplo n.º 6
0
 public virtual bool UpdateTask(Task task)
 {
     _context.Set <Task>().Update(task);
     _context.SaveChanges();
     return(true);
 }