Example #1
0
 private void carga()
 {
     txtID.Text            = Convert.ToString(EgresoDBM.UltimoEgreso() + 1);
     ddltipo.SelectedIndex = 0;
     txtBeneficiario.Text  = "";
     txtMonto.Text         = "";
     txtDescripcion.Text   = "";
 }
Example #2
0
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     if (txtMonto.Text == "" || txtBeneficiario.Text == "" || txtDescripcion.Text == "" || txtID.Text == "")
     {
         MessageBox.Show("Todos los campos son obligatorios");
     }
     else
     {
         Egreso nEgreso = new Egreso(Convert.ToInt32(txtID.Text), fecha.Value.ToString("yyyy-MM-dd HH:mm:ss"), ddltipo.SelectedText.ToString(), Convert.ToDecimal(txtMonto.Text), txtBeneficiario.Text, txtDescripcion.Text);
         if (EgresoDBM.Agregar(nEgreso) == 1)
         {
             mensaje = "Egreso registrado con éxito";
             carga();
         }
         else
         {
             MessageBox.Show("error al registrar tipo= {0}", nEgreso.TIPO_EGRESO);
         }
     }
 }