/* Put data input into subtask object before added this subtask into database*/
        private void PutSubTask(Models.Subtask _subtask)
        {
            //_subtask.taskID = (int)comboListTask.SelectedValue;
            if (dateForm != null)
            {
                _subtask.taskID = dateForm.getSelectedNodeTaskID();
            }
            else if (childTasksForm != null)
            {
                _subtask.taskID = childTasksForm.getTask().taskID;
            }

            if (completePicker.Enabled == true)
            {
                _subtask.st_CompleteDate = completePicker.Value;
            }
            else
            {
                _subtask.st_CompleteDate = DateTime.MaxValue;
            }

            //_subtask.st_CreatedDate = createDatePicker.Value;
            _subtask.st_CreatedDate = DateTime.Now;

            if (deadlinePicker.Enabled == true)
            {
                _subtask.st_Deadline = deadlinePicker.Value;
            }
            else
            {
                _subtask.st_Deadline = DateTime.MaxValue;
            }

            _subtask.st_Description = txtDescription.Text.Trim();

            if (comboPriority.SelectedItem.ToString() == "")
            {
                _subtask.st_Priority = -1;
            }
            else if (comboPriority.SelectedItem.ToString() == "Low")
            {
                _subtask.st_Priority = 1;
            }
            else if (comboPriority.SelectedItem.ToString() == "Medium")
            {
                _subtask.st_Priority = 2;
            }
            else
            {
                _subtask.st_Priority = 3;
            }
            _subtask.note = notesTextBox.Text.Trim();
        }
 public AddUpdateChildTaskForm(User _user, bool _isUpdate, dateForm dateForm, childTasksForm childTasksForm)
 {
     InitializeComponent();
     user     = _user;
     isUpdate = _isUpdate;
     //load tasks into comboBox
     this.dateForm       = dateForm;
     this.childTasksForm = childTasksForm;
     //LoadComboBoxes();
     //comboPriority.SelectedIndex = 0;
     instance = this;
     deadlinePicker.Format       = DateTimePickerFormat.Custom;
     deadlinePicker.CustomFormat = "MM/dd/yyyy hh:mm tt";
     if (dateForm != null)
     {
         this.taskTitle = TaskController.getATask(dateForm.getSelectedNodeTaskID()).title;
     }
     else if (childTasksForm != null)
     {
         this.taskTitle = childTasksForm.getTask().title;
     }
 }