Exemplo n.º 1
0
        public SitePage GetByID(int _sitePageId)
        {
            SitePageDAC _sitePageComponent = new SitePageDAC();
            IDataReader reader             = _sitePageComponent.GetByIDSitePage(_sitePageId);
            SitePage    _sitePage          = null;

            while (reader.Read())
            {
                _sitePage = new SitePage();
                if (reader["SitePageId"] != DBNull.Value)
                {
                    _sitePage.SitePageId = Convert.ToInt32(reader["SitePageId"]);
                }
                if (reader["SectionId"] != DBNull.Value)
                {
                    _sitePage.SectionId = Convert.ToInt32(reader["SectionId"]);
                }
                if (reader["PageStatusId"] != DBNull.Value)
                {
                    _sitePage.PageStatusId = Convert.ToInt32(reader["PageStatusId"]);
                }
                if (reader["SecurityAccessTypeId"] != DBNull.Value)
                {
                    _sitePage.SecurityAccessTypeId = Convert.ToInt32(reader["SecurityAccessTypeId"]);
                }
                if (reader["CreatorId"] != DBNull.Value)
                {
                    _sitePage.CreatorId = Convert.ToInt32(reader["CreatorId"]);
                }
                if (reader["UniquePageName"] != DBNull.Value)
                {
                    _sitePage.UniquePageName = Convert.ToString(reader["UniquePageName"]);
                }
                if (reader["IsMainPage"] != DBNull.Value)
                {
                    _sitePage.IsMainPage = Convert.ToBoolean(reader["IsMainPage"]);
                }
                if (reader["RowGuid"] != DBNull.Value)
                {
                    _sitePage.RowGuid = new Guid(reader["RowGuid"].ToString());
                }
                if (reader["RevisionDate"] != DBNull.Value)
                {
                    _sitePage.RevisionDate = Convert.ToDateTime(reader["RevisionDate"]);
                }
                if (reader["ModifiedDate"] != DBNull.Value)
                {
                    _sitePage.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
                }
                if (reader["SiteId"] != DBNull.Value)
                {
                    _sitePage.SiteId = Convert.ToInt32(reader["SiteId"]);
                }
                _sitePage.NewRecord = false;
            }
            reader.Close();
            return(_sitePage);
        }