private void button_Click(object sender, RoutedEventArgs e)
        {
            string hoursText   = hoursBox.Text;
            string minutesText = minutesBox.Text;

            int minutes;
            int hours;

            if (!Int32.TryParse(hoursText, out hours))
            {
                MessageBox.Show("Cannot process hours. Front format.");
                return;
            }
            if (!Int32.TryParse(minutesText, out minutes))
            {
                MessageBox.Show("Cannot process minutes. Front format.");
                return;
            }

            int addTimeSpent = hours * 60 + minutes;

            task.timeSpent += addTimeSpent;
            DatabaseTask.UpdateTask(task);
            Close();
        }
        private void btnChange_Click(object sender, RoutedEventArgs e)
        {
            DialogAddTask d = new DialogAddTask(t);

            if (d.ShowDialog() == true)
            {
                DatabaseTask.UpdateTask(t);
                //repaint taskwindow
                EventRepaint(EventArgs.Empty);
            }
        }
Exemple #3
0
        private void panelMiddle_Drop(object sender, DragEventArgs e)
        {
            base.OnDrop(e);

            // If the DataObject contains string data, extract it.
            if (e.Data.GetDataPresent("Task"))
            {
                Task task = (Task)e.Data.GetData("Task");
                task.status = Status.DONE;
                DatabaseTask.UpdateTask(task);
            }
            e.Handled = true;
            Repaint();
        }
Exemple #4
0
        private void panelLeft_Drop(object sender, DragEventArgs e)
        {
            base.OnDrop(e);

            // If the DataObject contains string data, extract it.
            if (e.Data.GetDataPresent("Task"))
            {
                Task task = (Task)e.Data.GetData("Task");
                task.status = Status.TODO;

                DialogAddTask an = new DialogAddTask(task);
                if (an.ShowDialog() == true)
                {
                    //repaint all
                    e.Handled = true;
                    Repaint();
                    DatabaseTask.UpdateTask(task);
                }
                else
                {
                }
            }
        }