Ejemplo n.º 1
0
 public static HttpResponseMessage GetProjectByName(string nameProject)
 {
     return(new HttpResponseMessage(HttpStatusCode.OK)
     {
         Content = new ObjectContent <Project>(LogicProjects.GetProjectByNameProject(nameProject), new JsonMediaTypeFormatter())
     });
 }
Ejemplo n.º 2
0
        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())
            });
        }
Ejemplo n.º 3
0
        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())
            });
        }