private void lbx_DataList_SelectionChanged(object sender, EventArgs e) { SelectionChangedEventArgs eSelection = e as SelectionChangedEventArgs; Model.Apartamento apartamentSelected = eSelection.AddedItems[0] as Model.Apartamento; lbx_Infraestructura.ItemsSource = LocalDataStore.GetViewDetailInfraestructura(apartamentSelected); lbx_Servicios.ItemsSource = LocalDataStore.GetViewDetailServicio(apartamentSelected); exp_Fotos.Content = new UC_ViewFotos(LocalDataStore.GetFotoApartamentOf(apartamentSelected)); //lbx_FotosApart.ItemsSource = LocalDataStore.GetFotoApartamentOf(apartamentSelected); }
public static bool GuardarApartamento(Model.Apartamento apartamento) { string response = ServicesManager.Instance.ServiceClient.GuardarApartamento(apartamento); if (response != "") { apartamento.Id = response; _listApartament.Add(apartamento); return(true); } return(false); }
public static IEnumerable <InfoServicioApartamento> GetViewDetailServicio(Model.Apartamento apartamento) { var queryResult = (from a in ListApartament where a.Id == apartamento.Id join sa in ListServicioApartamento on a.Id equals sa.Id_Apartemento join s in ListServicios on sa.Id_Servicio equals s.Id select new InfoServicioApartamento() { Descripcion = s.Descripcion, IdApartament = a.Id, IdSApartamento = sa.Id_Servicio, NombreServicio = s.Nombre, TipoServicio = s.Tipo }); return(queryResult); }
public static List <InfoCategoriaFoto> GetFotoApartamentOf(Model.Apartamento apartamento) { List <Model.Infraestructura_Detalle> ListInfraDetalle = new List <Model.Infraestructura_Detalle>(); DictionaryInfraestructura.Values.ToList().ForEach(LD => ListInfraDetalle.AddRange(LD)); var queryResult = (from fa in ListFotoApartament where fa.Id_Apartamento == apartamento.Id join id in ListInfraDetalle on fa.Id_Infra_Detalle equals id.Id select new InfoGeneralFoto() { Id = fa.Id, Descripcion = fa.Descripcion, Foto = fa.Foto, Infraestructura = id.Descripcion }); return(GetListCategoriaFoto(queryResult)); }
public void Aceptar(object sender, EventArgs e) { Model.Apartamento nuevoApartamento = new Model.Apartamento(); nuevoApartamento.Id_Edificio = _idEdificio; nuevoApartamento.N_Piso = int.Parse(txt_N_Piso.Text); nuevoApartamento.N_Puerta = int.Parse(txt_N_Puerta.Text); nuevoApartamento.Bloque = GetBloqueChecked(); bool response = LocalDataStore.GuardarApartamento(nuevoApartamento); if (response == true) { MessageBox.Show("El registro fue exitoso", "Añadir nuevo Apartamento", MessageBoxButton.OK, MessageBoxImage.Information); //_lbx_dataList.Items.Refresh(); _lbx_dataList.ItemsSource = LocalDataStore.GetApartamentsOf(_idEdificio); } else { MessageBox.Show("El registro no fue agregado", "Añadir nuevo Apartamento", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }
/// <summary> /// Reunimos los dato mas relevantes agregando a una clase info para posteriormento enlasarlo a un ListBox /// </summary> /// <param name="apartamento"></param> /// <returns></returns> public static IEnumerable <InfoInfraestructuraApartamento> GetViewDetailInfraestructura(Model.Apartamento apartamento) { var queryResult = (from a in ListApartament where a.Id == apartamento.Id join ia in ListInfraestructuraApartament on a.Id equals ia.Id_Apartamento join id in GetInfraestructuraDetalle() on ia.Id_Infrac_Detalle equals id.Id join i in ListInfraestructura on id.Id_Infra equals i.Id select new InfoInfraestructuraApartamento() { Cantidad = ia.Cantidad, IdApartament = a.Id, DescripcionInfraestructura = id.Descripcion, IdIDetalle = id.Id, NombreInfraestructura = i.Nombre, TamanoInfraestructura = id.Tamano }); return(queryResult); }