/// <summary> /// button do dodawania kolejnych task /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonAddTask_Click(object sender, EventArgs e) { if (checkedListBoxImportance.CheckedItems == null) { MessageBox.Show("Zaznacz ważność!"); return; } Classes.TaskRelated.Task task = new Classes.TaskRelated.Task(textBoxTask.Text.ToString(), checkedListBoxImportance.CheckedItems[0].ToString(), false); SQLConnector sQLConnector = new SQLConnector(); sQLConnector.InsertTaskIntoTasks(task, user, diary); diary.addTaskToDayTasks(task); SQLConnector sQLConnetor = new SQLConnector(); dataGridViewTasks.DataSource = sQLConnetor.ReturnDataTable(user, diary.Date); textBoxTask.Text = ""; foreach (int i in checkedListBoxImportance.CheckedIndices) { checkedListBoxImportance.SetItemCheckState(i, CheckState.Unchecked); } MessageBox.Show("Zadanie dodane!"); }
/// <summary> /// dodawanie task do listy tasks /// </summary> /// <param name="taskToAdd"></param> /// <returns></returns> public bool addTaskToDayTasks(TaskRelated.Task taskToAdd) { dayTasks.Add(taskToAdd); return(true); }
public TaskRelated.Task CreateTask(string description, string importantence) { TaskRelated.Task task = new TaskRelated.Task(description, importantence, false); return(task); }