Beispiel #1
0
 //public int RemoveUser(CaseStudy.Entities.User user)
 //{
 //    if (user.user_id > 0)
 //    {
 //        CaseStudy.Entities.User u = users.Find(user.user_id);
 //        users.Remove(u);
 //        return this.SaveChanges();
 //    }
 //    else
 //        return 0;
 //}
 public int AddProject(Project proj, Int64 user_id)
 {
     proj = projects.Add(proj);
     if (proj.project_id > 0 && user_id > 0)
     {
         CaseStudy.Entities.User u = users.Find(user_id);
         u.project_id = proj.project_id;
     }
     return(this.SaveChanges());
 }
Beispiel #2
0
 public int EditUser(CaseStudy.Entities.User user)
 {
     if (user.user_id > 0)
     {
         User u = users.Find(user.user_id);
         u.firstname   = user.firstname;
         u.lastname    = user.lastname;
         u.employee_id = user.employee_id;
         u.task_id     = user.task_id;
         u.project_id  = user.project_id;
         return(this.SaveChanges());
     }
     else
     {
         return(0);
     }
 }
Beispiel #3
0
 public int EditProject(projectandmanager proj)
 {
     if (proj.project_id > 0)
     {
         Project project = projects.Find(proj.project_id);
         project.project   = proj.project;
         project.startdate = proj.startdate;
         project.enddate   = proj.enddate;
         project.priority  = proj.priority;
         if (proj.user_id > 0)
         {
             CaseStudy.Entities.User u = users.Find(proj.user_id);
             u.project_id = proj.project_id;
         }
         return(this.SaveChanges());
     }
     else
     {
         return(0);
     }
 }
Beispiel #4
0
 public int EditUser([FromBody] CaseStudy.Entities.User user)
 {
     return(bl.EditUser(user));
 }
Beispiel #5
0
 public int EditUser(CaseStudy.Entities.User user)
 {
     return(dl.EditUser(user));
 }
Beispiel #6
0
 public int AddUser(CaseStudy.Entities.User user)
 {
     return(dl.AddUser(user));
 }
Beispiel #7
0
 public int AddUser(CaseStudy.Entities.User user)
 {
     users.Add(user);
     return(this.SaveChanges());
 }