Пример #1
0
        private void cmbProject_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //If the user selects a different project, load the correct information
            cmbProject.Text = cmbProject.SelectedItem.ToString();
            //When the control is entered possible reload tasks and the changing information
            ModelView.taskListComboBoxHandler(cmbTask, cmbProject.Text);
            //Take selected item from list and return the task object for information
            Project SelectedProject = ModelView.projectFromName(cmbProject.Text);

            try
            {
                txtProjectName.Text        = SelectedProject.x;
                txtProjectDescription.Text = SelectedProject.projectDescription;
                txtProjectStartDate.Text   = SelectedProject.dateStarted.ToShortDateString();
            }
            catch (Exception)
            {
                //If this is the first time SelectedProject will be null
                Trace.WriteLine("Error loading selected project");
            }
        }
Пример #2
0
        public static GanttChart.GanttChart returnGantt(Project project)
        {
            /*
             * This method takes a project and returns a Gantt Chart object that can be displayed and manipulated
             */
            GanttChart.GanttChart ganttChart1 = new GanttChart.GanttChart();
            try
            {
                //Gantt chart settings
                ganttChart1.AllowChange = false;
                ganttChart1.FromDate    = project.dateStarted.AddDays(-2);
                ganttChart1.ToDate      = ModelView.taskLastFinishing(project).AddDays(2);
                ganttChart1.GridColor   = Pens.Black;
                ganttChart1.ForeColor   = Color.Black;
                ganttChart1.BackColor   = UI.chartColour;
                int barIndex = 0;

                //For each task add a relevant row in the gantt chart
                foreach (Task task in project.taskList)
                {
                    string   taskName      = task.TaskName;
                    DateTime fromTime      = task.StartDate;
                    DateTime toTime        = task.EstimatedFinishingDate;
                    Color    barColor      = UI.dataPointColour;
                    Color    barHoverColor = UI.dataPointHoverColour;
                    barIndex++;

                    BarInformation bInf = new BarInformation(taskName, fromTime, toTime, barColor, barHoverColor, barIndex);

                    ganttChart1.AddChartBar(taskName, bInf, fromTime, toTime, barColor, barHoverColor, barIndex);
                }
                return(ganttChart1);
            }
            catch (Exception)
            {
                return(null);
            }
        }
Пример #3
0
 private void btnSaveTaskChanges_Click(object sender, RoutedEventArgs e)
 {
     //If user clicks save, edit task accordingly
     DatabaseHandler.editTask(txtTaskName.Text, txtTaskDescription.Text, Convert.ToInt32(txtTaskLength.Text), ModelView.taskFromName(cmbTask.Text));
 }
Пример #4
0
 private void btnSaveProjectChanges_Click(object sender, RoutedEventArgs e)
 {
     //If user clicks save, edit project accordingly
     DatabaseHandler.editProject(txtProjectName.Text, txtProjectDescription.Text, Convert.ToDateTime(txtProjectStartDate.Text), ModelView.projectFromName(cmbProject.Text));
 }
Пример #5
0
 private void cmbProject_MouseEnter(object sender, MouseEventArgs e)
 {
     //When the control is entered possible reload tasks and the changing information
     ModelView.projectListComboBoxHandler(cmbProject);
 }
Пример #6
0
 private void cmbProjectSelector_MouseEnter(object sender, MouseEventArgs e)
 {
     //If a user hovers over the combo box handle this in the modelview
     ModelView.projectListComboBoxHandler(cmbProjectSelector);
 }
Пример #7
0
 private void dispatcherTimer_Tick(object sender, EventArgs e)
 {
     //On the two hour tick, show a notification on the taskbar with a procedurally generated message
     taskbarIcon.ShowBalloonTip("Better Project Notification", ModelView.generateBaloonMessage(), Hardcodet.Wpf.TaskbarNotification.BalloonIcon.Info);
 }
Пример #8
0
 private void Child_MouseMove(object sender, Forms.MouseEventArgs e)
 {
     //Whenever the mouse moves whilst on the chart control
     ModelView.manageBarHighlighting(((Chart)wfhTest.Child).HitTest(e.X, e.Y), (Chart)wfhTest.Child);
 }