예제 #1
0
        protected void ButtonEliminar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(TextBoxID.Text))
            {
                Utilidades.ShowToastr(this, "Llene campo Id ", "Consejo", "info");


                Limpiar();
            }
            else
            {
                int id       = int.Parse(TextBoxID.Text);
                var bll      = new BLLProfesor();
                var profesor = BLLProfesor.Buscar(p => p.IdProfesores == id);
                if (BLLProfesor.Eliminar(profesor))
                {
                    Utilidades.ShowToastr(this, "Eliminado con exito", "CORRECTO", "success");

                    Limpiar();
                }
                else
                {
                    Utilidades.ShowToastr(this, "No se puedo eliminar ", "ERROR", "error");
                }
            }
        }
예제 #2
0
        protected void BotonBuscar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(TextBoxID.Text))
            {
                Utilidades.ShowToastr(this, "Llene Campo   id", "CONSEJO", "info");

                Limpiar();
            }
            else

            {
                int id       = int.Parse(TextBoxID.Text);
                var profesro = BLLProfesor.Buscar(p => p.IdProfesores == id);
                if (profesro != null)
                {
                    TextFecha.Text        = profesro.FechaNacimiento.ToString("yyyy-MM-dd");
                    TextBoxNombre.Text    = profesro.Nombre;
                    TextBoxDireccion.Text = profesro.Direccion;
                    DropSexo.Text         = profesro.Sexo;
                    TexboEmail.Text       = profesro.Email;
                    TexboCedula.Text      = profesro.Cedula;
                    TexboTelefono.Text    = profesro.Telefono;
                    TextBoxCurso.Text     = profesro.CursoImpartido;
                    TextBoxSueldo.Text    = profesro.Sueldo.ToString();
                    Utilidades.ShowToastr(this, "Resultados", "RESULTADOS", "success");
                }
                else
                {
                    Utilidades.ShowToastr(this, "No existe Profesor con ese ID", "ERROR", "error");

                    Limpiar();
                }
            }
        }