public static HttpResponseMessage GetProjectByName(string nameProject) { return(new HttpResponseMessage(HttpStatusCode.OK) { Content = new ObjectContent <Project>(LogicProjects.GetProjectByNameProject(nameProject), new JsonMediaTypeFormatter()) }); }
public HttpResponseMessage GetUsersAndGrafOfProjmect(string nameProject) { List <User> usersNotFinishProject = new List <User>(); Project myProject = LogicProjects.GetProjectByNameProject(nameProject); Dictionary <UserProject, double> UsersAndHoursWorkedOnProject; if (myProject.Active) { UsersAndHoursWorkedOnProject = LogicProjects.GetUsersAndHoursThatWorkedOnProject(myProject.IdProject); foreach (var item in UsersAndHoursWorkedOnProject) { if (item.Value != 100) { usersNotFinishProject.Add(LogicUsers.GetUserByIdUser(item.Key.IdUser)); } } } return(new HttpResponseMessage(HttpStatusCode.OK) { Content = new ObjectContent <List <User> >(usersNotFinishProject, new JsonMediaTypeFormatter()) }); }
public HttpResponseMessage GetUsersAndGrafOfProject(string nameProject) { List <User> users = LogicUsers.GetUsersByNameOfProject(nameProject); Dictionary <UserProject, double> myGraf = LogicProjects.GetUsersAndHoursThatWorkedOnProject(LogicProjects.GetProjectByNameProject(nameProject).IdProject); return(new HttpResponseMessage(HttpStatusCode.OK) { Content = new ObjectContent <MyClass>(new MyClass() { Users = users, MyGraf = myGraf }, new JsonMediaTypeFormatter()) }); }