public InfraestructuraModel(IDataMapper dataMapper, USUARIO u)
 {
     if ((dataMapper as InfraestructuraDataMapper) != null)
     {
         this._dataMapper = dataMapper as InfraestructuraDataMapper;
     }
     this.ActualUser = u;
 }
        public SalidaRevisionViewModel(MovimientoGridSalidaRevisionViewModel salida)
        {
            try
            {
                IDataMapper dataMapper   = new SolicitanteDataMapper();
                IDataMapper dataMapper2  = new AlmacenDataMapper();
                IDataMapper dataMapper3  = new ProveedorDataMapper();
                IDataMapper dataMapper4  = new ClienteDataMapper();
                IDataMapper dataMapper5  = new ServicioDataMapper();
                IDataMapper dataMapper6  = new TipoPedimentoDataMapper();
                IDataMapper dataMapper7  = new TransporteDataMapper();
                IDataMapper dataMapper8  = new TecnicoDataMapper();
                IDataMapper datamapper11 = new EmpresaDataMapper();
                IDataMapper dataMapper9  = new InfraestructuraDataMapper();

                this._catalogInfraestructuraModel = new CatalogInfraestructuraModel(dataMapper9);
                this._catalogEmpresaModel         = new CatalogEmpresaModel(datamapper11);
                this._catalogSolicitanteModel     = new CatalogSolicitanteModel(dataMapper);
                this._movimientoModel             = new MovimientoSalidasModel(new MovimientoDataMapper(), salida.ActualUser);
                TIPO_MOVIMIENTO mov = new TIPO_MOVIMIENTO();
                mov.UNID_TIPO_MOVIMIENTO             = 10;
                this._movimientoModel.TipoMovimiento = mov;
                this._movimientoSalida = salida;
                this._movimientoModel.PropertyChanged += OnPropertyChanged2;
                this._itemModel = new CatalogItemModel(new ItemDataMapper());
                this._catalogAlmacenDestinoModel     = new CatalogAlmacenModel(dataMapper2);
                this._catalogAlmacenProcedenciaModel = new CatalogAlmacenModel(dataMapper2);
                this._catalogProveedorDestinoModel   = new CatalogProveedorModel(dataMapper3);
                this._catalogClienteDestinoModel     = new CatalogClienteModel(dataMapper4);
                this._catalogServicioModel           = new CatalogServicioModel(dataMapper5);
                this._catalogTipoPedimentoModel      = new CatalogTipoPedimentoModel(dataMapper6);
                this._catalogTransporteModel         = new CatalogTransporteModel(dataMapper7);
                this._catalogClienteModel            = new CatalogClienteModel(dataMapper4);
                this._catalogTecnicoModel            = new CatalogTecnicoModel(dataMapper8);

                //Asignaciones especiales para los combos
                this._movimientoModel.Empresa            = _catalogEmpresaModel.Empresa[0];
                this._movimientoModel.Solicitante        = _catalogSolicitanteModel.Solicitante[0];
                this._movimientoModel.AlmacenProcedencia = _catalogAlmacenProcedenciaModel.Almacen[0];
                this._movimientoModel.Tecnico            = _movimientoModel.Tecnicos[0];
                this._movimientoModel.Infraestructura    = _catalogInfraestructuraModel.Infraestructuras[0];
                this._IsEnabled = true;
            }
            catch (ArgumentException a)
            {
                ;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public CatalogInfraestructuraViewModel()
 {
     try
     {
         IDataMapper dataMapper = new InfraestructuraDataMapper();
         this._catalogInfraestructuraModel = new CatalogInfraestructuraModel(dataMapper);
     }
     catch (ArgumentException ae)
     {
         ;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 4
0
        public string downloadInfraestructura(long?lastModifiedDate)
        {
            string respuesta = null;

            if (lastModifiedDate != null)
            {
                InfraestructuraDataMapper dataMapper = new InfraestructuraDataMapper();

                respuesta = dataMapper.GetJsonInfraestructura(lastModifiedDate);

                if (String.IsNullOrEmpty(respuesta))
                {
                    respuesta = null;
                }
            }

            return(respuesta);
        }
Exemplo n.º 5
0
        public EntradaPorValidacionViewModel(InventoryApp.ViewModel.GridMovimientos.MovimientoGridEntradasViewModel grid)
        {
            try
            {
                IDataMapper dataMapper   = new SolicitanteDataMapper();
                IDataMapper dataMapper2  = new AlmacenDataMapper();
                IDataMapper dataMapper3  = new ProveedorDataMapper();
                IDataMapper dataMapper4  = new ClienteDataMapper();
                IDataMapper datamapper5  = new EmpresaDataMapper();
                IDataMapper datamapper9  = new InfraestructuraDataMapper();
                IDataMapper dataMapper10 = new ItemStatusDataMapper();

                this._catalogInfraestructuraModel = new CatalogInfraestructuraModel(datamapper9);
                this._catalogEmpresaModel         = new CatalogEmpresaModel(datamapper5);

                this._movimentoGridEntradas = grid;

                this._catalogSolicitanteModel = new CatalogSolicitanteModel(dataMapper);
                this._movimientoModel         = new MovimientoModel(new MovimientoDataMapper());
                TIPO_MOVIMIENTO mov = new TIPO_MOVIMIENTO();
                mov.UNID_TIPO_MOVIMIENTO             = 1;
                this._movimientoModel.TipoMovimiento = mov;
                this._itemModel           = new CatalogItemModel(new ItemDataMapper());
                this._catalogAlmacenModel = new CatalogAlmacenModel(dataMapper2);

                //Asignaciones especiales para los combos
                this._movimientoModel.Empresa         = _catalogEmpresaModel.Empresa[0];
                this._movimientoModel.Solicitante     = _catalogSolicitanteModel.Solicitante[0];
                this._movimientoModel.AlmacenDestino  = _catalogAlmacenModel.Almacen[0];
                this._movimientoModel.Tecnico         = _movimientoModel.Tecnicos[0];
                this._movimientoModel.Infraestructura = _catalogInfraestructuraModel.Infraestructuras[0];
                this._movimientoModel.ActualUser      = grid.ActualUser;
                this._IsEnabled = true;
            }
            catch (ArgumentException a)
            {
                ;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }