コード例 #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);
        }
コード例 #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);
        }
コード例 #3
0
        public void GetProduct()
        {
            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<PRODUCTO>(ds);
            service.Desconectar();
            Assert.Greater(list.Count, 0);
        }