本文整理汇总了C#中DataService.Conectar方法的典型用法代码示例。如果您正苦于以下问题:C# DataService.Conectar方法的具体用法?C# DataService.Conectar怎么用?C# DataService.Conectar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataService
的用法示例。
在下文中一共展示了DataService.Conectar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetProductWithStored
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: GetLineaDTO
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: NewLinea2DTO
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);
}