Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public int EliminarCuentas(EnCuentasPorPagar _enCuentas)
 {
     return(_CuentasDal.EliminarCuenta(_enCuentas));
 }
Exemplo n.º 5
0
 public int ModificarCuentas(EnCuentasPorPagar _enCuentas)
 {
     return(_CuentasDal.ModificarCuenta(_enCuentas));
 }
Exemplo n.º 6
0
 public List <EnCuentasPorPagar> MostrarCuentasPorNombre(EnCuentasPorPagar _enCuentas)
 {
     return(_CuentasDal.MostrarEnCuentaPorNombre(_enCuentas));
 }
Exemplo n.º 7
0
        EnCuentasPorPagar _enCuentas   = new EnCuentasPorPagar();  //Creacion de la instancia EN

        public int AgregarCuentasPorPagar(EnCuentasPorPagar _enCuentas)
        {
            return(_CuentasDal.AgregarCuentasPorPagar(_enCuentas));
        }