private void AddServiceButtonClick(object sender, RoutedEventArgs e) { ServiceAddEdit serviceAddEdit = new ServiceAddEdit(ServiceAddEdit.OpenMode.Add); serviceAddEdit.ShowDialog(); serviceListView.ItemsSource = DBContext.Service.ToList(); }
private void EditServiceButtonClick(object sender, RoutedEventArgs e) { if (serviceListView.SelectedItem is Service selectedService) { ServiceAddEdit serviceAddEdit = new ServiceAddEdit(selectedService) { ServiceName = selectedService.Name, ServiceDescription = selectedService.Descriotion, ServicePrice = Convert.ToString(selectedService.Price), ServicePhoto = selectedService.Photo }; serviceAddEdit.ShowDialog(); serviceListView.ItemsSource = DBContext.Service.ToList(); } }