Esempio n. 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;
 }
Esempio n. 2
0
 public bool Insert(ModuleSection modulesection)
 {
     int autonumber = 0;
     ModuleSectionDAC modulesectionComponent = new ModuleSectionDAC();
     bool endedSuccessfuly = modulesectionComponent.InsertNewModuleSection( ref autonumber,  modulesection.HomePageID,  modulesection.SectionID,  modulesection.OrderNumber,  modulesection.ItemsNumber,  modulesection.ItemsPerPage,  modulesection.IsActive);
     if(endedSuccessfuly)
     {
         modulesection.ModuleSectionID = autonumber;
     }
     return endedSuccessfuly;
 }
Esempio n. 3
0
 public bool Update(ModuleSection modulesection ,int old_moduleSectionID)
 {
     ModuleSectionDAC modulesectionComponent = new ModuleSectionDAC();
     return modulesectionComponent.UpdateModuleSection( modulesection.HomePageID,  modulesection.SectionID,  modulesection.OrderNumber,  modulesection.ItemsNumber,  modulesection.ItemsPerPage,  modulesection.IsActive,  old_moduleSectionID);
 }
Esempio n. 4
0
 public ModuleSection GetByID(int _moduleSectionID)
 {
     ModuleSectionDAC _moduleSectionComponent = new ModuleSectionDAC();
      IDataReader reader = _moduleSectionComponent.GetByIDModuleSection(_moduleSectionID);
      ModuleSection _moduleSection = null;
      while(reader.Read())
      {
          _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;             }             reader.Close();
      return _moduleSection;
 }