internal static List<Supplier> GetSuppliers(int portalID, int languageID)
{
List<Supplier> colSuppliers = null;
Supplier Supplier = null;
using (SqlConnection sqlConnection = new SqlConnection(CMSCoreBase.CMSCoreConnectionString))
{
SqlCommand sqlCommand = new SqlCommand(SN_SUPPLIER_GET_ALL, sqlConnection);
sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
SqlParameter sqlParameter = null;
sqlParameter = new SqlParameter(ECommerceDataMapperBase.PN_ECO_LAN_LAN_ID, System.Data.SqlDbType.Int);
sqlParameter.Direction = System.Data.ParameterDirection.Input;
sqlParameter.Value = languageID;
sqlCommand.Parameters.Add(sqlParameter);
sqlParameter = new SqlParameter(PN_SUPPLIER_PORTAL_ID, System.Data.SqlDbType.Int);
sqlParameter.Direction = System.Data.ParameterDirection.Input;
sqlParameter.Value = portalID;
sqlCommand.Parameters.Add(sqlParameter);
sqlParameter = new SqlParameter(ECommerceDataMapperBase.PN_MODULE_ID, System.Data.SqlDbType.Int);
sqlParameter.Direction = System.Data.ParameterDirection.Input;
sqlParameter.Value = (int)CMSEnums.ECommerceModule.Supplier;
sqlCommand.Parameters.Add(sqlParameter);
sqlCommand.Connection.Open();
using (SqlDataReader sqlDataReader = sqlCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection))
{
colSuppliers = new List<Supplier>();
while (sqlDataReader.Read())
{
Supplier = GetSupplier(colSuppliers, sqlDataReader);
FillFromReader(Supplier, sqlDataReader);
}
sqlDataReader.Close();
sqlCommand.Connection.Close();
}
}
return colSuppliers;
}