예제 #1
0
        public void saveArticulo()
        {
            CategoriaDataMapper catDM = new CategoriaDataMapper();
            MarcaDataMapper     marDM = new MarcaDataMapper();
            ModeloDataMapper    modDM = new ModeloDataMapper();
            EquipoDataMapper    equDM = new EquipoDataMapper();

            catDM.insertElement(new CATEGORIA()
            {
                UNID_CATEGORIA = this._categoria.UNID_CATEGORIA, IS_MODIFIED = true, IS_ACTIVE = true, CATEGORIA_NAME = this._categoria.CATEGORIA_NAME
            }, this.ActualUser);
            marDM.insertElement(new MARCA()
            {
                UNID_MARCA = this._marca.UNID_MARCA, IS_ACTIVE = true, IS_MODIFIED = true, MARCA_NAME = this._marca.MARCA_NAME
            }, this.ActualUser);
            modDM.insertElement(new MODELO()
            {
                UNID_MODELO = this._modelo.UNID_MODELO, IS_ACTIVE = true, IS_MODIFIED = true, MODELO_NAME = this._modelo.MODELO_NAME
            }, this.ActualUser);
            equDM.insertElement(new EQUIPO()
            {
                UNID_EQUIPO = this._equipo.UNID_EQUIPO, IS_ACTIVE = true, IS_MODIFIED = true, EQUIPO_NAME = this._equipo.EQUIPO_NAME
            }, this.ActualUser);

            if (_dataMapper != null)
            {
                _dataMapper.insertElement(new ARTICULO()
                {
                    IS_ACTIVE = true, ARTICULO1 = this._articuloName, UNID_CATEGORIA = this._categoria.UNID_CATEGORIA, UNID_EQUIPO = this._equipo.UNID_EQUIPO, UNID_MODELO = this._modelo.UNID_MODELO, UNID_MARCA = this._marca.UNID_MARCA
                }, this.ActualUser);
            }
        }
예제 #2
0
 public EquipoModel(IDataMapper dataMapper)
 {
     if ((dataMapper as EquipoDataMapper) != null)
     {
         this._dataMapper = dataMapper as EquipoDataMapper;
     }
 }
예제 #3
0
 public EquipoModel(IDataMapper dataMapper, USUARIO u)
 {
     if ((dataMapper as EquipoDataMapper) != null)
     {
         this._dataMapper = dataMapper as EquipoDataMapper;
     }
     this.ActualUser = u;
 }
예제 #4
0
        public void GetJsonEquipoTest()
        {
            EquipoDataMapper target   = new EquipoDataMapper(); // TODO: Inicializar en un valor adecuado
            string           expected = string.Empty;           // TODO: Inicializar en un valor adecuado
            string           actual;

            actual = target.GetJsonEquipo();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Compruebe la exactitud de este método de prueba.");
        }
예제 #5
0
        public void insertElementTest()
        {
            EquipoDataMapper target  = new EquipoDataMapper(); // TODO: Inicializar en un valor adecuado
            object           element = null;                   // TODO: Inicializar en un valor adecuado
            EQUIPO           equipo  = new EQUIPO();

            equipo.EQUIPO_NAME = "iPhone 4S Blanco";
            target.insertElement(equipo);
            element = target.getElements();
            Assert.Inconclusive("Un método que no devuelve ningún valor no se puede comprobar.");
        }
예제 #6
0
        public void GetArticuloEquipoByCategoriaTest()
        {
            EquipoDataMapper target    = new EquipoDataMapper(); // TODO: Inicializar en un valor adecuado
            CATEGORIA        categoria = new CATEGORIA()
            {
                UNID_CATEGORIA = 20121112172549418
            };                                        // TODO: Inicializar en un valor adecuado
            FixupCollection <EQUIPO> expected = null; // TODO: Inicializar en un valor adecuado
            FixupCollection <EQUIPO> actual;

            actual = target.GetArticuloEquipoByCategoria(categoria);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Compruebe la exactitud de este método de prueba.");
        }
예제 #7
0
 public CatalogEquipoViewModel()
 {
     try
     {
         IDataMapper dataMapper = new EquipoDataMapper();
         this._catalogEquipoModel = new CatalogEquipoModel(dataMapper);
     }
     catch (ArgumentException a)
     {
         ;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #8
0
        public string downloadEquipo(long?lastModifiedDate)
        {
            string respuesta = null;

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

                respuesta = dataMapper.GetJsonEquipo(lastModifiedDate);

                if (String.IsNullOrEmpty(respuesta))
                {
                    respuesta = null;
                }
            }
            return(respuesta);
        }
        public void getElement2()
        {
            ITEM aux = new ITEM();

            aux.SKU          = this.Sku;
            aux.NUMERO_SERIE = this.NumeroSerie;
            this.Error       = "";

            ITEM res = (this._dataMapper.getElement(aux)) as ITEM;

            this.init();
            if (res != null)
            {
                this._unidItem                = res.UNID_ITEM;
                this.NumeroSerie              = res.NUMERO_SERIE;
                this.Sku                      = res.SKU;
                this.ItemStatus               = res.ITEM_STATUS;
                this.FacturaDetalle           = res.FACTURA_DETALLE;
                this.CostoUnitario            = res.COSTO_UNITARIO;
                this.PedimentoExpo            = res.PEDIMENTO_EXPO;
                this.PedimentoImpo            = res.PEDIMENTO_IMPO;
                this.CantidadItem             = res.CANTIDAD;
                this.Propiedad                = res.PROPIEDAD;
                this.Proveedor.UNID_PROVEEDOR = res.FACTURA_DETALLE.FACTURA.PROVEEDOR.UNID_PROVEEDOR;
                this.Proveedor.PROVEEDOR_NAME = res.FACTURA_DETALLE.FACTURA.PROVEEDOR.PROVEEDOR_NAME;

                this.FacturaDetalle = res.FACTURA_DETALLE;

                foreach (DeleteFacturaDetalleModel d in this.Detalles)
                {
                    if (this.FacturaDetalle != null)
                    {
                        if (d.UNID_FACTURA_DETALE == this.FacturaDetalle.UNID_FACTURA_DETALE)
                        {
                            this.FacturaDetalle = d;
                        }
                    }
                    else
                    {
                        this.FacturaDetalle = new FACTURA_DETALLE();
                    }
                }

                CategoriaDataMapper datacat = new CategoriaDataMapper();
                CATEGORIA           auxcat  = datacat.getElementByArticulo(res.ARTICULO);

                this.Categoria = auxcat;
                this.Articulo  = res.ARTICULO;

                List <EQUIPO> auxEquipo = new List <EQUIPO>();
                auxEquipo.Add(new EQUIPO());
                auxEquipo[0].UNID_EQUIPO = this.Articulo.UNID_EQUIPO;
                EquipoDataMapper eq = new EquipoDataMapper();
                auxEquipo   = (List <EQUIPO>)eq.getElement(auxEquipo[0]);
                this.Equipo = auxEquipo[0];
            }
            else
            {
                this.Error = "El número de serie o SKU no existe";
            }
        }