You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.4 KiB
C#

using Common.Library.SQL.MySQL;
using System;
using System.Data;
4 years ago
using Common.Library.DataLayer.DTO.Websites.DMCDynamics.LLC;
4 years ago
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();
}
}
}
}