private void btnEliminar_Click(object sender, EventArgs e) { bool paso = false; Estudiante estudiante = new Estudiante(); int valor = (int)EstudianteIdNumericUpDown.Value; if (valor > 0) { estudiante = EstudianteBLL.Buscar(valor); if (estudiante != null) { paso = EstudianteBLL.Eliminar(valor); } if (paso) { MessageBox.Show("Estudiante: " + estudiante.Nombre + " Eliminado Correctamente", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Error al intentar eliminar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Introduzca el id", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public void BuscarTest() { Estudiantes Estudiante = new Estudiantes(); Estudiante = EstudianteBLL.Buscar(5); Assert.Fail(); }
public void GuardarTest() { bool paso; Inscripciones inscripciones = new Inscripciones(); Estudiantes estudiantes = new Estudiantes(); estudiantes = EstudianteBLL.Buscar(1); decimal BalanceInicial = estudiantes.EstudianteBalance; decimal BalanceEsperado = BalanceInicial + 3000; inscripciones.InscripcionId = 0; inscripciones.EstudianteId = 1; inscripciones.Fecha = DateTime.Now; inscripciones.Comentario = "Usted lo hizo bien"; inscripciones.Monto = 4000; inscripciones.InscripcionBalance = 1000; paso = InscripcionBLL.Guardar(inscripciones); decimal BalancePrueba = InscripcionBLL.Buscar(inscripciones.EstudianteId).InscripcionBalance; if (BalanceEsperado == BalancePrueba) { paso = true; } Assert.AreEqual(paso, true); }
public void ModificarTest() { bool paso; Inscripciones inscripciones = new Inscripciones(); Estudiantes p = new Estudiantes(); p = EstudianteBLL.Buscar(1); decimal BalanceInicial = p.EstudianteBalance; decimal BalanceEsperado = BalanceInicial - 1000; inscripciones.InscripcionId = 1; inscripciones.EstudianteId = 1; inscripciones.Fecha = DateTime.Now; inscripciones.Comentario = "El paso se realizo con Exito"; inscripciones.Monto = 3000; inscripciones.InscripcionBalance = 1000; paso = InscripcionBLL.Modificar(inscripciones); decimal BalancePrueba = InscripcionBLL.Buscar(inscripciones.EstudianteId).InscripcionBalance; if (BalanceEsperado == BalancePrueba) { paso = true; } Assert.AreEqual(paso, true); }
public void BuscarTest() { EstudianteBLL <Estudiante> estudiante = new EstudianteBLL <Estudiante>(); Estudiante e = EstudianteBLL.Buscar(1); Assert.IsNotNull(e); }
private Pagos LlenarCampos() { int Id = 0; Id = Decimal.ToInt32(IDnumericUpDownP.Value); Pagos pago = PagosBLL.Buscar(Id); if (pago == null) { MessageBox.Show("No se encontro el pago"); } else { FechaTimePickerP.Text = pago.Fecha; IdEstudiantesnumericUpDownP.Value = pago.IdEstudiante; MontotextBox.Text = Convert.ToString(pago.Monto); PagotextBoxP.Text = Convert.ToString(pago.Pago); BalancetextBox.Text = Convert.ToString(pago.Balance); ObservacionestextBoxP.Text = pago.Observaciones; Estudiantes estudiantes = EstudianteBLL.Buscar(pago.IdEstudiante); Nombrelabel.Text = estudiantes.Nombres; } return(pago); }
public void BuscarTest() { Estudiante e; e = EstudianteBLL.Buscar(2); Assert.AreEqual(e, e); }
private void Buscarbutton1_Click(object sender, EventArgs e) { int id; int.TryParse(IDnumericUpDown1.Text, out id); Limpiar(); try { Estudiantes estudiante = EstudianteBLL.Buscar(id); if (estudiante != null) { LlenarCampo(estudiante); } else { MessageBox.Show("Evaluacion no encontrada.", "error", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception) { throw; } }
private void Eliminarbutton2_Click(object sender, EventArgs e) { int Id; int.TryParse(IDnumericUpDown1.Value.ToString(), out Id); try { if (EstudianteBLL.Buscar(Id) != null) { if (EstudianteBLL.Eliminar(Id)) { MessageBox.Show("Eliminada Correctamente", "Eliminada", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("No se puede eliminar porque no existe", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception) { throw; } }
public void BuscarTest() { Estudiantes estudiantes; estudiantes = EstudianteBLL.Buscar(2); Assert.AreEqual(estudiantes, estudiantes); }
public void BuscarTest() { Estudiantes estu = new Estudiantes(); estu = EstudianteBLL.Buscar(1); Assert.AreEqual(estu, estu); }
private void BuscarEbuttonP_Click(object sender, EventArgs e) { Estudiantes estudiantes = EstudianteBLL.Buscar(int.Parse(IdEstudiantesnumericUpDownP.Value.ToString())); if (estudiantes != null) { Nombrelabel.Text = estudiantes.Nombres; } }
public void ModificarTest() { EstudianteBLL <Estudiante> Estudiante = new EstudianteBLL <Estudiante>(); bool estado = false; Estudiante e = EstudianteBLL.Buscar(1); e.Nombres = "Fisica"; estado = EstudianteBLL.Modificar(e); Assert.AreEqual(true, estado); }
private void Guardarbutton_Click(object sender, EventArgs e) { bool estado = false; Estudiante estudiante = new Estudiante(); if (Validar()) { MessageBox.Show("Llene los campos correctamente", "Falló", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { estudiante = LlenaClase(); if (Convert.ToInt32(IdnumericUpDown.Value) == 0) { estado = EstudianteBLL.Guardar(estudiante); MessageBox.Show("Guardado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); Limpiar(); } else { int id = Convert.ToInt32(IdnumericUpDown.Value); Estudiante usu = new Estudiante(); usu = EstudianteBLL.Buscar(id); if (usu != null) { estado = EstudianteBLL.Modificar(LlenaClase()); MessageBox.Show("Modificado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Id no existe", "Falló", MessageBoxButtons.OK, MessageBoxIcon.Error); } } if (estado) { Limpiar(); } else { MessageBox.Show("No se pudo guardar", "Falló", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void BuscarEbuttonP_Click(object sender, EventArgs e) { int Id = 0; Id = Decimal.ToInt32(IdEstudiantesnumericUpDownP.Value); Estudiantes estudiantes = EstudianteBLL.Buscar(Id); if (estudiantes == null) { MessageBox.Show("No existe el estudiante que busca!"); } else { Nombrelabel.Text = estudiantes.Nombres; } }
private void Buscarbutton_Click(object sender, EventArgs e) { int id = Convert.ToInt32(IdnumericUpDown.Value); Estudiante estudiante = EstudianteBLL.Buscar(id); if (estudiante != null) { FechaDateTimePicker.Value = estudiante.Fecha; NombrestextBox.Text = estudiante.Nombres; BalanceTextBox.Text = estudiante.Balance.ToString(); } else { MessageBox.Show("No se encontró", "Falló", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ___BuscarButton__Click(object sender, RoutedEventArgs e) { int id; Estudiantes estudiantes = new Estudiantes(); int.TryParse(EstudianteIDTex.Text, out id); Limpiar(); estudiantes = EstudianteBLL.Buscar(id); if (estudiantes != null) { LlenaCampo(estudiantes); } else { MessageBox.Show("Estudiante NO Encontrada..."); } }
private void BuscarPersonaButton_Click(object sender, RoutedEventArgs e) { int id; int.TryParse(PersonaId_Text.Text, out id); Estudiantes es = new Estudiantes(); es = EstudianteBLL.Buscar(id); if (es != null) { MessageBox.Show("Encontrado"); } else { MessageBox.Show("No Encontrado"); } }
private void BuscarButton_Click(object sender, EventArgs e) { _ = new Estudiante(); int.TryParse(IDNumericUpDown.Text, out int id); Limpiar(); Estudiante estudiante = EstudianteBLL.Buscar(id); if (estudiante == null) { MessageBox.Show("Persona No Encontrada."); } else { LlenaCampo(estudiante); } }
private void Eliminarbutton_Click(object sender, EventArgs e) { try { if (EstudianteBLL.Buscar((int)EstudianteIdNumericUpDown.Value) == null) { MessageBox.Show("No se puede eliminar una Asignatura que no existe"); } else { EstudianteBLL.Eliminar((int)EstudianteIdNumericUpDown.Value); MessageBox.Show("Eliminado correctamente"); Limpiar(); } } catch (Exception) { MessageBox.Show("Hubo un error"); } }
private void BuscarButton_Click(object sender, EventArgs e) { int id; Estudiante estudiante = new Estudiante(); id = Convert.ToInt32(IDnumericUpDown.Value); LimpiarCampos(); estudiante = EstudianteBLL.Buscar(id); if (estudiante != null) { LlenarCampos(estudiante); } else { MessageBox.Show("Estudiante no encontrado"); } }
private void Guardarbutton_Click(object sender, EventArgs e) { if (!Validar()) { return; } Estudiante estudiante = new Estudiante(); estudiante = LlenarClase(); try { if (EstudianteBLL.Buscar((int)EstudianteIdNumericUpDown.Value) != null) { EstudianteBLL.Modificar(estudiante); MessageBox.Show("Modificado Correctamente"); Limpiar(); } else { if (EstudianteIdNumericUpDown.Value == 0) { if (!EstudianteBLL.Duplicado(NombretextBox.Text)) { EstudianteBLL.Guardar(estudiante); MessageBox.Show("Se guardo correctamente"); Limpiar(); } else { errorProvider.SetError(NombretextBox, "Este Tipo ya existe"); } } } } catch (Exception) { MessageBox.Show("Hubo un erro"); } }
private void Buscar_button1_Click(object sender, EventArgs e) { int id; Estudiante estudiante = new Estudiante(); int.TryParse(ID_numericUpDown1.Text, out id); Limpiar(); estudiante = EstudianteBLL.Buscar(id); if (estudiante != null) { MessageBox.Show("Estudiante encontrado."); LlenarCampo(estudiante); } else { MessageBox.Show("Estudiante no encontrado."); } }
public void EliminarTest() { bool paso; Inscripciones inscripciones = new Inscripciones(); Estudiantes estudiantes; Inscripciones i; decimal BalanceEsperado = 0; paso = InscripcionBLL.Eliminar(1, 1); estudiantes = EstudianteBLL.Buscar(1); i = InscripcionBLL.Buscar(1); if (i.InscripcionBalance == BalanceEsperado && estudiantes.EstudianteBalance == BalanceEsperado) { paso = true; } Assert.AreEqual(paso, true); }
private void BuscarbuttonP_Click(object sender, EventArgs e) { Becas becas = BecasBLL.Buscar(int.Parse(NotaIdUpDownP.Value.ToString())); if (becas != null) { FechaTimePickerP.Text = becas.Fecha; MontotextBox.Text = becas.Monto.ToString(); porcientotextBox.Text = becas.PctBeca.ToString(); ObservacionestextBoxP.Text = becas.Observaciones.ToString(); Estudiantes estudiantes = EstudianteBLL.Buscar(becas.EstudianteId); if (estudiantes != null) { Nombrelabel.Text = estudiantes.Nombres; } } else { MessageBox.Show(" rebisese tome fosfobe 12"); } }
private void Buscarbutton_Click(object sender, EventArgs e) { int id; Estudiante estudiante = new Estudiante(); Inscripcion inscripcion = new Inscripcion(); int.TryParse(IDnumericUpDown.Text, out id); Limpiar(); estudiante = EstudianteBLL.Buscar(id); if (estudiante != null) { MessageBox.Show("Estudiante encontrado"); LLenaCampo(estudiante, inscripcion); } else { MessageBox.Show("Estudiante no encontrado"); } }
private void Buscarbutton_Click(object sender, EventArgs e) { Estudiante tipo = new Estudiante(); try { tipo = EstudianteBLL.Buscar((int)EstudianteIdNumericUpDown.Value); if (tipo != null) { Limpiar(); LlenarCampos(tipo); } else { MessageBox.Show("Asignatura no encontrado"); } } catch (Exception) { MessageBox.Show("Hubo un error"); } }
private void Eliminarbutton_Click(object sender, EventArgs e) { int id = Convert.ToInt32(IdnumericUpDown.Value); Estudiante estudiante = EstudianteBLL.Buscar(id); if (estudiante != null) { if (EstudianteBLL.Eliminar(id)) { MessageBox.Show("Eliminado!!", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); Limpiar(); } else { MessageBox.Show("No se pudo eliminar!!", "Falló", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("No existe!!", "Falló", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Buscarbutton_Click_1(object sender, EventArgs e) { int id; Inscripcion inscripcion = new Inscripcion(); Estudiante estudiante = new Estudiante(); int.TryParse(IncripcionIDnumericUpDown.Text, out id); int.TryParse(EstudianteIDnumericUpDown.Text, out id); Limpiar(); inscripcion = InscripcionBLL.Buscar(id); estudiante = EstudianteBLL.Buscar(id); if (inscripcion != null && estudiante != null) { MessageBox.Show("Encontrado"); LLenaCampo(inscripcion, estudiante); } else { MessageBox.Show("No encontrado"); } }
private void btnBuscar_Click(object sender, EventArgs e) { Estudiante estudiante = new Estudiante(); int valor = (int)EstudianteIdNumericUpDown.Value; if (valor > 0) { estudiante = EstudianteBLL.Buscar(valor); if (estudiante != null) { LlenaCampos(estudiante); MessageBox.Show("Registro Encontrado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { LimpiarCampos(); MessageBox.Show("Registro no encontrado", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("Introduzca un id valido", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }