private void BtnAdd_Click(object sender, RoutedEventArgs e) { try { var form = new OrdersForm(_service); form.ShowDialog(); FillGrids(); } catch (Exception ex) { FormHelper.MessageError(ex); } }
private void BtnUpdate_Click(object sender, RoutedEventArgs e) { try { var orderTemp = gridOrders.SelectedItem as OrderInput; if (orderTemp is null) { return; } var order = _service.Get(orderTemp.Id); var form = new OrdersForm(_service, order); form.ShowDialog(); FillGrids(); } catch (Exception ex) { FormHelper.MessageError(ex); } }