Пример #1
0
 public List<ModuleSection> GetAllByHomePageID(int HomePageID)
 {
     ModuleSectionDAC _moduleSectionComponent = new ModuleSectionDAC();
     IDataReader reader = _moduleSectionComponent.GetAllModuleSection("HomePageID = " + HomePageID).CreateDataReader();
     List<ModuleSection> _moduleSectionList = new List<ModuleSection>();
     while (reader.Read())
     {
         if (_moduleSectionList == null)
             _moduleSectionList = new List<ModuleSection>();
         ModuleSection _moduleSection = new ModuleSection();
         if (reader["ModuleSectionID"] != DBNull.Value)
             _moduleSection.ModuleSectionID = Convert.ToInt32(reader["ModuleSectionID"]);
         if (reader["HomePageID"] != DBNull.Value)
             _moduleSection.HomePageID = Convert.ToInt32(reader["HomePageID"]);
         if (reader["SectionID"] != DBNull.Value)
             _moduleSection.SectionID = Convert.ToInt32(reader["SectionID"]);
         if (reader["OrderNumber"] != DBNull.Value)
             _moduleSection.OrderNumber = Convert.ToInt32(reader["OrderNumber"]);
         if (reader["ItemsNumber"] != DBNull.Value)
             _moduleSection.ItemsNumber = Convert.ToInt32(reader["ItemsNumber"]);
         if (reader["ItemsPerPage"] != DBNull.Value)
             _moduleSection.ItemsPerPage = Convert.ToInt32(reader["ItemsPerPage"]);
         if (reader["IsActive"] != DBNull.Value)
             _moduleSection.IsActive = Convert.ToBoolean(reader["IsActive"]);
         _moduleSection.NewRecord = false;
         _moduleSectionList.Add(_moduleSection);
     } reader.Close();
     return _moduleSectionList;
 }