protected void btnBorrar_Click(object sender, EventArgs e) { int Id = Convert.ToInt32(lblID.Text); Logica.Profesor objLogica = new Logica.Profesor(); objLogica.Eliminar(Id); objLogica.TraerTodos(); }
static void Main(string[] args) { Entidades.Profesor objEntidadProfesor = new Entidades.Profesor(); Console.Write("Ingrese su apellido: "); objEntidadProfesor.Apellido = Console.ReadLine(); Console.Write("Ingrese su nombre: "); objEntidadProfesor.Nombre = Console.ReadLine(); Console.Write("Ingrese su mail: "); objEntidadProfesor.Mail = Console.ReadLine(); Logica.Profesor objLogicaProfesor = new Logica.Profesor(); objLogicaProfesor.Agregar(objEntidadProfesor); Console.WriteLine("¡Profesor agregado!"); Console.ReadKey(); }
static void Main(string[] args) { Entidades.Profesor objEntidadProfesor = new Entidades.Profesor(); Console.Write("Ingrese Apellido: "); objEntidadProfesor.Apellido = Console.ReadLine(); Console.Write("Ingrese Nombre: "); objEntidadProfesor.Nombre = Console.ReadLine(); Console.Write("Ingrese Email: "); objEntidadProfesor.Email = Console.ReadLine(); Logica.Profesor objLogicaProfesor = new Logica.Profesor(); objLogicaProfesor.Agregar(objEntidadProfesor); Console.WriteLine("Profesor agregado exitosamente"); Console.ReadKey(); }
public void TraerTodos() { Logica.Profesor objLogica = new Logica.Profesor(); gvProfesores.DataSource = objLogica.TraerTodos(); gvProfesores.DataBind(); }