public static void PageCopyDo(Guid id) { PSCPortal.Engine.Page page = PageList.Where(p => p.Id == id).Single(); PageList.PageCopy(page, ((PageArgs)PSCDialog.DataShare)); //// check subdomain Guid subId = SessionHelper.GetSession(SessionKey.SubDomain) == string.Empty ? Guid.Empty : new Guid(SessionHelper.GetSession(SessionKey.SubDomain)); if (!(subId == Guid.Empty)) { SubDomainInPage sip = new SubDomainInPage(); sip.PageId = ((PageArgs)PSCDialog.DataShare).Page.Id; sip.SubDomainId = subId; sip.AddDB(); } }
public static void PageAdd() { PageArgs pageArgs = (PageArgs)PSCDialog.DataShare; Page page = pageArgs.Page; PageList.AddDB(page); page.UpdatePageLayout(page.LayoutId); // check subdomain Guid subId = SessionHelper.GetSession(SessionKey.SubDomain) == string.Empty ? Guid.Empty : new Guid(SessionHelper.GetSession(SessionKey.SubDomain)); if (!(subId == Guid.Empty)) { SubDomainInPage sip = new SubDomainInPage(); sip.PageId = page.Id; sip.SubDomainId = subId; sip.AddDB(); } }
public void CheckSubDomain(string pageId) { string subDomain = Ultility.GetSubDomain(); string subCurrent = SubDomainInPage.GetSub(new Guid(pageId)) ?? "HomePage"; if (subCurrent == subDomain || (subCurrent == "HomePage" && subDomain == string.Empty)) { return; } string rawUrl = HttpContext.Current.Request.RawUrl; int index = rawUrl.IndexOf('?'); int index1 = rawUrl.IndexOf('='); if (index > 0) { rawUrl = "/" + rawUrl.Substring(index + 1, index1 - (index + 1)) + "/" + rawUrl.Substring(index1 + 1, rawUrl.Length - (index1 + 1)); } HttpContext.Current.Response.Redirect(string.Format("http://{0}{1}{2}", subCurrent == "HomePage" ? "www." : subCurrent + ".", ConfigurationManager.AppSettings["DomainName"], rawUrl)); }