public SectionFiles GetByID(int _sectionFileId) { SectionFilesDAC _sectionFilesComponent = new SectionFilesDAC(); IDataReader reader = _sectionFilesComponent.GetByIDSectionFiles(_sectionFileId); SectionFiles _sectionFiles = null; while (reader.Read()) { _sectionFiles = new SectionFiles(); if (reader["SectionFileId"] != DBNull.Value) { _sectionFiles.SectionFileId = Convert.ToInt32(reader["SectionFileId"]); } if (reader["SectionFileName"] != DBNull.Value) { _sectionFiles.SectionFileName = Convert.ToString(reader["SectionFileName"]); } if (reader["SectionFilePath"] != DBNull.Value) { _sectionFiles.SectionFilePath = Convert.ToString(reader["SectionFilePath"]); } if (reader["SectionId"] != DBNull.Value) { _sectionFiles.SectionId = Convert.ToInt32(reader["SectionId"]); } if (reader["SecurityAccessTypeId"] != DBNull.Value) { _sectionFiles.SecurityAccessTypeId = Convert.ToInt32(reader["SecurityAccessTypeId"]); } _sectionFiles.NewRecord = false; } reader.Close(); return(_sectionFiles); }
public List <SectionFiles> GetAll() { SectionFilesDAC _sectionFilesComponent = new SectionFilesDAC(); IDataReader reader = _sectionFilesComponent.GetAllSectionFiles().CreateDataReader(); List <SectionFiles> _sectionFilesList = new List <SectionFiles>(); while (reader.Read()) { if (_sectionFilesList == null) { _sectionFilesList = new List <SectionFiles>(); } SectionFiles _sectionFiles = new SectionFiles(); if (reader["SectionFileId"] != DBNull.Value) { _sectionFiles.SectionFileId = Convert.ToInt32(reader["SectionFileId"]); } if (reader["SectionFileName"] != DBNull.Value) { _sectionFiles.SectionFileName = Convert.ToString(reader["SectionFileName"]); } if (reader["SectionFilePath"] != DBNull.Value) { _sectionFiles.SectionFilePath = Convert.ToString(reader["SectionFilePath"]); } if (reader["SectionId"] != DBNull.Value) { _sectionFiles.SectionId = Convert.ToInt32(reader["SectionId"]); } if (reader["SecurityAccessTypeId"] != DBNull.Value) { _sectionFiles.SecurityAccessTypeId = Convert.ToInt32(reader["SecurityAccessTypeId"]); } _sectionFiles.NewRecord = false; _sectionFilesList.Add(_sectionFiles); } reader.Close(); return(_sectionFilesList); }
public bool Update(SectionFiles sectionfiles, int old_sectionFileId) { SectionFilesDAC sectionfilesComponent = new SectionFilesDAC(); return(sectionfilesComponent.UpdateSectionFiles(sectionfiles.SectionFileId, sectionfiles.SectionFileName, sectionfiles.SectionFilePath, sectionfiles.SectionId, sectionfiles.SecurityAccessTypeId, old_sectionFileId)); }
public bool Insert(SectionFiles sectionfiles) { SectionFilesDAC sectionfilesComponent = new SectionFilesDAC(); return(sectionfilesComponent.InsertNewSectionFiles(sectionfiles.SectionFileId, sectionfiles.SectionFileName, sectionfiles.SectionFilePath, sectionfiles.SectionId, sectionfiles.SecurityAccessTypeId)); }