private void ButtonAceptar_Click(object sender, EventArgs e)
 {
     if (this.LabelTitulo.Text == "Registrar Cliente")
     {
         ConsultasBaseDeDatos.EjecutarProcedimientoEnBDLuiguiBaretta("Exec RegistrarCliente '" +
                                                                     this.TextBoxNombre.Text + "', '" +
                                                                     this.TextBoxDireccion.Text + "', '" +
                                                                     this.TextBoxTelefono.Text + "', '" +
                                                                     this.TextBoxRUC.Text + "', '" +
                                                                     this.TextBoxRazonSocial.Text + "'");
         MessageBox.Show("Registro Realiado con éxito", "Finalizado Correctamente", MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.Close();
     }
     else
     {
         ConsultasBaseDeDatos.EjecutarProcedimientoEnBDLuiguiBaretta("Exec EditarCliente '" +
                                                                     this.id_cliente + "', '" +
                                                                     this.TextBoxNombre.Text + "', '" +
                                                                     this.TextBoxDireccion.Text + "', '" +
                                                                     this.TextBoxTelefono.Text + "', '" +
                                                                     this.TextBoxRUC.Text + "', '" +
                                                                     this.TextBoxRazonSocial.Text + "'");
         MessageBox.Show("Edicion Realiada con éxito", "Finalizado Correctamente", MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.Close();
     }
 }
예제 #2
0
        private void ButtonPagar_Click(object sender, EventArgs e)
        {
            try
            {
                ConsultasBaseDeDatos.EjecutarProcedimientoEnBDLuiguiBaretta("Exec RegistrarVenta '" +
                                                                            this.ComboBoxAlmacen.Text + "', '" +
                                                                            this.ComboBoxDireccion.Text + "', '" +
                                                                            DateTime.Now.ToString("yyyy-MM-dd") + "', " +
                                                                            this.LabelTotalNum.Text + ", " +
                                                                            this.TextBoxPagar.Text);

                int ID_Venta = (int)ConsultasBaseDeDatos.ObtenerValorEnteroDeBDLuiguiBaretta("Select Max(ID_Venta) from Venta");
                for (int x = 0; x < this.DataGridViewVentas.Rows.Count; x++)
                {
                    ConsultasBaseDeDatos.EjecutarProcedimientoEnBDLuiguiBaretta("Exec RegistrarVentaProducto " +
                                                                                ID_Venta + ", '" +
                                                                                this.DataGridViewVentas.Rows[x].Cells[0].Value + "', " +
                                                                                this.DataGridViewVentas.Rows[x].Cells[1].Value + ", " +
                                                                                this.DataGridViewVentas.Rows[x].Cells[2].Value);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "A ocurrido un Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                MessageBox.Show("Venta terminada con éxito", "Venta", MessageBoxButtons.OK, MessageBoxIcon.Information);
                LimpiarVenta();
            }
        }
예제 #3
0
 private void ButtonActualizarPago_Click(object sender, EventArgs e)
 {
     ConsultasBaseDeDatos.EjecutarProcedimientoEnBDLuiguiBaretta("exec pago_opc1 '" +
                                                                 TextBoxNuevoPago.Text + "', '" +
                                                                 DatagridViewRegistroDeVentas.CurrentRow.Cells[0].Value.ToString() + "', '" +
                                                                 LabelNumDeuda.Text + "'");
     Registro_De_Ventas.EstablecerDatos(ref DatagridViewRegistroDeVentas);
     MessageBox.Show("Pago Realizado con éxito", "Pago Realizado", MessageBoxButtons.OK, MessageBoxIcon.Information);
 }
예제 #4
0
 private void ButtonAceptar_Click(object sender, EventArgs e)
 {
     if (this.LabelTitulo.Text == "Agregar Producto")
     {
         ConsultasBaseDeDatos.EjecutarProcedimientoEnBDLuiguiBaretta("exec RegistrarProducto '" +
                                                                     this.TextBoxCodigo.Text + "', '" +
                                                                     this.TextBoxReferencia.Text + "', '" +
                                                                     this.TextBoxDescripcion.Text + "', '" +
                                                                     this.TextBoxTalla.Text + "', " +
                                                                     this.TextBoxPrecioVenta.Text + ", " +
                                                                     this.TextBoxGrupoPrimavera.Text + ", " +
                                                                     this.TextBoxCasaFaska.Text + ", " +
                                                                     this.TextBoxCantidad.Text + ", " +
                                                                     this.TextBoxCantidadPaquete.Text + ", " +
                                                                     this.TextBoxGrupoDePaquete.Text);
         MessageBox.Show("Registro Realiado con éxito", "Finalizado Correctamente", MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.Close();
     }
     else
     {
         ConsultasBaseDeDatos.EjecutarProcedimientoEnBDLuiguiBaretta("exec EditarProducto " +
                                                                     this.ID + ", '" +
                                                                     this.TextBoxCodigo.Text + "', '" +
                                                                     this.TextBoxReferencia.Text + "', '" +
                                                                     this.TextBoxDescripcion.Text + "', '" +
                                                                     this.TextBoxTalla.Text + "', " +
                                                                     this.TextBoxPrecioVenta.Text + ", " +
                                                                     this.TextBoxGrupoPrimavera.Text + ", " +
                                                                     this.TextBoxCasaFaska.Text + ", " +
                                                                     this.TextBoxCantidad.Text + ", " +
                                                                     this.TextBoxCantidadPaquete.Text + ", " +
                                                                     this.TextBoxGrupoDePaquete.Text);
         MessageBox.Show("Edicion Realiada con éxito", "Finalizado Correctamente", MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.Close();
     }
 }