private void BtnAdd_Click(object sender, RoutedEventArgs e) { if ((int)cmbListName.SelectedValue > 0 && !string.IsNullOrEmpty(txtName.Text) && !string.IsNullOrEmpty(dtDeatLine.Text)) { var result = Db.CreateToDo((int)cmbListName.SelectedValue, txtName.Text, txtDesc.Text, Convert.ToDateTime(dtDeatLine.Text)); if (result.Completed) { MessageBox.Show("Successful"); //Utils.GoBack(this); if (State.LastAction == ACTION.AddToDoFromToDoList) { ListToDo t = new ListToDo(State.LastListId); t.Show(); } else if (State.LastAction == ACTION.AddToDoFromListList) { ListList l = new ListList(); l.Show(); } else { IndexToDo i = new IndexToDo(); i.Show(); } this.Close(); } } else { MessageBox.Show("You must entry more info!"); } }
private void Row_DoubleClick(object sender, RoutedEventArgs e) { DataGridRow row = sender as DataGridRow; int listId = ((FindToDo)row.DataContext).ListId; Utils.MarkTravel(this); ListToDo w = new ListToDo(listId); w.Show(); }