Exemplo n.º 1
0
 private void btnAdd_Click(object sender, System.EventArgs e)
 {
     using (var taskDialog = new Form2())
     {
         taskDialog.StartDate = calendar.SelectionStart;
         taskDialog.Deadline  = calendar.SelectionEnd;
         if (taskDialog.ShowDialog() == DialogResult.OK)
         {
             if (!string.IsNullOrWhiteSpace(taskDialog.FormName))
             {
                 var newTask = new Task()
                 {
                     Name      = taskDialog.FormName,
                     Deadline  = taskDialog.Deadline,
                     StartDate = taskDialog.StartDate,
                     Status    = 0,
                 };
                 store.Create(newTask);
                 AddTask(newTask);
             }
         }
     }
 }
Exemplo n.º 2
0
 private void NewTaskDialog()
 {
     using (var taskDialog = new FormTask())
     {
         taskDialog.StartDate = calendar.SelectionStart;
         taskDialog.Deadline  = calendar.SelectionEnd;
         if (taskDialog.ShowDialog() == DialogResult.OK)
         {
             if (!string.IsNullOrWhiteSpace(taskDialog.TaskName))
             {
                 var newTask = new Task()
                 {
                     Name      = taskDialog.TaskName,
                     Deadline  = taskDialog.Deadline,
                     StartDate = taskDialog.StartDate,
                     Status    = TaskStatus.New
                 };
                 store.Create(newTask);
                 AddTask(newTask);
             }
         }
     }
 }
Exemplo n.º 3
0
 public void AddTaskToStore(Task item)
 {
     store.Create(item);
 }