private string[] GetDomains(common.clsWeb Web) { spParams = new object[1]; spParams.SetValue(Web.WebID, 0); SqlDataReader drDomains = data.SqlHelper.ExecuteReader(this.strConn, "prc_WEB_HOST_sel", spParams); StringBuilder sbDomains = new StringBuilder(""); string strDomains; string[] arrDomains; while (drDomains.Read()) { sbDomains.Append(drDomains["web_host_url"].ToString() + "|"); } drDomains.Close(); strDomains = sbDomains.ToString(); if (strDomains.Length > 0) { strDomains = strDomains.Remove(strDomains.Length - 1, 1); arrDomains = strDomains.Split(new char[] { '|' }); return(arrDomains); } return(new string[0]); }
public common.clsWeb Web_Update(common.clsWeb Web, common.clsUser User) { string strWebHosts = this.GetSqlSplitString(Web.Domains); string strWebRoles = this.GetSqlSplitString(Web.Roles); // Try to insert new Web spParams = new object[7]; spParams.SetValue(Web.WebID, 0); spParams.SetValue(User.UserID, 1); spParams.SetValue(Web.Title, 2); spParams.SetValue(Web.MailFromAddress, 3); spParams.SetValue(Web.PageFooter, 4); spParams.SetValue(strWebHosts, 5); spParams.SetValue(strWebRoles, 6); // Read data out to set the return Web object dr = data.SqlHelper.ExecuteReader(this.strConn, "prc_WEB_ins_upd", spParams); dr.Read(); boolResult = bool.Parse(dr["Result"].ToString()); strMessage = "\r\r\t" + dr["MessageOut"].ToString() + "<br>"; Web.WebID = int.Parse(dr["web_id"].ToString()); Web.WebGUID = dr["web_guid"].ToString(); common.clsPage clsPage = new common.clsPage(); clsPage.PageID = int.Parse(dr["page_id"].ToString()); clsPage.PageIDParent = clsPage.PageID; Web.Page = clsPage; dr.Close(); return(Web); }
public string[] GetRoles(common.clsWeb Web) { spParams = new object[1]; spParams.SetValue(Web.WebID, 0); return(this.GetRoles(data.SqlHelper.ExecuteReader(this.strConn, "prc_ROLE_WEB_sel", spParams))); }
public bool Web_Delete(common.clsWeb Web) { spParams = new object[1]; spParams.SetValue(Web.WebID, 0); this.GetSqlTransResult(data.SqlHelper.ExecuteReader(strConn, "prc_WEB_del", spParams)); return(boolResult); }
public clsContentManager(string strDBConn, string strHttpHost, int intPageID) { this.strConn = strDBConn; this.strWebHostUrl = strHttpHost; this.intPageID = intPageID; this.strMessage = ""; spParams = new object[3]; spParams.SetValue(strWebHostUrl, 0); spParams.SetValue(null, 1); spParams.SetValue(intPageID, 2); clsWeb = this.GetWeb(data.SqlHelper.ExecuteReader(strConn, "prc_WEB_PAGE_sel", spParams)); }
public clsContentManager(string strDBConn, string strHttpHost, int intPageID) { this.strConn = strDBConn; this.strWebHostUrl = strHttpHost; this.intPageID = intPageID; this.strMessage = ""; spParams = new object[3]; spParams.SetValue(strWebHostUrl, 0); spParams.SetValue(null, 1); spParams.SetValue(intPageID, 2); clsWeb = this.GetWeb( data.SqlHelper.ExecuteReader(strConn, "prc_WEB_PAGE_sel", spParams) ); }
private common.clsWeb GetWeb(SqlDataReader drToRead) { // Set the Web and Page objects drToRead.Read(); clsWeb = new common.clsWeb(); clsWeb.WebID = int.Parse(drToRead["web_id"].ToString()); clsWeb.WebIDParent = int.Parse(drToRead["web_id_parent"].ToString()); clsWeb.WebGUID = drToRead["web_guid"].ToString(); clsWeb.Title = drToRead["web_title"].ToString(); clsWeb.MailFromAddress = drToRead["web_mail_from"].ToString(); clsWeb.PageFooter = drToRead["page_footer"].ToString(); clsWeb.PageIDHome = int.Parse(drToRead["page_id_home"].ToString()); clsWeb.PathToStylesheet = drToRead["path_to_stylesheet"].ToString(); clsWeb.PathToDocs = drToRead["path_to_docs"].ToString(); clsWeb.PathToImages = drToRead["path_to_images"].ToString(); clsWeb.Status = (common.Status) int.Parse(drToRead["web_status"].ToString()); clsWeb.Roles = this.GetRoles(clsWeb); clsWeb.Domains = this.GetDomains(clsWeb); clsPage = new common.clsPage(); clsPage.PageID = int.Parse(drToRead["page_id"].ToString()); clsPage.PageIDParent = int.Parse(drToRead["page_id_parent"].ToString()); clsPage.WebID = clsWeb.WebID; clsPage.WizardID = (drToRead["wizard_id"].ToString().Length > 0) ? int.Parse(drToRead["wizard_id"].ToString()) : 0; clsPage.SortOrder = int.Parse(drToRead["sort_order"].ToString()); clsPage.ShowOnMenu = bool.Parse(drToRead["yn_showonmenu"].ToString()); clsPage.IsNewsPage = bool.Parse(drToRead["yn_news"].ToString()); clsPage.IsNewsArchive = bool.Parse(drToRead["yn_news_archive"].ToString()); clsPage.Title = drToRead["page_title"].ToString(); clsPage.ControlID = (drToRead["control_id"].ToString().Length > 0) ? int.Parse(drToRead["control_id"].ToString()) : 0; clsPage.Control = (drToRead["page_control"].ToString().Length > 0) ? drToRead["page_control"].ToString() : null; clsPage.Image = (drToRead["page_image"].ToString().Length > 0) ? drToRead["page_image"].ToString() : null; clsPage.Body = (drToRead["page_body"].ToString().Length > 0) ? drToRead["page_body"].ToString() : null; clsPage.Roles = this.GetRoles(clsPage); drToRead.Close(); clsWeb.Page = clsPage; return(clsWeb); }
private common.clsWeb GetWeb(SqlDataReader drToRead) { // Set the Web and Page objects drToRead.Read(); clsWeb = new common.clsWeb(); clsWeb.WebID = int.Parse(drToRead["web_id"].ToString()); clsWeb.WebIDParent = int.Parse(drToRead["web_id_parent"].ToString()); clsWeb.WebGUID = drToRead["web_guid"].ToString(); clsWeb.Title = drToRead["web_title"].ToString(); clsWeb.MailFromAddress = drToRead["web_mail_from"].ToString(); clsWeb.PageFooter = drToRead["page_footer"].ToString(); clsWeb.PageIDHome = int.Parse(drToRead["page_id_home"].ToString()); clsWeb.PathToStylesheet = drToRead["path_to_stylesheet"].ToString(); clsWeb.PathToDocs = drToRead["path_to_docs"].ToString(); clsWeb.PathToImages = drToRead["path_to_images"].ToString(); clsWeb.Status = (common.Status) int.Parse(drToRead["web_status"].ToString()); clsWeb.Roles = this.GetRoles(clsWeb); clsWeb.Domains = this.GetDomains(clsWeb); clsPage = new common.clsPage(); clsPage.PageID = int.Parse(drToRead["page_id"].ToString()); clsPage.PageIDParent = int.Parse(drToRead["page_id_parent"].ToString()); clsPage.WebID = clsWeb.WebID; clsPage.WizardID = (drToRead["wizard_id"].ToString().Length > 0) ? int.Parse(drToRead["wizard_id"].ToString()) : 0; clsPage.SortOrder = int.Parse(drToRead["sort_order"].ToString()); clsPage.ShowOnMenu = bool.Parse(drToRead["yn_showonmenu"].ToString()); clsPage.IsNewsPage = bool.Parse(drToRead["yn_news"].ToString()); clsPage.IsNewsArchive = bool.Parse(drToRead["yn_news_archive"].ToString()); clsPage.Title = drToRead["page_title"].ToString(); clsPage.ControlID = (drToRead["control_id"].ToString().Length > 0) ? int.Parse(drToRead["control_id"].ToString()) : 0; clsPage.Control = (drToRead["page_control"].ToString().Length > 0) ? drToRead["page_control"].ToString() : null; clsPage.Image = (drToRead["page_image"].ToString().Length > 0) ? drToRead["page_image"].ToString() : null; clsPage.Body = (drToRead["page_body"].ToString().Length > 0) ? drToRead["page_body"].ToString() : null; clsPage.Roles = this.GetRoles(clsPage); drToRead.Close(); clsWeb.Page = clsPage; return clsWeb; }