Exemplo n.º 1
0
        public void GetProductWithStored()
        {
            var service = new DataService();
            service.Conectar();
            var ds = service.ExecuteDataSet("GetProduct", CommandType.StoredProcedure, new Dictionary<string, object> { { "@IdProduct", 1 } });
            ds.Relations.Add("ProductoLinea", ds.Tables[0].Columns["Id"], ds.Tables[1].Columns["IdProducto"]);

            var mapper = new GenericMap();
            var list = mapper.MapListFromDataSet<PRODUCTO>(ds);
            service.Desconectar();
            Assert.Greater(list.Count, 0);
        }
Exemplo n.º 2
0
        public void GetLineaDTO()
        {
            var service = new DataService();
            service.Conectar();
            var ds = service.ExecuteDataSet("select * from linea where id = 1; Select * from producto where id in (select idproducto from linea where id = 1);");
            ds.Relations.Add("LineaProducto", ds.Tables[0].Columns["IdProducto"], ds.Tables[1].Columns["Id"]);

            var mapper = new GenericMap();
            var list = mapper.MapListFromDataSet<Line2DTO>(ds);
            service.Desconectar();
            Assert.Greater(list.Count, 0);
        }
Exemplo n.º 3
0
        public void NewLinea2DTO()
        {
            var service = new DataService();
            service.Conectar();
            var ds = service.ExecuteDataSet("select * from producto where id = 1; Select * from linea where Idproducto = 1; Select * from ALBARAN_LINEA where idlinea in (Select ID from linea where Idproducto = 1);");
            ds.Relations.Add("ProductoLinea", ds.Tables[0].Columns["Id"], ds.Tables[1].Columns["IdProducto"]);
            ds.Relations.Add("LineaLineaAlbaran", ds.Tables[1].Columns["Id"], ds.Tables[2].Columns["IdLinea"]);

            var mapper = new GenericMap();
            var list = mapper.MapListFromDataSet<ProductDTO>(ds);
            service.Desconectar();
            Assert.Greater(list.Count, 0);
        }