コード例 #1
0
        private void Factura_Load(object sender, EventArgs e)
        {
            // TODO: esta línea de código carga datos en la tabla 'DataSet1.Cambio' Puede moverla o quitarla según sea necesario.
            this.CambioTableAdapter.Fill(this.DataSet1.Cambio, Convert.ToInt32(Numventaactual.numero));
            // TODO: esta línea de código carga datos en la tabla 'DataSet1.monto' Puede moverla o quitarla según sea necesario.
            this.montoTableAdapter.Fill(this.DataSet1.monto, Convert.ToInt32(Numventaactual.numero));
            // TODO: esta línea de código carga datos en la tabla 'DataSet1.fechadeemicion' Puede moverla o quitarla según sea necesario.
            this.fechadeemicionTableAdapter.Fill(this.DataSet1.fechadeemicion, Convert.ToInt32(Numventaactual.numero));
            // TODO: esta línea de código carga datos en la tabla 'DataSet1.NombreEmpleado' Puede moverla o quitarla según sea necesario.
            this.NombreEmpleadoTableAdapter.Fill(this.DataSet1.NombreEmpleado, Convert.ToInt32(Numventaactual.numero));
            // TODO: esta línea de código carga datos en la tabla 'DataSet1.Obneternumerofactura' Puede moverla o quitarla según sea necesario.
            this.ObneternumerofacturaTableAdapter.Fill(this.DataSet1.Obneternumerofactura, Convert.ToInt32(Numventaactual.numero));
            // TODO: esta línea de código carga datos en la tabla 'DataSet1.numNIT' Puede moverla o quitarla según sea necesario.
            this.numNITTableAdapter.Fill(this.DataSet1.numNIT, Convert.ToInt32(Numventaactual.numero));
            // TODO: esta línea de código carga datos en la tabla 'DataSet1.nombreclientefactura' Puede moverla o quitarla según sea necesario.
            this.nombreclientefacturaTableAdapter.Fill(this.DataSet1.nombreclientefactura, Convert.ToInt32(Numventaactual.numero));
            Registro_de_venta  reg   = new Registro_de_venta();
            CRUDdetallefactura detm  = new CRUDdetallefactura();
            CRUDdetallefactura factu = new CRUDdetallefactura();

            // TODO: esta línea de código carga datos en la tabla 'DataSet1.totalgastos' Puede moverla o quitarla según sea necesario.
            this.totalgastosTableAdapter.Fill(this.DataSet1.totalgastos, Convert.ToInt32(Numventaactual.numero));
            // TODO: esta línea de código carga datos en la tabla 'DataSet1.detallefact' Puede moverla o quitarla según sea necesario.
            this.detallefactTableAdapter.Fill(this.DataSet1.detallefact, Convert.ToInt32(Numventaactual.numero));
            this.reportViewer1.RefreshReport();
        }
コード例 #2
0
        private void button5_Click(object sender, EventArgs e)
        {
            ProcedimientosDeVerificacion proc1 = new ProcedimientosDeVerificacion();

            if (textBox2.Text == "" || textBox5.Text == "")
            {
                MessageBox.Show("Verifique no dejar campos obligatorios vacios");
            }
            else
            {
                try
                {
                    estadoPruena = true;
                    this.dataGridView1.DataSource = proc1.nombreproducto(Convert.ToInt32(textBox2.Text));
                    proc1.preciounitario(Convert.ToInt32(textBox2.Text));
                    textBox9.Text = proc1.preci;
                    CRUDdetallefactura factu = new CRUDdetallefactura();
                    factu.TOTAL(Convert.ToInt32(textBox6.Text));
                    if (estadoPruena)
                    {
                        button1.Enabled = true;
                    }
                    //   textBox12.Text = factu.total;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("error " + ex);
                }
            }
        }
コード例 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!Existencia)
            {
                MessageBox.Show("No hay existencias de este prodcuto");
            }
            else
            {
                textBox11.Enabled = true;
                estatusTotal      = true;
                if (textBox1.Text == "" || textBox2.Text == "" || textBox7.Text == "" || textBox5.Text == "")
                {
                    MessageBox.Show("verifique no dejar campos obligatorios en blanco");
                }

                else
                {
                    try
                    {
                        estadoPruena = true;
                        CRUDdetallefactura factura = new CRUDdetallefactura();
                        factura.Insertar(Convert.ToInt32(textBox6.Text), Convert.ToInt32(textBox1.Text), Convert.ToInt32(textBox2.Text), Convert.ToInt32(textBox3.Text), Convert.ToInt32(textBox7.Text), Convert.ToDateTime(textBox4.Text), Convert.ToInt32(textBox5.Text), Convert.ToDecimal(textBox9.Text), Convert.ToInt32(textBox10.Text), Convert.ToInt32(textBox12.Text), Convert.ToDecimal(textBox11.Text), Convert.ToDecimal(textBox8.Text));
                        MessageBox.Show("se agregó correctamente");
                        MessageBox.Show("puedes seguir agregando productos o facturar");
                        textBox1.Enabled  = false;
                        textBox3.Enabled  = false;
                        textBox4.Enabled  = false;
                        textBox7.Enabled  = false;
                        textBox10.Enabled = false;
                        factura.Updateexistencias(Convert.ToInt32(textBox2.Text), Convert.ToInt32(textBox5.Text));
                        button2.Enabled = true;
                        textBox2.Text   = "";
                        textBox5.Text   = "";
                        textBox9.Text   = "0";
                        CRUDdetallefactura factu = new CRUDdetallefactura();
                        factu.TOTAL(Convert.ToInt32(textBox6.Text));
                        textBox12.Text = factu.total;
                        totalgastos    = factu.total;;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Error" + ex);
                    }
                }
            }
        }
コード例 #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (Convert.ToInt32(textBox11.Text) < Convert.ToInt32(textBox12.Text))
            {
                MessageBox.Show("El monto a pagar es menor al TOTAL, favor de verificar");
            }
            else
            {
                if (true)
                {
                    decimal vuelto = Convert.ToDecimal(textBox11.Text) - Convert.ToInt32(textBox12.Text);
                    textBox8.Text = vuelto.ToString();
                }
                CRUDdetallefactura detall = new CRUDdetallefactura();
                detall.vuelto(Convert.ToDecimal(textBox8.Text), Convert.ToInt32(textBox6.Text));
                detall.Montpagar(Convert.ToDecimal(textBox11.Text), Convert.ToInt32(textBox6.Text));

                Factura mostrar = new Factura();
                mostrar.Show();
                this.Hide();

                detall.PagoVuelto(Convert.ToInt32(textBox6.Text), Convert.ToDecimal(textBox11.Text), Convert.ToDecimal(textBox8.Text), Convert.ToInt32(textBox12.Text));
            }
        }