/// <summary> /// This method fetches a 'List<Verb>' object. /// This method uses the 'Verbs_FetchAll' procedure. /// </summary> /// <returns>A 'List<Verb>'</returns> /// </summary> public List <Verb> FetchAllVerbs(FetchAllVerbsStoredProcedure fetchAllVerbsProc, DataConnector databaseConnector) { // Initial Value List <Verb> verbCollection = null; // Verify database connection is connected if ((databaseConnector != null) && (databaseConnector.Connected)) { // First Get Dataset DataSet allVerbsDataSet = this.DataHelper.LoadDataSet(fetchAllVerbsProc, databaseConnector); // Verify DataSet Exists if (allVerbsDataSet != null) { // Get DataTable From DataSet DataTable table = this.DataHelper.ReturnFirstTable(allVerbsDataSet); // if table exists if (table != null) { // Load Collection verbCollection = VerbReader.LoadCollection(table); } } } // return value return(verbCollection); }
/// <summary> /// This method finds a 'Verb' object. /// This method uses the 'Verb_Find' procedure. /// </summary> /// <returns>A 'Verb' object.</returns> /// </summary> public Verb FindVerb(FindVerbStoredProcedure findVerbProc, DataConnector databaseConnector) { // Initial Value Verb verb = null; // Verify database connection is connected if ((databaseConnector != null) && (databaseConnector.Connected)) { // First Get Dataset DataSet verbDataSet = this.DataHelper.LoadDataSet(findVerbProc, databaseConnector); // Verify DataSet Exists if (verbDataSet != null) { // Get DataTable From DataSet DataRow row = this.DataHelper.ReturnFirstRow(verbDataSet); // if row exists if (row != null) { // Load Verb verb = VerbReader.Load(row); } } } // return value return(verb); }