Exemple #1
0
        private void frmVenta_Load(object sender, EventArgs e)
        {
            Helper.llenarCbo(cboTipoFactura, TipoFactura.GetAllTipoFacturas(), "nombre", "codigoTipo");
            Helper.llenarCbo(cboVendedor, Empleado.GetAllActiveEmployees(), "Nombre", "legajo");

            DateTime now = DateTime.Today;

            txtFecha.Text = now.ToString("dd/MM/yyyy");

            txtCantidadProducto.TextChanged += new EventHandler(txtCantidadProducto_TextChanged);
            btnAgregarProducto.Enabled       = false;
            lblTotalNeto.Visible             = false;

            if (idVentaAVer != 0)
            {
                gboxProducto.Enabled      = false;
                gboxNuevoCliente.Enabled  = false;
                gBoxImporte.Enabled       = false;
                gboxFactura.Enabled       = false;
                gboxCliente.Enabled       = false;
                btnConfirmarVenta.Enabled = false;
                btnQuitarProducto.Enabled = false;

                Helper.llenarCbo(cboVendedor, Empleado.GetAllEmployees(), "Nombre", "legajo");
                Helper.llenarCbo(cboCliente, Cliente.GetClientesByName(" ", true), "fullname", "codigoCliente");
                Helper.llenarCbo(cboCuit, Cliente.GetClientesByName("-", false), "cuit", "codigoCliente");

                string    consulta = "SELECT * FROM VENTAS WHERE numeroVenta = " + idVentaAVer;
                DataTable values   = BDHelper.ConsultaSQL(consulta);

                cboTipoFactura.SelectedValue = values.Rows[0]["tipoFactura"].ToString();
                cboVendedor.SelectedValue    = values.Rows[0]["vendedor"].ToString();
                cboCliente.SelectedValue     = values.Rows[0]["cliente"].ToString();
                cboCuit.SelectedValue        = values.Rows[0]["cliente"].ToString();
                txtFecha.Text = values.Rows[0]["fecha"].ToString();

                consulta = "SELECT LOTES.codigoProducto, DETALLE_VENTA.cantidad, DETALLE_VENTA.precioVenta " +
                           "FROM DETALLE_VENTA " +
                           "JOIN LOTES ON(LOTES.numeroLote = DETALLE_VENTA.numeroLote) " +
                           "WHERE DETALLE_VENTA.numeroVenta = " + idVentaAVer;
                values = BDHelper.ConsultaSQL(consulta);

                addProductos(values);
            }

            this.FormBorderStyle = FormBorderStyle.FixedSingle;
        }
Exemple #2
0
 //Carga los tipos de factura existentes en la grilla
 public void frmTipoFacturas_Load(object sender, EventArgs e)
 {
     gridTipoFacturas.DataSource = TipoFactura.GetAllTipoFacturas();
 }