private void AddNewRow(ToDo CurrentToDo) { ListViewItem newItem = new ListViewItem(); newItem.SubItems.Add(CurrentToDo.Lp.ToString()); newItem.SubItems.Add(CurrentToDo.ToDoThing); newItem.SubItems.Add(CurrentToDo.Piority.ToString()); newItem.SubItems.Add(CurrentToDo.Group); newItem.SubItems.Add(CurrentToDo.Date.ToShortDateString()); lstvMainView.Items.Add(newItem); }
private void AddNewToDo() { ToDo newToDo = new ToDo(); newToDo.Lp = ToDoCollection.Count + 1; newToDo.ToDoThing = txtToDo.Text; newToDo.Piority = Convert.ToInt32(cmbPiority.Text); newToDo.Group = cmbGroup.Text; newToDo.Date = dateFinish.Value; ToDoCollection.Add(newToDo); MessageBox.Show("Dodano pomyślnie."); AddNewRow(newToDo); }
public static Color GetColorByToDo(ToDo toDo) { DateTime Now = DateTime.Now; if (DateDifference(toDo.Date, Now) > 0) { return Color.White; } else if ((int)DateDifference(toDo.Date, Now) == 0) { return Color.Orange; } else if (DateDifference(toDo.Date, Now) < 0) return Color.Red; return Color.White; }
private ToDoDetails GetSelectedObjectFromListDetails(string Lp,ToDo selectedItem) { int iLp = Convert.ToInt32(Lp); ToDoDetails SelectedObject =selectedItem.ToDoDetails.Find(x => x.Lp == iLp); return SelectedObject; }