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 GetDataServiceGym() { var listServiceGym = _serviceGymRepository.GetAllServiceGymViewModel(); ServiceGymId.ItemsSource = listServiceGym; ServiceGymId.DisplayMemberPath = "Name"; ServiceGymId.SelectedValuePath = "Id"; var clients = _clientRepository.GetAllClientViewModel(); var listclients = new List <ClientViewModel>(); foreach (var i in clients) { listclients.Add(new ClientViewModel() { Id = i.Id, Name = i.Identification + " - " + i.Name + " " + i.LastName + " " + i.SecondSurName }); } ClientId.ItemsSource = null; ClientId.ItemsSource = listclients; ClientId.DisplayMemberPath = "Name"; ClientId.SelectedValuePath = "Id"; }