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 ServiceInformationDAO : MySQL { public ServiceInformationDAO(string server, string database, string username, string password) : base(server, database, username, password) { } public ServiceInformationDTO SelectOne(int serviceID) { InitConnection(); try { ServiceInformationDTO item = null; DBCommand.CommandType = CommandType.StoredProcedure; DBCommand.CommandText = "ServiceInformation_SelectOne"; DBCommand.Parameters.AddWithValue("@ID", serviceID); DBReader = DBCommand.ExecuteReader(); if (DBReader.Read()) { item = new ServiceInformationDTO() { ServiceInformationID = GetInt("ServiceInformationID").Value, ServiceID = GetInt("ServiceID").Value, ServiceDescription = GetString("ServiceDescription") }; } return item; } catch (Exception) { throw; } finally { DisposeConnection(); } } } }