private void UsersListRepeater_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.ColumnIndex == 1 && e.RowIndex >= 0)
                {
                    int ci;
                    if (Int32.TryParse(Convert.ToString(UsersListRepeater.Rows[e.RowIndex].Cells[0].Value), out ci))
                    {
                        ServiceWebMail sm = new ServiceWebMail();
                        Alumno a = new Alumno { CI = ci };
                        sm.ActualizarStatusAlumno(a, false);
                        lblInfo.Text = "Alumno desactivado";

                        //VOLVEMOS A REALIZAR LA BUSQUEDA PARA QUE ACTUALICE LA INFORMACION
                        //-----------------------------------------------------------------
                        Busqueda();
                    }
                }
            }
            catch (Exception ex)
            {
                lblInfo.Text = ex.Message;
            }
        }
Exemplo n.º 2
0
        private void btnActivar_Click(object sender, EventArgs e)
        {
            try
            {
                lblInfo.Text = "";

                if (MessageBox.Show("Realmente desea activar este usuario?", "Activacion de Usuario",
                                 MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    ServiceWebMail sm = new ServiceWebMail();

                    //ACTIVAMOS EL USUARIO
                    int ci;
                    if (Int32.TryParse(txtDocumento.Text, out ci))
                    {
                        Alumno a = new Alumno { CI = ci };
                        sm.ActualizarStatusAlumno(a, true);
                        lblStatus.Text = "Activo";
                        lblInfo.Text = "Alumno activado!";
                        btnActivar.Enabled = false;
                    }
                }
            }
            catch (Exception ex)
            {
                lblInfo.Text = ex.Message;
            }
        }