예제 #1
0
        public void Deserialize(XmlNode node)
        {
            Clear();

            XmlNodeList children = node.ChildNodes;
            foreach (XmlNode nodeItem in children)
            {
                string name = nodeItem.Name.ToLower().Trim();

                if (name == "canedit")
                    CanEdit = HelperXML.GetBool(nodeItem);
                else if (name == "id")
                    ID = HelperXML.GetInt32(nodeItem);
                else if (name == "title")
                    Title = nodeItem.InnerText;
                else if (name == "description")
                    Description = nodeItem.InnerText;
                else if (name == "deadline")
                    Deadline = HelperXML.GetDateTime(nodeItem);
                else if (name == "priority")
                    Priority = (ProjectTaskPriority)HelperXML.GetInt32(nodeItem);
                else if (name == "milestoneid")
                    MilestoneID = HelperXML.GetInt32(nodeItem);
                else if (name == "projectowner")
                {
                    ProjectOwner = new ProjectBrief();
                    ProjectOwner.Connection = Connection;
                    ProjectOwner.Deserialize(nodeItem);
                }
                else if (name == "status")
                    Status = (ProjectTaskStatus)HelperXML.GetInt32(nodeItem);
                if (name == "isexpired")
                    IsExpired = HelperXML.GetBool(nodeItem);
                else if (name == "responsible")
                {
                    Responsible = new UserBrief();
                    Responsible.Connection = Connection;
                    Responsible.Deserialize(nodeItem);
                }
                else if (name == "created")
                    Created = HelperXML.GetDateTime(nodeItem);
                else if (name == "createdby")
                {
                    CreatedBy = new UserBrief();
                    CreatedBy.Connection = Connection;
                    CreatedBy.Deserialize(nodeItem);
                }
                else if (name == "updated")
                    Updated = HelperXML.GetDateTime(nodeItem);
                else if (name == "updatedby")
                {
                    UpdatedBy = new UserBrief();
                    UpdatedBy.Connection = Connection;
                    UpdatedBy.Deserialize(nodeItem);
                }
            }
        }
예제 #2
0
 /// <summary>
 /// Returns the list of all users participating in the project
 /// </summary>
 /// <param name="project">Project</param>
 /// <returns>List of users</returns>
 public UserCollectionBrief GetTeamByProject(ProjectBrief project)
 {
     return GetTeamByProject(project.ID);
 }
예제 #3
0
 /// <summary>
 /// Returns the list of all the milestones within the project
 /// </summary>
 /// <param name="projectID">Project</param>
 /// <returns>Collection of milestones</returns>
 public ProjectMilestoneCollection GetMilestonesByProject(ProjectBrief project)
 {
     return GetMilestonesByProject(project.ID);
 }
예제 #4
0
 /// <summary>
 /// Get all project tasks
 /// </summary>
 /// <param name="project">Project</param>
 /// <returns>Tasks collection</returns>
 public ProjectTaskCollection GetTasksByProject(ProjectBrief project)
 {
     return GetTasksByProject(project.ID);
 }
예제 #5
0
 /// <summary>
 /// Returns the list with the detailed information about the tasks for the current user 
 /// within specified project
 /// </summary>
 /// <param name="project">Project</param>
 /// <param name="status">Task status</param>
 /// <returns>Tasks collection</returns>
 public ProjectTaskCollection GetTasksMyByProject(ProjectBrief project, ProjectTaskStatus status)
 {
     return GetTasksMyByProject(project.ID, status);
 }
예제 #6
0
 /// <summary>
 /// Returns the detailed information about the time spent on the project
 /// </summary>
 /// <param name="project">Requested project</param>
 /// <returns>Collection of time records</returns>
 public ProjectTimeRecordCollection GetProjectTime(ProjectBrief project)
 {
     return GetProjectTime(project.ID);
 }
예제 #7
0
 /// <summary>
 /// Returns project details
 /// </summary>
 /// <param name="user">Project which contains requested project id</param>
 /// <returns>Project record or null if user was not found</returns>
 public ProjectExtended GetProject(ProjectBrief project)
 {
     return GetProject(project.ID);
 }
예제 #8
0
 public void GetProjectTime(ProjectBrief project)
 {
     ProjectTimeRecordCollection record = project.GetTimeSpent();
     foreach (ProjectTimeRecord r in record)
         Console.WriteLine(r.ToString());
 }
예제 #9
0
 public void GetProjectMilestones(ProjectBrief project)
 {
     ShowMilestoneList(project.GetMilestones());
 }
예제 #10
0
        public void GetProjectDetails(ProjectBrief project)
        {
            ProjectExtended pex = project.GetDetails();

            Console.Clear();
            Console.WriteLine(pex.ToString());

            //if (pex.Responsible != null)
            //{
            //    Console.WriteLine();
            //    Console.WriteLine("Reponsible:");
            //    Console.WriteLine(pex.Responsible.GetDetails());
            //}
            //if (pex.CreatedBy != null)
            //{
            //    Console.WriteLine();
            //    Console.WriteLine("Created by:");
            //    Console.WriteLine(pex.CreatedBy.GetDetails());
            //}

            Console.WriteLine("Milestones:\n\n");
            GetProjectMilestones(pex);
            Console.WriteLine("Project time:\n\n");
            GetProjectTime(pex);

            Console.WriteLine();
            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
        }