using Common.Library.SQL.MySQL; using System; using System.Data; using Common.Library.DataLayer.DTO.Websites.DMCDynamics.LLC; namespace Common.Library.DataLayer.DAO.Websites.DMCDynamics.LLC { public class AboutCompanyDAO : MySQL { public AboutCompanyDAO(string server, string database, string username, string password) : base(server, database, username, password) { } public AboutCompanyDTOCollection SelectAll() { InitConnection(); try { AboutCompanyDTOCollection items = new(); DBCommand.CommandType = CommandType.StoredProcedure; DBCommand.CommandText = "About_Company_SelectAll"; DBReader = DBCommand.ExecuteReader(); while(DBReader.Read()) { AboutCompanyDTO item = new AboutCompanyDTO() { AboutCompanyID = GetInt("AboutCompanyID").Value, AboutHeader = GetString("AboutHeader"), AboutDescription = GetString("AboutDescription"), IsVisible = GetBool("IsVisible").Value, CSS = GetString("CSS"), ImagePath = GetString("ImagePath") }; items.Add(item); } return items.Count == 0 ? null : items; } catch(Exception) { throw; } finally { DisposeConnection(); } } } }