private void GetServiceGymTypeEdit(int id) { var serviceGymType = _serviceGymTypeRepository.GetServiceGymTypeByIdViewModel(id); Type.Text = serviceGymType.Type; Id.Text = serviceGymType.Id.ToString(); }
private void DeleteServiceGymType_Click(object sender, RoutedEventArgs e) { var salir = MessageBox.Show("You want delete this item servicegym type.", "KallpaBox", MessageBoxButton.YesNoCancel); if (salir == MessageBoxResult.Yes) { var serviceGymTypeViewModel = _serviceGymTypeRepository.GetServiceGymTypeByIdViewModel(_serviceGymTypeId); try { if (serviceGymTypeViewModel != null) { _serviceGymTypeRepository.DeleteServiceGymTypeViewModel(serviceGymTypeViewModel.Id, serviceGymTypeViewModel); } (Application.Current.MainWindow.FindName("KallpaBoxContent") as Frame).Content = new ServiceGymTypesList(); } catch (Exception) { throw; } } }
private void GetDataGrid() { var list = new List <ServiceGymViewModel>(); var listServiceGyms = _serviceGymRepository.GetAllServiceGymViewModel(); foreach (var i in listServiceGyms) { var ServiceGymserviceGymType = _serviceGymTypeRepository.GetServiceGymTypeByIdViewModel(i.ServiceGymTypeId); var serviceGymType = new ServiceGymType() { Id = ServiceGymserviceGymType.Id, Type = ServiceGymserviceGymType.Type }; i.ServiceGymType = serviceGymType; list.Add(i); } DataGridServiceGyms.ItemsSource = list; this.DataGridServiceGyms.UpdateLayout(); }
private void GetServiceGymType(int?serviceGymTypeId) { var serviceGymTypeViewModel = _serviceGymTypeRepository.GetServiceGymTypeByIdViewModel(serviceGymTypeId); Type.Content = serviceGymTypeViewModel.Type; }