Beispiel #1
0
 public TaskgroupControl(Taskgroup taskgroup,
                         TaskgroupPage taskgroupPage) : this(taskgroup)
 {
     this.taskgroupPage      = taskgroupPage;
     InfoButton.Visibility   = Visibility.Collapsed;
     DeleteButton.Visibility = Visibility.Collapsed;
 }
 public AppointmentControl(CalendarDayControl calendarDayControl,
                           Taskgroup taskgroup)
 {
     InitializeComponent();
     this.calendarDayControl = calendarDayControl;
     this.taskgroup          = taskgroup;
     this.TitleLabel.Text    = taskgroup.Title;
 }
 public BoardGroupControl(BoardPage boardPage, Taskgroup taskgroup)
 {
     if (taskgroup == null || boardPage == null)
     {
         throw new ArgumentNullException();
     }
     InitializeComponent();
     this.taskgroup = taskgroup;
     this.boardPage = boardPage;
     Update();
 }
Beispiel #4
0
 public TaskgroupPage(Taskgroup taskgroup)
 {
     InitializeComponent();
     this.taskgroup     = taskgroup;
     taskgroupControl   = new TaskgroupControl(taskgroup, this);
     taskDetailsControl = new TaskDetailsControl(null, this);
     ContentGrid.Children.Add(taskgroupControl);
     ContentGrid.Children.Add(taskDetailsControl);
     Grid.SetColumn(taskgroupControl, 0);
     Grid.SetColumn(taskDetailsControl, 1);
     Grid.SetRow(taskgroupControl, 0);
     Grid.SetRow(taskDetailsControl, 0);
 }
Beispiel #5
0
        private void OnAddButtonClicked(object sender, RoutedEventArgs e)
        {
            string title = "Neue Gruppe";
            int    i     = 1;

            while (CalendarPage.Project.Taskgroups.Exists(x => x.Title == title))
            {
                title = title.Split(' ')[0] + " " + title.Split(' ')[1] + " " + (++i);
            }
            Taskgroup taskgroup = new Taskgroup(title)
            {
                Deadline = this.Day.Date
            };

            this.CalendarPage.Project.Taskgroups.Add(taskgroup);
            AppointmentControl appointmentControl = new AppointmentControl(
                this, taskgroup
                );

            AppointmentContainer.Children.Add(appointmentControl);
            appointmentControl.TitleLabel.BeginEditing();
        }
Beispiel #6
0
 public TaskgroupControl(Taskgroup taskgroup,
                         ListPage listPage) : this(taskgroup)
 {
     this.listPage = listPage;
 }
Beispiel #7
0
 private TaskgroupControl(Taskgroup taskgroup)
 {
     InitializeComponent();
     Taskgroup = taskgroup;
 }
Beispiel #8
0
 public void ShowTaskgroup(Taskgroup taskgroup)
 {
     taskgroupPage.Taskgroup = taskgroup;
     PageFrame.Content       = taskgroupPage;
     DrawButtonBorder(null);
 }
Beispiel #9
0
        /**
         * <summary>
         * Lädt alle Daten (Ziele, Projekte, Aufgabengruppe, Aufgaben und
         * Anhänge) aus der Datenbank und gibt sie als Liste zurück.
         * </summary>
         * <returns>Liste mit Zielen oder null wenn ein Fehler auftrat</returns>
         */
        public List <Goal> LoadAll()
        {
            try
            {
                List <Goal> goals = new List <Goal>();

                SqliteCommand    goalCommand = new SqliteCommand(SELECT_GOAL, sqliteConnection);
                SqliteDataReader goalReader  = goalCommand.ExecuteReader();

                while (goalReader.Read())
                {
                    long goalId = goalReader.GetInt64(0);
                    Goal goal   = new Goal(goalReader.GetString(1));
                    goals.Add(goal);

                    SqliteCommand    projectCommand = new SqliteCommand(string.Format(SELECT_PROJECT, goalId), sqliteConnection);
                    SqliteDataReader projectReader  = projectCommand.ExecuteReader();

                    while (projectReader.Read())
                    {
                        long    projectId = projectReader.GetInt64(0);
                        Project project   = new Project(projectReader.GetString(1), projectReader.GetString(2));
                        goal.Projects.Add(project);

                        SqliteCommand    taskgroupCommand = new SqliteCommand(string.Format(SELECT_TASKGROUP, projectId), sqliteConnection);
                        SqliteDataReader taskgroupReader  = taskgroupCommand.ExecuteReader();

                        while (taskgroupReader.Read())
                        {
                            long      taskgroupId = taskgroupReader.GetInt64(0);
                            Taskgroup taskgroup   = new Taskgroup(taskgroupReader.GetString(1));
                            if (!taskgroupReader.IsDBNull(2))
                            {
                                taskgroup.Deadline = DateTime.Parse(taskgroupReader.GetString(2));
                            }
                            taskgroup.State = (State)taskgroupReader.GetInt32(3);
                            taskgroup.Prio  = (Priority)taskgroupReader.GetInt32(4);
                            project.Taskgroups.Add(taskgroup);

                            SqliteCommand    taskCommand = new SqliteCommand(string.Format(SELECT_TASK, taskgroupId), sqliteConnection);
                            SqliteDataReader taskReader  = taskCommand.ExecuteReader();

                            while (taskReader.Read())
                            {
                                long taskId = taskReader.GetInt64(0);
                                Task task   = new Task(taskReader.GetString(1));
                                task.Description = taskReader.GetString(2);
                                task.Done        = taskReader.GetBoolean(3);
                                taskgroup.Tasks.Add(task);

                                SqliteCommand    attachmentCommand = new SqliteCommand(string.Format(SELECT_ATTACHMENT, taskId), sqliteConnection);
                                SqliteDataReader attachmentReader  = attachmentCommand.ExecuteReader();

                                while (attachmentReader.Read())
                                {
                                    long       taskAttachmentId = attachmentReader.GetInt64(0);
                                    Attachment attachment       = new Attachment(attachmentReader.GetString(1), attachmentReader.GetString(2));
                                    task.Attachments.Add(attachment);
                                }

                                attachmentReader.Close();
                            }

                            taskReader.Close();
                        }

                        taskgroupReader.Close();
                    }

                    projectReader.Close();
                }

                goalReader.Close();

                return(goals);
            }
            catch
            {
                return(null);
            }
        }