//TO Do
        public List<IChildProject> GetChildProjects()
        {
            var userConnection = TerrasoftApi.GetuserConnection();
            var projectList = new List<IChildProject>();

            var esqProjects = new EntitySchemaQuery(userConnection.EntitySchemaManager, "Project");
            esqProjects.AddColumn("ParentProject");
            esqProjects.AddColumn("EndDate");
            esqProjects.AddColumn("StartDate");
            esqProjects.JoinRightState = QueryJoinRightLevel.Disabled;
            esqProjects.PrimaryQueryColumn.IsAlwaysSelect = true;
            var filterId = esqProjects.CreateFilterWithParameters(FilterComparisonType.Equal, "ParentProject", RootId);
            esqProjects.Filters.Add(filterId);

            var projectEntities = esqProjects.GetEntityCollection(userConnection);

            foreach (var project in projectEntities)
            {
                var id = (Guid)project.PrimaryColumnValue;
                var parentProjectId = (Guid)project.GetColumnValue("ParentProjectId");
                var endDate = (DateTime)project.GetColumnValue("EndDate");
                var startDate = (DateTime)project.GetColumnValue("StartDate");
                var newProject = new ChildProject(RootId, id, endDate, startDate);
                if (ChildProjects == null) ChildProjects = new List<ChildProject>();
                ChildProjects.Add(newProject);
            }
            var orderedChildProjecs = ChildProjects.OrderBy(x => x.StartDate).ToList() as List<ChildProject>;
            foreach (var item in orderedChildProjecs)
            {
                projectList.Add((IChildProject)item);
            }
            ChildProjects = orderedChildProjecs;

            return projectList;
        }
 public static void ChangeDatesProjects(ChildProject firstProject, ChildProject secondProject)
 {
     var intervalTicks = secondProject.EndDate.Ticks - secondProject.StartDate.Ticks;
     secondProject.StartDate = firstProject.EndDate;
     var newIntervalTicks = secondProject.EndDate.Ticks - secondProject.StartDate.Ticks;
     var ticksSubstruction = intervalTicks - newIntervalTicks;
     secondProject.EndDate.AddTicks(ticksSubstruction);
 }
 public static bool CompareProjects(ChildProject firstProject, ChildProject secondProject)
 {
     if (firstProject.GetChildProjectDateEnd() > secondProject.GetChildProjectStartDate())
         return true;
     return false;
 }