public void NombreRepetido(EntGolden e) { DatGolden datos = new DatGolden(); DataTable Dt = datos.NombreRepetido(e.Nombre); if (Dt.Rows.Count > 0) { throw new ApplicationException(e.Nombre + " ya tiene agendada una cita! "); } }
public void Agregar(EntGolden e) { DatGolden datos = new DatGolden(); int filas = datos.Agregar(e.Nombre, e.Email, e.Telefono); if (filas != 1) { throw new ApplicationException("Error al agregar"); } }