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.

54 lines
1.6 KiB
C#

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();
}
}
}
}