Пример #1
0
        private ObservableCollection <ARTICULO> GetArticulosByCategoria(CATEGORIA categoria)
        {
            ObservableCollection <ARTICULO> articuloModels = new ObservableCollection <ARTICULO>();

            try
            {
                ArticuloDataMapper artDataMapper = new ArticuloDataMapper();
                List <ARTICULO>    articulos     = (List <ARTICULO>)artDataMapper.getElementsByCategoria(new CATEGORIA()
                {
                    UNID_CATEGORIA = categoria.UNID_CATEGORIA
                });

                articulos.ForEach(o => articuloModels.Add(new ARTICULO()
                {
                    UNID_ARTICULO = o.UNID_ARTICULO
                    ,
                    ARTICULO1 = o.ARTICULO1
                }));
            }
            catch (Exception)
            {
                ;
            }

            return(articuloModels);
        }
Пример #2
0
 public ArticuloModel(IDataMapper dataMapper, USUARIO u)
 {
     if ((dataMapper as ArticuloDataMapper) != null)
     {
         this._dataMapper = dataMapper as ArticuloDataMapper;
     }
     this.ActualUser = u;
 }
        public void LastModifiedDateTest()
        {
            ArticuloDataMapper target   = new ArticuloDataMapper(); // TODO: Inicializar en un valor adecuado
            Nullable <long>    expected = 12345;                    // TODO: Inicializar en un valor adecuado
            Nullable <long>    actual;

            actual = target.LastModifiedDate();
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Compruebe la exactitud de este método de prueba.");
        }
        public void GetJsonArticuloTest()
        {
            ArticuloDataMapper target   = new ArticuloDataMapper(); // TODO: Inicializar en un valor adecuado
            string             expected = string.Empty;             // TODO: Inicializar en un valor adecuado
            string             actual;

            actual = target.GetJsonArticulo();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Compruebe la exactitud de este método de prueba.");
        }
Пример #5
0
        private ObservableCollection <ArticuloModel> GetArticulosByCategoria(CategoriaModel categoria)
        {
            ObservableCollection <ArticuloModel> articuloModels = new ObservableCollection <ArticuloModel>();

            try
            {
                ArticuloDataMapper artDataMapper = new ArticuloDataMapper();
                List <ARTICULO>    articulos     = (List <ARTICULO>)artDataMapper.getElementsByCategoria(new CATEGORIA()
                {
                    UNID_CATEGORIA = categoria.UnidCategoria
                });

                articulos.ForEach(o => articuloModels.Add(new ArticuloModel()
                {
                    UnidArticulo = o.UNID_ARTICULO
                    ,
                    ArticuloName = o.ARTICULO1
                    ,
                    EquipoModel = new EquipoModel(new EquipoDataMapper())
                    {
                        UnidEquipo = o.EQUIPO.UNID_EQUIPO
                        ,
                        EquipoName = o.EQUIPO.EQUIPO_NAME
                    }
                    ,
                    Categoria = new CATEGORIA()
                    {
                        CATEGORIA_NAME = o.CATEGORIA.CATEGORIA_NAME
                        ,
                        UNID_CATEGORIA = o.CATEGORIA.UNID_CATEGORIA
                    }
                    ,
                    Marca = new MARCA()
                    {
                        UNID_MARCA = o.MARCA.UNID_MARCA
                        ,
                        MARCA_NAME = o.MARCA.MARCA_NAME
                    },
                    Modelo = new MODELO()
                    {
                        UNID_MODELO = o.MODELO.UNID_MODELO
                        ,
                        MODELO_NAME = o.MODELO.MODELO_NAME
                    }
                }));
            }
            catch (Exception)
            {
                ;
            }

            return(articuloModels);
        }
        public void insertElementTest()
        {
            ArticuloDataMapper target  = new ArticuloDataMapper(); // TODO: Inicializar en un valor adecuado
            object             element = null;                     // TODO: Inicializar en un valor adecuado
            ARTICULO           modelo  = new ARTICULO();

            modelo.ARTICULO1      = "Tableta";
            modelo.UNID_CATEGORIA = 20121106130238876;
            modelo.UNID_EQUIPO    = 2012110512571408;
            modelo.UNID_MARCA     = 20121105123017071;
            modelo.UNID_MODELO    = 20121106125528552;
            target.insertElement(modelo);
            element = target.getElements();
            Assert.Inconclusive("Un método que no devuelve ningún valor no se puede comprobar.");
        }
 public CatalogArticuloViewModel()
 {
     try
     {
         IDataMapper dataMapper = new ArticuloDataMapper();
         this._catalogArticuloModel = new CatalogArticuloModel(dataMapper);
     }
     catch (ArgumentException ae)
     {
         ;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #8
0
        public string downloadArticulo(long?lastModifiedDate)
        {
            string respuesta = null;

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

                respuesta = dataMapper.GetJsonArticulo(lastModifiedDate);

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

            return(respuesta);
        }
        public void loadItems(CATEGORIA cc)
        {
            ArticuloDataMapper aa      = new ArticuloDataMapper();
            object             element = aa.getElementsByCategoria(cc);

            FixupCollection <DeleteArticulo> ic = new FixupCollection <DeleteArticulo>();

            if (element != null)
            {
                if (((List <ARTICULO>)element).Count > 0)
                {
                    foreach (ARTICULO item in (List <ARTICULO>)element)
                    {
                        DeleteArticulo aux = new DeleteArticulo(item);
                        //item.IsChecked = false;
                        ic.Add(aux);
                    }
                }
            }
            this.Articulos = ic;
        }