public List <EnCuentasPorPagar> MostrarEnCuentaPorNombre(EnCuentasPorPagar PEntidad) { IDbConnection _Conexion = DBConexion.Conexion(); _Conexion.Open(); SqlCommand _comando = new SqlCommand("Consultar_Cuentas_Por_Pagar_Por_Nombre", _Conexion as SqlConnection); _comando.CommandType = CommandType.StoredProcedure; _comando.Parameters.Add(new SqlParameter("@FcNombreProveedor", PEntidad.FcNombreProveedor)); IDataReader _reader = _comando.ExecuteReader(); List <EnCuentasPorPagar> Lista = new List <EnCuentasPorPagar>(); while (_reader.Read()) { EnCuentasPorPagar _EnCuentas = new EnCuentasPorPagar(); _EnCuentas.FiIdProveedor = _reader.GetInt64(0); _EnCuentas.FcNombreProveedor = _reader.GetString(1); _EnCuentas.FiNoFactura = _reader.GetInt32(2); _EnCuentas.FDtFechaAdquisicion = _reader.GetString(3); _EnCuentas.FcProductoAdquirido = _reader.GetString(4); _EnCuentas.FdCantidad = _reader.GetDecimal(5);//Cambio de int64 a decimal _EnCuentas.FdTotalAPagar = _reader.GetDecimal(6); _EnCuentas.FcStatus = _reader.GetString(7); Lista.Add(_EnCuentas); } _Conexion.Close(); return(Lista); }
public int EliminarCuenta(EnCuentasPorPagar PEntidad) { IDbConnection _Conexion = DBConexion.Conexion(); _Conexion.Open(); SqlCommand _comando = new SqlCommand("Eliminar_Cuentas_Por_Pagar", _Conexion as SqlConnection); _comando.CommandType = CommandType.StoredProcedure; _comando.Parameters.Add(new SqlParameter("@FiIdProveedor", PEntidad.FiIdProveedor)); int Resultado = _comando.ExecuteNonQuery(); _Conexion.Close(); return(Resultado); }
public int AgregarCuentasPorPagar(EnCuentasPorPagar PEntidad) { IDbConnection _Conexion = DBConexion.Conexion(); _Conexion.Open(); SqlCommand _comando = new SqlCommand("Agregar_Cuentas_Por_Pagar", _Conexion as SqlConnection); _comando.CommandType = CommandType.StoredProcedure; _comando.Parameters.Add(new SqlParameter("@FcNombreProveedor", PEntidad.FcNombreProveedor)); _comando.Parameters.Add(new SqlParameter("@FiNoFactura", PEntidad.FiNoFactura)); _comando.Parameters.Add(new SqlParameter("@FdFechaAdquisicion", PEntidad.FDtFechaAdquisicion)); _comando.Parameters.Add(new SqlParameter("@FcProductoAdquirido", PEntidad.FcProductoAdquirido)); _comando.Parameters.Add(new SqlParameter("@FdCantidad", PEntidad.FdCantidad)); _comando.Parameters.Add(new SqlParameter("@FdTotalAPagar", PEntidad.FdTotalAPagar)); _comando.Parameters.Add(new SqlParameter("@FcStatus", PEntidad.FcStatus)); int Resultado = _comando.ExecuteNonQuery(); _Conexion.Close(); return(Resultado); }
public int EliminarCuentas(EnCuentasPorPagar _enCuentas) { return(_CuentasDal.EliminarCuenta(_enCuentas)); }
public int ModificarCuentas(EnCuentasPorPagar _enCuentas) { return(_CuentasDal.ModificarCuenta(_enCuentas)); }
public List <EnCuentasPorPagar> MostrarCuentasPorNombre(EnCuentasPorPagar _enCuentas) { return(_CuentasDal.MostrarEnCuentaPorNombre(_enCuentas)); }
EnCuentasPorPagar _enCuentas = new EnCuentasPorPagar(); //Creacion de la instancia EN public int AgregarCuentasPorPagar(EnCuentasPorPagar _enCuentas) { return(_CuentasDal.AgregarCuentasPorPagar(_enCuentas)); }