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 CompanyInfoDAO : MySQL { public CompanyInfoDAO(string server, string database, string username, string password) : base(server, database, username, password) { } public CompanyInfoDTO Select() { InitConnection(); try { CompanyInfoDTO item = null; DBCommand.CommandType = CommandType.StoredProcedure; DBCommand.CommandText = "GetCompanyInfo"; DBReader = DBCommand.ExecuteReader(); if(DBReader.Read()) { item = new CompanyInfoDTO() { CompanyName = GetString("CompanyName"), Address = GetString("Address"), PhoneNumber = GetString("PhoneNumber"), EmailAddress = GetString("EmailAddress"), CompanySlogan = GetString("CompanySlogan") }; } return item; } catch(Exception) { throw; } finally { DisposeConnection(); } } } }