Esempio n. 1
0
 private void btnBorrar_Click(object sender, EventArgs e)
 {
     bool ok;
     bd = new BaseDatosAcciones();
     if (txtId.Text != "")
     {
         ok = bd.DeleteAlumn(int.Parse(txtId.Text));
         if (ok == true)
         {
             lblMensaje.Text = "Alumno eliminado";
             RefreshDataBinding();
             cleantextbox();
         }
     }
     else {
         lblMensaje.Text = "es necesario un Id de alumno";
     }
 }
Esempio n. 2
0
 private void btnAgregar_Click(object sender, EventArgs e)
 {
     bool ok;
     bd = new BaseDatosAcciones();
     if (revisartextox())
     {
         ok = bd.AddAlumn(int.Parse(txtId.Text), txtName.Text, txtLastName.Text, double.Parse(txtPay.Text),double.Parse(txtdebe.Text) ,dtFechaPago.Value);
         if (ok == true)
         {
             lblMensaje.Text = "Se agrego el Alumno";
             RefreshDataBinding();
             cleantextbox();
         }
         else {
             lblMensaje.Text = "Ocurrio algun error y no se puede agregar el alumno";
         }
     }
     else {
         lblMensaje.Text = "Debe de llenar todos los datos para agregar a un alumno";
     }
 }
Esempio n. 3
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            bool ok;
            bd = new BaseDatosAcciones();
            if (txtId.Text != "")
            {
                ok = bd.SearchAlumn(int.Parse(txtId.Text));
                if (ok == true)
                {
                    txtName.Text = bd.other.nombre;
                    txtLastName.Text = bd.other.apellido;
                    txtPay.Text = bd.other.pago.ToString();
                    txtdebe.Text = bd.other.debe.ToString();
                    dtFechaPago.Value = bd.other.fechaPago;

                }
                else { lblMensaje.Text = "el Alumno no existe u ocurrio un error al buscarlo."; }
            }
            else {
                lblMensaje.Text = "Es necesario agregar un Id para buscar";
            }
        }
Esempio n. 4
0
 private void btnGuardar_Click(object sender, EventArgs e)
 {
     bool ok;
     bd = new BaseDatosAcciones();
     if (revisartextox())
     {
         ok = bd.Actualizar(int.Parse(txtId.Text), txtName.Text, txtLastName.Text, double.Parse(txtPay.Text), double.Parse(txtdebe.Text), dtFechaPago.Value);
         if (ok == true)
         {
             lblMensaje.Text = "Se actualizo la informacion del alumno";
             RefreshDataBinding();
             cleantextbox();
         }
         else { lblMensaje.Text = "el Alumno no existe u ocurrio un error al buscarlo."; }
     }
     else {
         lblMensaje.Text ="Debe de llenar todos los datos para guardar cambios";
     }
 }