Ejemplo n.º 1
0
 public Tree(Tree toCopy)
 {
     Description = toCopy.Description;
     LastChangesTime = toCopy.LastChangesTime;
     Name = toCopy.Name;
     MainTask = new Task(toCopy.MainTask);
     MainTaskId = toCopy.MainTaskId;
     TreeUserLogin = toCopy.TreeUserLogin;
     TreeUser = toCopy.TreeUser;
     TreeId = toCopy.TreeId;
 }
Ejemplo n.º 2
0
 public static List<TimeBinding> GetTBofDay(int day, int month, int year,Tree tree)
 {
     var tasks = Task.SelectAllTreeTask(tree.MainTaskId).Where(x => x.ChildrenAreSteps());
     var steps = new List<Step>();
     foreach (var tsk in tasks)
     {
         steps.Add(Step.GetFirstUndoneStepByTaskID(tsk.Id));
     }
     var tbs = new List<TimeBinding>();
     foreach (var st in steps)
     {
         tbs.AddRange(TimeBinding.GetTBbyStepID(st.Id));
     }
     return tbs
         .Where(x => x.Year == year && x.Month == month && x.Day == day).ToList();
 }
Ejemplo n.º 3
0
 protected bool Equals(Tree other)
 {
     return TreeId == other.TreeId && string.Equals(TreeUserLogin, other.TreeUserLogin) &&
            Equals(TreeUser, other.TreeUser) && MainTaskId == other.MainTaskId &&
            Equals(MainTask, other.MainTask) && string.Equals(Name, other.Name) &&
            string.Equals(Description, other.Description) && LastChangesTime.Equals(other.LastChangesTime);
 }
Ejemplo n.º 4
0
 //TODO: recursively delete all tasks and steps?
 public static void DeleteTree(Tree tree)
 {
     var set = DAL.SqlRepository.Trees;
     var t = set.Find(tree.TreeId);
     if (t != null)
     {
         set.Remove(t);
         DAL.SqlRepository.Save();
     }
 }