protected void btnModificar_Click(object sender, EventArgs e) { try { int tipo; if (DDLTipoOntograma.SelectedIndex == 0) { tipo = 0; } else { tipo = 1; } IPaciente ipaciente = new MPaciente(); DATOS_ClinicaDental.Modelos.Paciente paciente = new DATOS_ClinicaDental.Modelos.Paciente { IdPaciente = Convert.ToInt32(txtIdPaciente.Text), Nombre = txtNombre.Text, Apellido1 = txtApellido1.Text, Apellido2 = txtApellido2.Text, Telefono = txtTelefono.Text, Correo = txtCorreo.Text, FechaNacimiento = Convert.ToDateTime(txtFecha.Text), IdTipoOntograma = tipo }; usu.ActualizarPaciente(paciente); buscar.Visible = true; divMantenimiento.Visible = false; MostrarMensaje("Paciente modificado con éxito"); ttIdPaciente.Text = String.Empty; gridview.Visible = true; } catch (Exception) { MostrarMensajeError("Ha ocurrido un error, intente mas tarde"); } }
public void ActualizarPaciente(DATOS_ClinicaDental.Modelos.Paciente paciente) { _db.Update(paciente); }
public void InsertarPaciente(DATOS_ClinicaDental.Modelos.Paciente paciente) { _db.Insert(paciente); }