Example #1
0
        private async Task <bool> CargarEstudiante(int idEstudianteACargar)
        {
            //Cargar profesor en base a un id...
            try
            {
                string jsonEstudiante = tools.DataTableToJSONWithStringBuilder(profesor.SProfesor(idEstudianteACargar.ToString()));
                profesor = JsonConvert.DeserializeObject <Profesor>(jsonEstudiante);

                txtCodigo.Text    = profesor.id_profe.ToString();
                txtNombre.Text    = profesor.nombre;
                txtApellido.Text  = profesor.apellido;
                txtEmail.Text     = profesor.email;
                txtContacto.Text  = profesor.contacto;
                chkEstado.Checked = profesor.estado.ToUpper() == "A" ? true : false;

                isNuevoRegistro = false;
                tools.DeshabilitarControles(this);
                FormatearBotones(ProcesoBotones.CancelarRegistroExistente);
            }
            catch (Exception ex)
            {
                tools.MensajeNormal(ex.Message);
            }
            return(true);
        }