Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            String valor = (String)sucursales.Text;

            String[] id = valor.Split('-');
            ConexionBD.SQL("INSERT INTO roles VALUES('','" + nombre.Text + "'," + id[0] + ")");
            MessageBox.Show("El Roll fue Creado Satisfactoriamente!");
            nombre.Text = "";
            sucursales.SelectedIndex = 0;
        }
Esempio n. 2
0
 private void btnIn_Click(object sender, EventArgs e)
 {
     validar();
     if (validar() == true)
     {
         String Sql = String.Format("Insert into Producto values ('{0}', '{1}','{2}', '{3}', '{4}')",
                                    lbId.Text, txtName.Text, txtPre.Text, ComboxIva.SelectedItem, txtBoxDescri.Text);
         ConexionBD.SQL(Sql);
         getId();
         reset();
     }
 }
Esempio n. 3
0
 private void btnIn_Click(object sender, EventArgs e)
 {
     validar();
     if (validar() == true)
     {
         String Sql = String.Format("Insert into Inventario values ('{0}', '{1}','{2}', '{3}', '{4}', CURRENT_TIMESTAMP())",
                                    txtId.Text, BoxPro.SelectedValue, boxSucur.SelectedValue, txtMovi.Text, spnCan.Value);
         ConexionBD.SQL(Sql);
         getId();
         Reset();
     }
 }
