示例#1
0
        private void AddServiceButtonClick(object sender, RoutedEventArgs e)
        {
            ServiceAddEdit serviceAddEdit = new ServiceAddEdit(ServiceAddEdit.OpenMode.Add);

            serviceAddEdit.ShowDialog();
            serviceListView.ItemsSource = DBContext.Service.ToList();
        }
示例#2
0
 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();
     }
 }