public DataSet ConsultarCompra(int id) { using (ServicioCompra comp = new ServicioCompra()) { return(comp.ConsultarCompra(id)); } }
public string InsertarCompra(int Id_Producto, DateTime Fecha_Compra, double precio_Compra) { Compra nuevaCompra = new Compra(Id_Producto, Fecha_Compra, precio_Compra); using (ServicioCompra laCom = new ServicioCompra()) return(laCom.IngresarCompra(nuevaCompra)); }
public string InsertarCompra(int Id_Compra, int Id_Producto, int Cantidad_Producto, double precio_Compra) { Compra nuevaCompra = new Compra(Id_Compra, Id_Producto, Cantidad_Producto, precio_Compra); using (ServicioCompra laCom = new ServicioCompra()) return(laCom.IngresarCompra(nuevaCompra)); }
public void Inicializar() { _mockRepositorioCompra = new Mock <IRepositorioCompra>(); _mockRepositorioDetalleCompra = new Mock <IRepositorioDetalleCompra>(); _mockRepositorioItem = new Mock <IRepositorioItem>(); _mockRepositorioProveedor = new Mock <IRepositorioProveedor>(); _servicio = new ServicioCompra(_mockRepositorioCompra.Object, _mockRepositorioDetalleCompra.Object, _mockRepositorioItem.Object, _mockRepositorioProveedor.Object); }
public Model() : base(FactoriesSingleton <T> .UnitOfWork, FactoriesSingleton <T> .GenericRepository) { ServicioUsuario = new ServicioUsuario(FactoriesSingleton <Usuario> .UnitOfWork, FactoriesSingleton <Usuario> .GenericRepository); ServicioCliente = new ServicioCliente(FactoriesSingleton <Cliente> .UnitOfWork, FactoriesSingleton <Cliente> .GenericRepository); ServicioDirección = new ServicioDirección(FactoriesSingleton <Dirección> .UnitOfWork, FactoriesSingleton <Dirección> .GenericRepository); ServicioTelefóno = new ServicioTelefóno(FactoriesSingleton <Telefóno> .UnitOfWork, FactoriesSingleton <Telefóno> .GenericRepository); ServicioMetodoPago = new ServicioMetodoPago(FactoriesSingleton <ClienteMetodoDePago> .UnitOfWork, FactoriesSingleton <ClienteMetodoDePago> .GenericRepository); ServicioCompra = new ServicioCompra(FactoriesSingleton <Compra> .UnitOfWork, FactoriesSingleton <Compra> .GenericRepository); ServicioCompraCliente = new ServicioCompraCliente(FactoriesSingleton <CompraCliente> .UnitOfWork, FactoriesSingleton <CompraCliente> .GenericRepository); }
public void Initialize() { servicioCompra = new ServicioCompra(FactoriesSingleton <Compra> .UnitOfWork, FactoriesSingleton <Compra> .GenericRepository); }
public static List <Compra> obtenerFacturasCompraPendientes(object[] pArgumentos) { List <Compra> resultado = new List <Compra>(); SqlDataReader dataReader = null; try { dataReader = SqlServer.Instance.traerDataReader("obtenerFacturasCompraPendientes", pArgumentos); if (dataReader.HasRows) { while (dataReader.Read()) { Compra compra = new Compra(); compra.ID = Int32.Parse(dataReader[0].ToString()); compra.Consecutivo = Int32.Parse(dataReader[1].ToString()); compra.Fecha = DateTime.Parse(dataReader[2].ToString()); compra.Total = Double.Parse(dataReader[3].ToString()); compra.Impuesto = Double.Parse(dataReader[4].ToString()); compra.TotalJunto = Double.Parse(dataReader[5].ToString()); compra.TipoCompra = dataReader[6].ToString(); compra.Moneda = new Moneda { Nombre = dataReader[7].ToString(), Codigo = dataReader[8].ToString() }; compra.Proveedor = new Socio { Nombre = dataReader[9].ToString(), Codigo = dataReader[10].ToString() }; compra.Proyecto = new Proyecto { Nombre = dataReader[11].ToString(), Codigo = dataReader[12].ToString() }; resultado.Add(compra); } } for (int contador = 0; contador < resultado.Count; contador++) { dataReader.Close(); List <ServicioCompra> lineas = new List <ServicioCompra>(); dataReader = SqlServer.Instance.traerDataReader("obtenerServiciosXCompra", resultado[contador].ID); if (dataReader.HasRows) { while (dataReader.Read()) { //S.Nombre, S.Descripcion, S.Cantidad, S.Precio, S.Total, S.Impuesto, S.TotalImpuesto ServicioCompra lineaCompra = new ServicioCompra(); lineaCompra.Nombre = dataReader[0].ToString(); lineaCompra.Descripcion = dataReader[1].ToString(); lineaCompra.Cantidad = Int32.Parse(dataReader[2].ToString()); lineaCompra.Precio = Double.Parse(dataReader[3].ToString()); lineaCompra.Total = Double.Parse(dataReader[4].ToString()); lineaCompra.Impuesto = Double.Parse(dataReader[5].ToString()); lineaCompra.TotalImpuesto = Double.Parse(dataReader[6].ToString()); lineas.Add(lineaCompra); } } resultado[contador].Servicios = lineas; } } catch (Exception ex) { throw new Exception(ex.Message); } finally { SqlServer.Instance.CerrarConexion(); } return(resultado); }
public DataTable ListarCompra() { using (ServicioCompra laCompra = new ServicioCompra()) return(laCompra.ListarCompra()); }