Пример #1
0
 private void btnCrear_Click(object sender, EventArgs e)
 {
     if (Vacio.txb(this))
     {
         if (Validar.decimales(txbCosto.Text))
         {
             string sql = "INSERT INTO compras(materia_id,cantidad,costo,total,fecha)VALUES('" + cmbMateria.SelectedValue + "','" + txbCantidad.Text + "','" + txbCosto.Text + "','" + total + "','" + dtpFecha.Text + "')";
             if (bd.insertar(sql))
             {
                 MessageBox.Show("Se agrego el registro", "Correcto", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 Index();
             }
         }
         else
         {
             MessageBox.Show("El formato delcosto no es valido", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         MessageBox.Show("Debes llenar todos los campos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #2
0
 private void txbUser_KeyPress(object sender, KeyPressEventArgs e)
 {
     Validar.LetrasNumeros(e);
 }
Пример #3
0
 private void txbMaterno_KeyPress(object sender, KeyPressEventArgs e)
 {
     Validar.LetrasEspacios(e);
 }
Пример #4
0
 private void txbCosto_KeyPress(object sender, KeyPressEventArgs e)
 {
     Validar.NumerosPunto(e);
 }
Пример #5
0
 private void txbCantidad_KeyPress(object sender, KeyPressEventArgs e)
 {
     Validar.Numeros(e);
 }
Пример #6
0
 private void txbCodigo_KeyPress(object sender, KeyPressEventArgs e)
 {
     Validar.Letras(e);
 }
Пример #7
0
 private void txbNombre_KeyPress(object sender, KeyPressEventArgs e)
 {
     Validar.LetrasNumerosEspacios(e);
 }