private void ButtonAdd_Click(object sender, RoutedEventArgs e) { var form = new AddEditDayCost(DatePickerDate.SelectedDate.Value); form.ShowDialog(); if (form.Date != null) { FillDataGrid(form.Date.Value); } }
private void ButtonEdit_OnClick(object sender, RoutedEventArgs e) { var infoCost = DataGridCurrentDateCosts.SelectedItem as InfoCost; var form = new AddEditDayCost(infoCost.Date, infoCost.Id); form.ShowDialog(); if (form.Date != null) { FillDataGrid(form.Date.Value); } }