public List<SitePage> GetAll() { SitePageDAC _sitePageComponent = new SitePageDAC(); IDataReader reader = _sitePageComponent.GetAllSitePage().CreateDataReader(); List<SitePage> _sitePageList = new List<SitePage>(); while(reader.Read()) { if(_sitePageList == null) _sitePageList = new List<SitePage>(); SitePage _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; _sitePageList.Add(_sitePage); } reader.Close(); return _sitePageList; }
public bool Insert(SitePage sitepage) { SitePageDAC sitepageComponent = new SitePageDAC(); int id = 0; BusinessLogicLayer.Common.ContentEntityLogic.Insert(ref id, "CP", Guid.NewGuid(), DateTime.Now); sitepage.SitePageId = id; return sitepageComponent.InsertNewSitePage( sitepage.SitePageId, sitepage.SectionId, sitepage.PageStatusId, sitepage.SecurityAccessTypeId, sitepage.CreatorId, sitepage.UniquePageName, sitepage.IsMainPage, sitepage.RowGuid, sitepage.RevisionDate, sitepage.ModifiedDate); }
public bool Update(SitePage sitepage ,int old_sitePageId) { SitePageDAC sitepageComponent = new SitePageDAC(); return sitepageComponent.UpdateSitePage( sitepage.SitePageId, sitepage.SectionId, sitepage.PageStatusId, sitepage.SecurityAccessTypeId, sitepage.CreatorId, sitepage.UniquePageName, sitepage.IsMainPage, sitepage.RowGuid, sitepage.RevisionDate, DateTime.Now, old_sitePageId); }
public SitePage GetDefaultPage(int SiteId) { SitePageDAC _sitePageComponent = new SitePageDAC(); IDataReader reader = _sitePageComponent.GetAllSitePage("IsMainPage = 1 and SiteId = " + SiteId).CreateDataReader(); 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; }