Esempio n. 4
0
 private void btAcpta_Click(object sender, EventArgs e)
 {
     if (txnueva.Text == txconfirma.Text)
     {
         ConexionBD.SQL("UPDATE persona SET pass ='******' WHERE Id = " + this.id);
         MessageBox.Show("Su contraseña ha sido Restaurada...", "Exitoso", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         Dispose();
     }
     else
     {
         MessageBox.Show("La contraseña NO Concuerda, Intente de Nuevo...", "Error 1356", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 5
0
 private void btnActu_Click(object sender, EventArgs e)
 {
     validar();
     if (validar() == true)
     {
         String Sql = String.Format("Update Inventario set Producto_id='{0}', Sucursal_id='{1}', Movimiento='{2}', Cantidad_Pro='{3}' where Id = " + txtId.Text,
                                    BoxPro.SelectedValue, boxSucur.SelectedValue, txtMovi.Text, spnCan.Value);
         ConexionBD.SQL(Sql);
         getId();
         Reset();
         btnActu.Enabled = false;
         btnIn.Enabled   = true;
     }
 }
Esempio n. 6
0
        private void BtEliminar_Click(object sender, EventArgs e)
        {
            this.Hide();

            new ConfirmacionAdmin("Administrador").ShowDialog();
            this.Show();
            if (!bandera)
            {
                ConexionBD.SQL("DELETE FROM persona WHERE Id= " + tb1.Rows[0][0]);
                bandera = true;
            }
            else
            {
                MessageBox.Show("Se Ha denegado la Accion", "Error 1355", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Esempio n. 7
0
 private void btnActu_Click(object sender, EventArgs e)
 {
     validar();
     if (validar() == true)
     {
         String Sql = String.Format("Update Producto set Nombre='{0}', Precio='{1}', Iva='{2}', " +
                                    "Descripcion='{3}' where Id = " + lbId.Text,
                                    txtName.Text, txtPre.Text, ComboxIva.SelectedItem, txtBoxDescri.Text);
         ConexionBD.SQL(Sql);
         Nuevo = true;
         getId();
         reset();
         btnIn.Enabled   = true;
         btnActu.Enabled = false;
     }
 }
Esempio n. 8
0
        private void btActualiza_Click(object sender, EventArgs e)
        {
            Boolean verifico = Verifica();

            if (!verifico)
            {
                MessageBox.Show("Falta Ingresar algun Dato");
            }
            else
            {
                Char delimiter = '-';

                String[] roll    = privilegiosC.Split(delimiter);
                String[] sucu    = sucursalC.Split(delimiter);
                int      tres    = DoC.Length;
                String   usuario = nombreC.Substring(0, 3) + apellidoC.Substring(0, 3) + DoC.Substring((tres - 3), 3);
                //Console.WriteLine("valores" + usuario);
                //Console.WriteLine(roll[0]+" Valores");

                ConexionBD.SQL("UPDATE persona SET Nombre='" + nombreC + "'," +
                               "Apellido ='" + apellidoC + "'," +
                               "Tipo ='" + tipDoC + "'," +
                               "Numero ='" + DoC + "'," +
                               "Edad =" + edadC + "," +
                               "Roll_Id =" + roll[0] + "," +
                               "Sucursal_Id =" + sucu[0] + "," +
                               "Name ='" + usuario + "'," +
                               "Pass ='******'," +
                               "Telefono ='" + telefonoC + "'," +
                               "Direccion ='" + direccionC + "'," +
                               "Correo ='" + correoC + "'" +
                               " WHERE Id= " + tb1.Rows[0][0]);

                limpiar();
                btActualiza.Enabled = false;
            }
        }
Esempio n. 9
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (!Verifica())
            {
                MessageBox.Show("Falta Ingresar algun Dato");
                verifica = true;
            }
            else
            {
                Char delimiter = '-';

                String[] roll    = privilegiosC.Split(delimiter);
                String[] sucu    = sucursalC.Split(delimiter);
                int      tres    = DoC.Length;
                String   usuario = nombreC.Substring(0, 3) + apellidoC.Substring(0, 3) + DoC.Substring((tres - 3), 3);

                //Console.WriteLine("valores" + usuario);
                //Console.WriteLine(roll[0]+" Valores");
                ConexionBD.SQL("INSERT INTO persona VALUES(NULL,'" + nombreC + "','" + apellidoC + "','" +
                               tipDoC + "'," + DoC + "," + edadC + ",'" + roll[0] + "','" + sucu[0] + "','" + usuario + "','" + DoC + "','" + telefonoC + "','" + direccionC + "','" + correoC + "')");

                MessageBox.Show("Usuario Correctamente Creado!", "Procedimiento Exitoso", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);

                //nombre.Text="";
                //apellido.Text="";
                //Docuemento.Text="";
                //edad.Value=18;
                //telefono.Text = "";
                //direccion.Text="";
                //correo.Text="";
                cargarCx();
                //getId();

                limpiar();
            }
        }
Esempio n. 10
0
        private void btFactura_Click(object sender, EventArgs e)
        {
            if (cxVendedores.Text != "<--Seleccione-->")
            {
                Console.WriteLine("" + idVendedor);
                Console.WriteLine("" + Log.sucurId);
                Console.WriteLine("" + txSubtotal.Text);
                Console.WriteLine("" + txIva.Text);
                Console.WriteLine("" + txTotal.Text);
                Console.WriteLine("" + lbFecha.Text);

                // Console.WriteLine("" +);

                ConexionBD.SQL("INSERT INTO ventas VALUES(NULL, '" + idVendedor + "','" + txCliente.Text + "', NULL, '"
                               + Log.sucurId + "','" + txSubtotal.Text + "','" + txIva.Text + "','" + txTotal.Text + "','" + lbFecha.Text + "')");

                //MessageBox.Show("Inserto Factura..........................");

                for (int j = 0; j < tablaVenta.RowCount; j++)
                {
                    subt   = subt + int.Parse(tablaVenta.Rows[j].Cells[7].Value.ToString());
                    ivaFin = ivaFin + double.Parse(tablaVenta.Rows[j].Cells[6].Value.ToString());
                    ConexionBD.SQL("INSERT INTO detalles VALUES (NULL, '" + CoansecutivoFac.Text + "', '" + tablaVenta.Rows[j].Cells[1].Value.ToString()
                                   + "','" + tablaVenta.Rows[j].Cells[4].Value.ToString() + "','" + tablaVenta.Rows[j].Cells[5].Value.ToString() + "','"
                                   + tablaVenta.Rows[j].Cells[6].Value.ToString() + "','" + tablaVenta.Rows[j].Cells[7].Value.ToString() + "')");

                    //MessageBox.Show("Inserto Detalle No " + j + "..........................");
                }



                CrearTicket tk = new CrearTicket();
                tk.AbreCajon();
                tk.TextoCentrado("DISSFRUTA");
                tk.TextoIzquierda("EXPEDIDO EN: Cali");
                tk.TextoIzquierda("DIR: Ciudad Jardin");
                tk.TextoIzquierda("TEL: 314 786 02 94");
                tk.TextoIzquierda("EMAIL: [email protected]");
                tk.TextoIzquierda("");
                tk.TextoExtremos("Caja # 1", "Ticket #" + NoFactura.Text + CoansecutivoFac.Text);
                tk.lineasAsteriscos();

                tk.TextoIzquierda("");
                tk.TextoIzquierda("ATENDIO: " + cxVendedores.SelectedItem);
                tk.TextoIzquierda("CLIENTE: " + txCliente.Text);
                tk.TextoIzquierda("FECHA: " + DateTime.Now.ToShortDateString() + " HORA: " + DateTime.Now.ToShortTimeString());
                tk.lineasAsteriscos();

                tk.EncabezadoVenta();
                tk.lineasAsteriscos();
                MessageBox.Show("Inserto Detalle No " + tablaVenta.RowCount + "algo");
                for (int j = 0; j < tablaVenta.RowCount; j++)
                {
                    MessageBox.Show("Inserto Detalle No " + tablaVenta.Rows[j].Cells[2].Value.ToString() + "........jjj..................");
                    tk.AgregarArticulos(tablaVenta.Rows[j].Cells[2].Value.ToString(), int.Parse(tablaVenta.Rows[j].Cells[4].Value.ToString()),
                                        decimal.Parse(tablaVenta.Rows[j].Cells[5].Value.ToString()), decimal.Parse(tablaVenta.Rows[j].Cells[6].Value.ToString()));
                }

                //foreach (DataGridViewRow fila in tablaVenta.Rows)
                //{
                //    MessageBox.Show("Inserto Detalle No " + fila.Cells[2].Value.ToString() + "........jjj..................");
                //    tk.AgregarArticulos(fila.Cells[2].Value.ToString(), int.Parse(fila.Cells[4].Value.ToString()),
                //        decimal.Parse(fila.Cells[5].Value.ToString()), decimal.Parse(fila.Cells[6].Value.ToString()));
                //}

                tk.lineasIgual();

                tk.AgregarTotales("          SUBTOTAL......$", decimal.Parse(txSubtotal.Text));
                tk.AgregarTotales("          IVA...........$", decimal.Parse(txIva.Text));
                tk.AgregarTotales("          TOTAL.........$", decimal.Parse(txTotal.Text));
                tk.TextoIzquierda("");
                tk.AgregarTotales("          EFECTIVO......$", 2000);
                tk.AgregarTotales("          CAMBIO........$", 0);

                tk.TextoIzquierda("");
                tk.TextoIzquierda("ARTICULOS VENDIDOS : " + tablaVenta.RowCount);
                tk.TextoIzquierda("");
                tk.TextoCentrado("GRACIAS POR SU COMPRA by: J.J.");
                tk.CortarTicket();
                tk.ImprimirTicket("Microsoft XPS Document Writer");

                tablaVenta.DataSource = null;
                TxCodigo.Text         = "";
                TxCodigo.Focus();
                txCantidad.Text            = "";
                cxVendedores.SelectedIndex = 0;
            }
            else
            {
                MessageBox.Show("Debe Primero Un Vendedor!! F**K!!", "Error 1313", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 11
0
 private void button1_Click(object sender, EventArgs e)
 {
     ConexionBD.SQL("INSERT INTO sucursal VALUES('','" + TxtNombre.Text + "')");
     MessageBox.Show("La Sucursal fue Creada Correctamente");
     TxtNombre.Text = "";
 }