using Common.Library.SQL.MySQL; using System; using System.Data; using Common.Library.DataLayer.DTO.Websites.JasonNeumannAudio.com; namespace Common.Library.DataLayer.DAO.Websites.JasonNeumannAudio.com { public class ServicesDAO : MySQL { public ServicesDAO(DBConnectionInformation connectionInformation) : base(connectionInformation){ } public ServicesDTOCollection GetServices() { InitConnection(); ServicesDTOCollection items = new(); try { DBCommand.CommandType = CommandType.StoredProcedure; DBCommand.CommandText = "services_page_select_all"; DBReader = DBCommand.ExecuteReader(); while(DBReader.Read()) { ServicesDTO item = new() { ServicePageID = GetInt("ServicePageID").Value, ServiceText = GetString("ServiceText") }; items.Add(item); } return items.Count == 0 ? null : items; } catch(Exception) { throw; } finally { DisposeConnection(); } } } }