private void BtnAgregar_Click(object sender, EventArgs e)
 {
     try
     {
         if (TxtCc.Text != "" && TxtNombre.Text != "" && TxtDescripcion.Text != "" && TxtCantidad.Text != "" && TxtValor.Text != "" && PbArma.ImageLocation != null)
         {
             Cliente cliente = new Cliente();
             cliente.Guardar(TxtCc.Text, TxtNombre.Text, TxtDescripcion.Text, TxtCantidad.Text, TxtValor.Text, PbArma.ImageLocation);
             MessageBox.Show("Producto Agregado Correctamente");
             TxtCc.Clear();
             TxtNombre.Clear();
             TxtDescripcion.Clear();
             TxtCantidad.Clear();
             TxtValor.Clear();
             PbArma.ImageLocation = null;
         }
         else
         {
             if (PbArma.ImageLocation != null)
             {
                 MessageBox.Show("Todos los Campos deben ser llenados para poder agregar un producto");
             }
             else
             {
                 MessageBox.Show("Todos los Campos deben ser llenados para poder agregar un producto y La imagen debe ser cargada");
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error: " + ex);
     }
 }
        private void BtnQuitar_Click(object sender, EventArgs e)
        {
            String  Cla     = TxtCc.Text;
            Cliente cliente = new Armeria.Cliente();

            if (cliente.bajaCliente(Cla, 2))
            {
                MessageBox.Show("Producto Eliminado Correctamente");
            }
            else
            {
                MessageBox.Show("Producto Eliminado Correctamente");
            }


            TxtCc.Clear();
            TxtNombre.Clear();
            TxtDescripcion.Clear();
            TxtCantidad.Clear();
            TxtValor.Clear();
            PbArma.ImageLocation = null;
            //ArchivoTexto archivotexto = new ArchivoTexto();
            //archivotexto.Leer(2);
            //ArchivoBinario archivobinario = new ArchivoBinario();
            //archivobinario.Leer(2);
        }
Example #3
0
 private void Reset()
 {
     TxtValor.Clear();
     BtnAlterar.Enabled = false;
     BtnExcluir.Enabled = false;
     BtnGravar.Enabled  = true;
 }
Example #4
0
 private void BtnLimpiar_Click(object sender, EventArgs e)
 {
     TxtDias.Clear();
     TxtSal.Clear();
     TxtValor.Clear();
     TxtDias.Focus();
 }
Example #5
0
 protected void Func_CancelarOperacion()
 {
     TxtPropietario.Clear();
     TxtCuenta.Clear();
     Func_ConsultarTipoTransaccion();
     TxtValor.Clear();
     TxtCuenta.Focus();
 }
 private void BtnActualizar_Click(object sender, EventArgs e)
 {
     try
     {
         Cliente cliente = new Cliente();
         if (TxtCc.Text != "" && TxtNombre.Text != "" && TxtDescripcion.Text != "" && TxtCantidad.Text != "" && TxtValor.Text != "" && PbArma.ImageLocation != null)
         {
             String Cla   = TxtCc.Text;
             String datos = cliente.consultaCliente(Cla, 2);
             if (datos != null)
             {
                 string[] campos = datos.Split('|');
                 campos[0] = TxtCc.Text;
                 campos[1] = TxtNombre.Text;
                 campos[2] = TxtDescripcion.Text;
                 campos[3] = TxtCantidad.Text;
                 campos[4] = TxtValor.Text;
                 campos[5] = PbArma.ImageLocation;
                 cliente.bajaCliente(Cla, 2);
                 cliente.Guardar(campos[0], campos[1], campos[2], campos[3], campos[4], campos[5]);
                 MessageBox.Show("Datos Modificados Correctamente");
                 TxtCc.Clear();
                 TxtNombre.Clear();
                 TxtDescripcion.Clear();
                 TxtCantidad.Clear();
                 TxtValor.Clear();
                 PbArma.ImageLocation = null;
             }
             else
             {
                 MessageBox.Show("Dato no encontrado");
             }
         }
         else
         {
             if (PbArma.ImageLocation != null)
             {
                 MessageBox.Show("Todos los Campos deben ser llenados para poder Modificar un cliente");
             }
             else
             {
                 MessageBox.Show("Todos los Campos deben ser llenados para poder Modificar un cliente y La imagen debe ser cargada");
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error: " + ex);
     }
 }