示例#1
0
        public List <EnVentas> MostrarEnVentasPorDiaDeSalida(EnVentas PEntidad)
        {
            IDbConnection _Conexion = DBConexion.Conexion();

            _Conexion.Open();
            SqlCommand _comando = new SqlCommand("Consultar_Ventas_Por_Dia", _Conexion as SqlConnection);

            _comando.CommandType = CommandType.StoredProcedure;
            _comando.Parameters.Add(new SqlParameter("@FDtFechaSalida", PEntidad.fDtFechaSalida));
            IDataReader     _reader = _comando.ExecuteReader();
            List <EnVentas> Lista   = new List <EnVentas>();

            while (_reader.Read())
            {
                EnVentas _EnVentas = new EnVentas();

                _EnVentas.fiIdVenta        = _reader.GetInt64(0);
                _EnVentas.fDtFechaSalida   = _reader.GetString(1);
                _EnVentas.fcNombreCliente  = _reader.GetString(2);
                _EnVentas.fcDomicilio      = _reader.GetString(3);
                _EnVentas.fcCiudad         = _reader.GetString(4);
                _EnVentas.fcTelefono       = _reader.GetString(5);
                _EnVentas.fcFechaPago      = _reader.GetString(6);
                _EnVentas.fiCantidad       = _reader.GetInt32(7);
                _EnVentas.fcConcepto       = _reader.GetString(8);
                _EnVentas.fdPrecioUnitario = _reader.GetDecimal(9);
                _EnVentas.fdImporte        = _reader.GetDecimal(10);
                _EnVentas.fdTotal          = _reader.GetDecimal(11);
                Lista.Add(_EnVentas);
            }
            _Conexion.Close();

            return(Lista);
        }
示例#2
0
        public int AgregarVenta(EnVentas PEntidad)
        {
            IDbConnection _Conexion = DBConexion.Conexion();

            _Conexion.Open();

            SqlCommand _comando = new SqlCommand("Agregar_Ventas", _Conexion as SqlConnection);

            _comando.CommandType = CommandType.StoredProcedure;
            // _comando.Parameters.Add(new SqlParameter("@fiIdVenta", PEntidad.fiIdVenta));
            _comando.Parameters.Add(new SqlParameter("@fDtFechaSalida", PEntidad.fDtFechaSalida));
            _comando.Parameters.Add(new SqlParameter("@fcNombreCliente", PEntidad.fcNombreCliente));
            _comando.Parameters.Add(new SqlParameter("@fcDomicilio", PEntidad.fcDomicilio));
            _comando.Parameters.Add(new SqlParameter("@fcCiudad", PEntidad.fcCiudad));
            _comando.Parameters.Add(new SqlParameter("@fcTelefono", PEntidad.fcTelefono));
            _comando.Parameters.Add(new SqlParameter("@fcFechaPago", PEntidad.fcFechaPago));
            _comando.Parameters.Add(new SqlParameter("@fiCantidad", PEntidad.fiCantidad));
            _comando.Parameters.Add(new SqlParameter("@fcConcepto", PEntidad.fcConcepto));
            _comando.Parameters.Add(new SqlParameter("@fdPrecioUnitario", PEntidad.fdPrecioUnitario));
            _comando.Parameters.Add(new SqlParameter("@fdImporte", PEntidad.fdImporte));
            _comando.Parameters.Add(new SqlParameter("@fdTotal", PEntidad.fdTotal));
            int Resultado = _comando.ExecuteNonQuery();

            _Conexion.Close();
            return(Resultado);
        }
示例#3
0
        public void llenarNota(EnVentas enVentas, DataGridView dgTotalProductos, string strTipoDeVenta, string TotalTipo)
        {
            string strTodosLosNombresDeProductos         = String.Empty;
            string strTodosLosPreciosDeProductosContado  = String.Empty;
            string strTodosLosPreciosDeProductosACredito = String.Empty;
            //string StrTodosLosPreciosDeProductos = String.Empty;
            string StrTodasLasCantidadesDeProductos = String.Empty;
            string strTodosLosPreciosUnitariosDeProductosContado = String.Empty; //Agregado para mandar los precios unitarios por producto de contado.. 21/03/19
            string strTodosLosPreciosUnitariosDeProductosCredito = String.Empty; //Agregado para mandar los precios unitarios por producto de credito.. 21/03/19

            txbFecha.Text      = enVentas.fDtFechaSalida.ToString();
            txtNombre.Text     = enVentas.fcNombreCliente.ToString();
            txtDomicilio.Text  = enVentas.fcDomicilio.ToString();
            txtCiudad.Text     = enVentas.fcCiudad.ToString();
            txtTelefono.Text   = enVentas.fcTelefono.ToString();
            txtFechaFinal.Text = enVentas.fcFechaPago.ToString();


            foreach (DataGridViewRow producto in dgTotalProductos.Rows)
            {
                strTodosLosPreciosDeProductosContado          = strTodosLosPreciosDeProductosContado + Environment.NewLine + producto.Cells[3].Value.ToString();
                strTodosLosPreciosDeProductosACredito         = strTodosLosPreciosDeProductosACredito + Environment.NewLine + producto.Cells[4].Value.ToString();
                StrTodasLasCantidadesDeProductos              = StrTodasLasCantidadesDeProductos + Environment.NewLine + producto.Cells[2].Value.ToString();
                strTodosLosNombresDeProductos                 = strTodosLosNombresDeProductos + Environment.NewLine + producto.Cells[1].Value.ToString();
                strTodosLosPreciosUnitariosDeProductosContado = strTodosLosPreciosUnitariosDeProductosContado + Environment.NewLine + producto.Cells[5].Value.ToString(); //Agregado para guardar los precios por producto de contado.. 21/03/19
                strTodosLosPreciosUnitariosDeProductosCredito = strTodosLosPreciosUnitariosDeProductosCredito + Environment.NewLine + producto.Cells[6].Value.ToString(); //Agregado para mandar los precios unitarios por producto de credito.. 21/03/19
            }

            txbUnidad.Text   = StrTodasLasCantidadesDeProductos;
            txbConcepto.Text = strTodosLosNombresDeProductos;
            //txbCantidad.Text = StrTodasLasCantidadesDeProductos;//No es la cantidad nuevamente sino los precios por producto.. 21/03/19..


            if (strTipoDeVenta.Equals("1"))//Venta al contado 21/03/19..
            {
                txtTotal.Text    = TotalTipo.ToString();
                txbImporte.Text  = strTodosLosPreciosDeProductosContado;
                txbCantidad.Text = strTodosLosPreciosUnitariosDeProductosContado; //Agregado haber que hace 21/03/19..
            }
            if (strTipoDeVenta.Equals("2"))                                       //Venta a Credito 21/03/19..
            {
                txtTotal.Text    = TotalTipo.ToString();
                txbImporte.Text  = strTodosLosPreciosDeProductosACredito;
                txbCantidad.Text = strTodosLosPreciosUnitariosDeProductosCredito;//Agregado haber que hace 21/03/19..
            }

            ShowDialog();
        }
示例#4
0
 public List <EnVentas> MostrarVentasPorDiaDePago(EnVentas PEntidad)
 {
     return(_ventasDal.MostrarVentasPorDiaDePago(PEntidad));
 }
示例#5
0
 public List <EnVentas> MostrarVentasPorDiaDeSalida(EnVentas PEntidad)
 {
     return(_ventasDal.MostrarEnVentasPorDiaDeSalida(PEntidad));
 }
示例#6
0
 public int AgregarVenta(EnVentas PEntidad)
 {
     return(_ventasDal.AgregarVenta(PEntidad));
 }