/// <summary> /// Executes the query. /// </summary> /// <returns> /// string that reprsent the result /// </returns> public string Execute() { if (fromYear == -1 && toYear == -1) { fromYear = GetYear(); toYear = GetYear(); } Delegate[] arr = queriesList.GetInvocationList(); int queryNum = rand.Next(arr.Length); SelfExecuterHeuristics h = ((HeuristicsBank.YearHeuristics)arr[queryNum])(user, fromYear, toYear); return(h.Executer(conn)); }
/// <summary> /// Executes the query. /// </summary> /// <returns> /// string that reprsent the result /// </returns> public string Execute() { Genre genre = null; if (!genreName.Equals(string.Empty)) { genre = Entities.EntitiesFactory.GetGenreFromGenreName(genreName, conn); if (genre == null) { return("No such genre"); } } Delegate[] arr = queriesList.GetInvocationList(); int queryNum = rand.Next(arr.Length); SelfExecuterHeuristics h = ((HeuristicsBank.GenreHeuristics)arr[queryNum])(user, genre); return(h.Executer(conn)); }
/// <summary> /// Executes the query. /// </summary> /// <returns> /// string that reprsent the result /// </returns> public string Execute() { Place place = null; if (!placeName.Equals(string.Empty)) { place = Entities.EntitiesFactory.GetPlaceFromPlaceName(placeName, conn); if (place == null) { return("No such place"); } } Delegate[] arr = queriesList.GetInvocationList(); int queryNum = rand.Next(arr.Length); SelfExecuterHeuristics h = ((HeuristicsBank.PlaceHeuristics)arr[queryNum])(user, place); return(h.Executer(conn)); }