Exemplo n.º 1
0
        private void LoadUCDataList()
        {
            _uCListEntidad = new UC_ListCasa(LocalDataStore.ListCasa);
            var ucListEntidad = _uCListEntidad as UC_ListCasa;

            SetUCActual(ucListEntidad);
            HelpContentVisual.ListenExpanded(exp_Infraestructura, exp_Servicios, exp_Fotos);
            SubscriveEventHandlers();
        }
 public UCEdificio(ControladorUserControls controlerUserControls, Grid parentContainer)
 {
     InitializeComponent();
     LoadUCDataList();
     _controlerUserControls = controlerUserControls;
     _parentContainer       = parentContainer;
     HelpContentVisual.ListenExpanded(exp_Informacion, exp_Fotos);
     SubscriveMenuLateralEventHandlers();
     SubscriveEventHandlers(_uCListEntidad);
 }
 void UC_DetalleInfraestructura_Loaded(object sender, RoutedEventArgs e)
 {
     this._listExpander = new List <Expander>();
     HelpContentVisual.GetListChild <Expander>(lbx_DataList, _listExpander, "expander");
     HelpContentVisual.ListenExpanded(_listExpander);
     foreach (var item in _listExpander)
     {
         ListBox lbx = item.FindName("lbx_childExpander") as ListBox;
         lbx.ItemsSource = LocalDataStore.GetInfraestructuraDetalle(item.Tag.ToString());
     }
 }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button      b_ok            = sender as Button;
            ListBox     lbxInfraDetalle = currentExpander.FindName("lbx_childExpander") as ListBox;
            List <Grid> temp            = new List <Grid>();

            HelpContentVisual.GetListChild <Grid>(lbxInfraDetalle, temp, "grid");
            Grid     gridfound     = temp.Find(G => G.Tag.ToString() == b_ok.Tag.ToString());
            CheckBox checkSelected = gridfound.FindName("chbx_DetalleInfra") as CheckBox;

            if (!(bool)checkSelected.IsChecked)
            {
                MessageBox.Show("Selecione un opcion");
                return;
            }

            ComboBox     combo = gridfound.FindName("cbx_Numbers") as ComboBox;
            ComboBoxItem elem  = combo.SelectedValue as ComboBoxItem;

            if (elem == null)
            {
                MessageBox.Show("Selecione una cantidad", "", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return;
            }

            var containerItem = lbxInfraDetalle.FindName("Grid_ContainerItem");

            foreach (Model.Infraestructura_Detalle infra in lbxInfraDetalle.Items)
            {
                if (b_ok.Tag.ToString() == infra.Id)
                {
                    _infraDetalleSelected = infra;
                    break;
                }
            }


            Model.Infraestructura_Apartamento nuevoInfraApartamento = new Model.Infraestructura_Apartamento();
            nuevoInfraApartamento.Id_Apartamento    = _id_Apartamento;
            nuevoInfraApartamento.Cantidad          = Convert.ToInt16(elem.Content);
            nuevoInfraApartamento.Id_Infrac_Detalle = _infraDetalleSelected.Id;
            if (LocalDataStore.GuardarInfraestructuraApartamento(nuevoInfraApartamento))
            {
                MessageBox.Show("Se guardo exitosamente", "Registro de Infraestructura", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                MessageBox.Show("No se guardo", "Registro de Infraestructura", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }
        }
Exemplo n.º 5
0
        private void SetServicioSelectedFromListBox()
        {
            List <Model.Servicios> _listItemsSelected = lbx_DataList.ItemsSource as List <Model.Servicios>;

            ListServiciosSelected = new List <Model.Servicios>();
            _listCheckBoxes.Clear();
            HelpContentVisual.GetListChild <CheckBox>(lbx_DataList, _listCheckBoxes, "checkBox");
            foreach (CheckBox item in _listCheckBoxes.FindAll(P => P.IsChecked == true))
            {
                var elemFound = _listItemsSelected.Find(P => P.Id == item.Tag.ToString());
                if (elemFound != null)
                {
                    ListServiciosSelected.Add(new Model.Servicios()
                    {
                        Id          = elemFound.Id,
                        Nombre      = elemFound.Nombre,
                        Descripcion = elemFound.Descripcion,
                        Tipo        = elemFound.Tipo,
                    });
                }
            }
        }
 void UC_ListInfraestructura_Loaded(object sender, RoutedEventArgs e)
 {
     _listCheckBoxes = new List <CheckBox>();
     HelpContentVisual.GetListChild <CheckBox>(lbx_DataList, _listCheckBoxes, "checkBox");
 }
Exemplo n.º 7
0
 void UC_ListServicios_Loaded(object sender, RoutedEventArgs e)
 {
     tb_Title.Text   = "Apartamento  -  " + _id_apartamento;
     _listCheckBoxes = new List <CheckBox>();
     HelpContentVisual.GetListChild <CheckBox>(lbx_DataList, _listCheckBoxes, "checkBox");
 }
 private void StartUserControl()
 {
     SetUCList(_uCListEntidad as UC_ListApartamento);
     HelpContentVisual.ListenExpanded(exp_Infraestructura, exp_Servicios, exp_Fotos);
     SubscriveEventHandlers();
 }