private void UpdateReminder() { try { var dbContext = new BaseDbContext(); UnitOfWork unitOfWork = new UnitOfWork(dbContext); int row = RemindersDataGrid.SelectedIndex; if (row != -1) { var ci = new DataGridCellInfo(RemindersDataGrid.Items[row], RemindersDataGrid.Columns[0]); var crow = ci.Column.GetCellContent(ci.Item) as TextBlock; var vrow = crow.Text; string cvrow = Convert.ToDateTime(vrow).ToString("yyyy-MM-dd"); ReminderWindow reminderWindow = new ReminderWindow(); reminderWindow.Login = Login; reminderWindow.VRow = cvrow; reminderWindow.Owner = this; reminderWindow.ShowDialog(); UpdateRemindersDG(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void AddReminderBtn_Click(object sender, RoutedEventArgs e) { ReminderWindow reminderWindow = new ReminderWindow(); reminderWindow.Login = Login; reminderWindow.Owner = this; reminderWindow.ShowDialog(); UpdateRemindersDG(); }