Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            frmmenu frm = new frmmenu();

            this.Hide();
            frm.Show();
        }
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            frmmenu frm = new frmmenu();

            this.Hide();
            frm.Show();
        }
        private void nuevo_guardar()


        {
            try
            {
                conexion.Open();
                OleDbCommand com = new OleDbCommand("insert into cliente (Nombre,Apellido,Correo,Cedula,Telefono,Celular,Direccion,usuarioregistrado) Values (" + "'" + txtnombre.Text + "'" + "," + "'" + txtapellido.Text + "'" + "," + "'" + txtcorreo.Text + "'" + "," + "'" + txtcedula.Text + "'" + "," + "'" + txttelefono.Text + "'" + "," + "'" + txtcelular.Text + "'" + "," + "'" + txtdireccion.Text + "'," + "'" + lblusuario.Text + "')", conexion);
                com.ExecuteNonQuery();
                MessageBox.Show("Se ha ingresado el cliente correctamente");

                if (MessageBox.Show("¿Termino la tarea deseada?", "Que hara", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes)
                {
                    frmmenu frm = new frmmenu();
                    this.Close();
                    frm.Show();
                }
                else
                {
                    limpiar();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                if (conexion.State != ConnectionState.Closed)
                {
                    conexion.Close();
                }
            }
        }
Example #4
0
        private void nuevo_guardar()
        {
            try
            {
                conexion.Open();
                OleDbCommand com = new OleDbCommand("insert into Transacioncompra (CodigoCliente,Nombre,Cedula,Moneda,Valorventa,Dinerorecibido,ACambiar,Internacional,Devuelta,Total,usuarioregistrado) Values (" + "'" + txtccodigo.Text + "'" + "," + "'" + txtcnombre.Text + "'" + "," + "'" + txtccedula.Text + "'" + "," + "'" + label8.Text + "'" + "," + "'" + txttc.Text + "'" + "," + "'" + txttrecibido.Text + "'" + "," + "'" + txttmonto.Text + "'" + "," + "'" + txttpesos.Text + "'" + "," + "'" + txttdevuelto.Text + "'" + "," + "'" + txtttotal.Text + "'," + "'" + lblusuario.Text + "')", conexion);
                com.ExecuteNonQuery();
                MessageBox.Show("Se ha ingresado la transaccion correctamente");

                if (MessageBox.Show("¿Termino la tarea deseada?", "Que hara", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes)
                {
                    frmmenu frm = new frmmenu();
                    this.Close();
                    frm.Show();
                }
                else
                {
                    limpiar();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                if (conexion.State != ConnectionState.Closed)
                {
                    conexion.Close();
                }
            }
        }
Example #5
0
        private void nuevo_guardar3()
        {
            d = 1;
            try
            {
                conexion.Open();
                OleDbCommand com = new OleDbCommand("insert into Tasas (Moneda,Compra,Venta,usuarioregistrado) Values (" + "'" + cbotras.Text + "'" + "," + "'" + txtcomprao.Text + "'" + "," + "'" + txtventao.Text + "'" + "," + "'" + lblusuario.Text + "')", conexion);
                com.ExecuteNonQuery();
                MessageBox.Show("Se ha ingresado el costo de " + cbotras.Text + " correctamente");

                if (MessageBox.Show("¿Termino la tarea deseada?", "Que hara", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes)
                {
                    frmmenu frm = new frmmenu();
                    this.Close();
                    frm.Show();
                }
                else
                {
                    btncambiar.Enabled = true;
                    btnnuevo.Enabled   = true;
                    btnguardar.Enabled = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                if (conexion.State != ConnectionState.Closed)
                {
                    conexion.Close();
                }
            }
        }
Example #6
0
 private void btncancelar_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("¿Desea salir?", "Salir", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes)
     {
         frmmenu frm = new frmmenu();
         this.Hide();
         frm.Show();
     }
 }
        private void actualizar_guardar()
        {
            try
            {
                codigo = int.Parse(txtcodigo.Text);

                conexion.Open();
                OleDbCommand com1 = new OleDbCommand("Update cliente Set Nombre=" + "'" + txtnombre.Text + "'" + "Where Codigo=" + "" + codigo + "", conexion);
                OleDbCommand com2 = new OleDbCommand("Update cliente Set Apellido=" + "'" + txtapellido.Text + "'" + "Where Codigo=" + "" + codigo + "", conexion);
                OleDbCommand com3 = new OleDbCommand("Update cliente Set Correo=" + "'" + txtcorreo.Text + "'" + "Where Codigo=" + "" + codigo + "", conexion);
                OleDbCommand com4 = new OleDbCommand("Update cliente Set Cedula=" + "'" + txtcedula.Text + "'" + "Where Codigo=" + "" + codigo + "", conexion);
                OleDbCommand com5 = new OleDbCommand("Update cliente Set Telefono=" + "'" + txttelefono.Text + "'" + "Where Codigo=" + "" + codigo + "", conexion);
                OleDbCommand com6 = new OleDbCommand("Update cliente Set Celular=" + "'" + txtcelular.Text + "'" + "Where Codigo=" + "" + codigo + "", conexion);
                OleDbCommand com7 = new OleDbCommand("Update cliente Set Direccion=" + "'" + txtdireccion.Text + "'" + "Where Codigo=" + "" + codigo + "", conexion);
                OleDbCommand com8 = new OleDbCommand("Update cliente Set usuarioregistrado=" + "'" + lblusuario.Text + "'" + "Where Codigo=" + "" + codigo + "", conexion);


                com1.ExecuteNonQuery();
                com2.ExecuteNonQuery();
                com3.ExecuteNonQuery();
                com4.ExecuteNonQuery();
                com5.ExecuteNonQuery();
                com6.ExecuteNonQuery();
                com7.ExecuteNonQuery();
                com8.ExecuteNonQuery();

                MessageBox.Show("Se ha actualizado el cliente correctamente");

                if (MessageBox.Show("¿Termino la tarea deseada?", "Que hara", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes)
                {
                    frmmenu frm = new frmmenu();
                    this.Close();
                    frm.Show();
                }
                else
                {
                    limpiar();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                if (conexion.State != ConnectionState.Closed)
                {
                    conexion.Close();
                }
            }
        }
Example #8
0
        private void actualizar_guardar3()
        {
            d = 2;
            try
            {
                conexion.Open();
                OleDbCommand com3 = new OleDbCommand("Update Tasas Set Moneda=" + "'" + cbotras.Text + "'" + "Where Moneda=" + "'" + cbotras.Text + "'", conexion);
                OleDbCommand com1 = new OleDbCommand("Update Tasas Set Compra=" + "'" + txtcomprad.Text + "'" + "Where Moneda=" + "'" + lbldolar.Text + "'", conexion);
                OleDbCommand com2 = new OleDbCommand("Update Tasas Set Venta=" + "'" + txtventad.Text + "'" + "Where Moneda=" + "'" + lbldolar.Text + "'", conexion);

                com1.ExecuteNonQuery();
                com1.ExecuteNonQuery();

                MessageBox.Show("Se ha actualizado las tasas correctamente");

                if (MessageBox.Show("¿Termino la tarea deseada?", "Que hara", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes)
                {
                    frmmenu frm = new frmmenu();
                    this.Close();
                    frm.Show();
                }
                else
                {
                    btncambiar.Enabled = true;
                    btnnuevo.Enabled   = true;
                    btnguardar.Enabled = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                if (conexion.State != ConnectionState.Closed)
                {
                    conexion.Close();
                }
            }
        }
        private void borrar_guardar()
        {
            try
            {
                codigo = int.Parse(txtcodigo.Text);
                string sentencia = "Delete From cliente Where Codigo=" + codigo + ";";
                conexion.Open();
                OleDbCommand com = new OleDbCommand(sentencia, conexion);

                com.ExecuteNonQuery();
                MessageBox.Show("Se ha borrado el cliente correctamente");

                if (MessageBox.Show("¿Termino la tarea deseada?", "Que hara", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes)
                {
                    frmmenu frm = new frmmenu();
                    this.Close();
                    frm.Show();
                }
                else
                {
                    limpiar();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                if (conexion.State != ConnectionState.Closed)
                {
                    conexion.Close();
                }

                else
                {
                }
            }
        }