예제 #1
0
파일: Form1.cs 프로젝트: annakolzina/Plan
 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);
             }
         }
     }
 }
예제 #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);
             }
         }
     }
 }
예제 #3
0
 public void AddTaskToStore(Task item)
 {
     store.Create(item);
 }