protected void Page_Load(object sender, EventArgs e) { //判断当前域名是否是专线系统为组团用户配置的域名地址, //如果是的话,则跳转到该专线系统下的组团登录地址。 EyouSoft.BLL.SysStructure.SystemDomain bll = new EyouSoft.BLL.SysStructure.SystemDomain(); EyouSoft.Model.SysStructure.SystemDomain domain = bll.GetDomain(Request.Url.Host.ToLower()); if (domain != null) { string desurl = domain.Url; //组团登录地址 //如果组团登录地址不为空 if (!string.IsNullOrEmpty(desurl)) //是 { //跳转到目标URL Response.Redirect(desurl, true); return; } } //默认跳转到 个人中心 提醒页面. string url = "/UserCenter/WorkAwake/AppectAwake.aspx"; Response.Redirect(url, true); }
/// <summary> /// 获取域名信息 /// </summary> /// <param name="domain">域名</param> /// <returns></returns> public EyouSoft.Model.SysStructure.SystemDomain GetDomain(string domain) { EyouSoft.Model.SysStructure.SystemDomain model = (EyouSoft.Model.SysStructure.SystemDomain) EyouSoft.Cache.Facade.EyouSoftCache.GetCache(EyouSoft.Cache.Tag.System.SystemDomain + domain); if (model == null) { DbCommand dc = this.SystemStore.GetSqlStringCommand(SQL_DOMAIN_SELECT); this.SystemStore.AddInParameter(dc, "domain", DbType.String, domain); using (IDataReader rdr = EyouSoft.Toolkit.DAL.DbHelper.ExecuteReader(dc, this.SystemStore)) { if (rdr.Read()) { model = new EyouSoft.Model.SysStructure.SystemDomain() { Domain = rdr["Domain"].ToString(), SysId = rdr.GetInt32(rdr.GetOrdinal("SysId")), CompanyId = rdr.GetInt32(rdr.GetOrdinal("CompanyId")), Url = rdr["Url"].ToString() }; } } if (model != null) { EyouSoft.Cache.Facade.EyouSoftCache.Add(EyouSoft.Cache.Tag.System.SystemDomain + domain, model, DateTime.Now.AddHours(2)); } } return(model); }
protected void Page_Load(object sender, EventArgs e) { //设置公司ID //判断 当前域名是否是专线系统为组团配置的域名 domain = new EyouSoft.BLL.SysStructure.SystemDomain().GetDomain(Request.Url.Host.ToLower()); companyId = domain.CompanyId; if (!IsPostBack) { //设定导航页被选中项 this.WhHeadControl1.NavIndex = 0; //绑定省份下拉框 BindPro(); } #region 设置页面title,meta //声明基础设置实体对象 EyouSoft.Model.SiteStructure.SiteBasicConfig configModel = new EyouSoft.BLL.SiteStructure.SiteBasicConfig().GetSiteBasicConfig(domain.CompanyId); if (configModel != null) { //添加Meta Literal keywork = new Literal(); keywork.Text = "<meta name=\"keywords\" content= \"" + configModel.SiteMeta + "\" />"; this.Page.Header.Controls.Add(keywork); } #endregion //设置导航用户控件的公司ID this.WhHeadControl1.CompanyId = companyId; //设置专线介绍用户控件的公司ID this.WhLineControl1.CompanyId = companyId; //设置友情链接公司ID this.WhBottomControl1.CompanyId = companyId; }
/// <summary> /// 根据当前URL的域名信息 ,获取对应的公司ID /// </summary> /// <param name="host"></param> /// <returns></returns> private EyouSoft.Model.SysStructure.SystemDomain GetCompanyIdByHost(string host) { EyouSoft.BLL.SysStructure.SystemDomain bll = new EyouSoft.BLL.SysStructure.SystemDomain(); EyouSoft.Model.SysStructure.SystemDomain domain = bll.GetDomain(host); return(domain); }
protected void Page_Load(object sender, EventArgs e) { bool _IsLogin = EyouSoft.Security.Membership.UserProvider.IsUserLogin(out SiteUserInfo); if (!IsPostBack) { this.hidDocName.Value = EyouSoft.Common.Utils.GetQueryStringValue("docName"); this.hidDocName.Value = "个人详细信息"; if (SiteUserInfo == null) { EyouSoft.BLL.SysStructure.SystemDomain bll = new EyouSoft.BLL.SysStructure.SystemDomain(); EyouSoft.Model.SysStructure.SystemDomain domain = bll.GetDomain(Request.Url.Host.ToLower()); CurrentUserCompanyID = domain.CompanyId; EyouSoft.BLL.CompanyStructure.Customer Customer = new EyouSoft.BLL.CompanyStructure.Customer(); EyouSoft.Model.CompanyStructure.CompanyPrintTemplate CustomerConfig = GetTemplateByCompaneyId(CurrentUserCompanyID); if (CustomerConfig != null) { DepartStamp = CustomerConfig.DepartStamp; PageHeadFile = CustomerConfig.PageHeadFile; PageFootFile = CustomerConfig.PageFootFile; } } else { if (SiteUserInfo.ContactInfo.UserType == EyouSoft.Model.EnumType.CompanyStructure.CompanyUserType.专线用户) { CurrentUserCompanyID = SiteUserInfo.CompanyID; EyouSoft.Model.CompanyStructure.CompanyPrintTemplate modelDepartmentPrint = GetTemplate(); if (modelDepartmentPrint != null) { DepartStamp = modelDepartmentPrint.DepartStamp; PageHeadFile = modelDepartmentPrint.PageHeadFile; PageFootFile = modelDepartmentPrint.PageFootFile; } } else if (SiteUserInfo.ContactInfo.UserType == EyouSoft.Model.EnumType.CompanyStructure.CompanyUserType.组团用户) { CurrentUserCompanyID = SiteUserInfo.TourCompany.TourCompanyId; EyouSoft.BLL.CompanyStructure.Customer Customer = new EyouSoft.BLL.CompanyStructure.Customer(); EyouSoft.Model.CompanyStructure.CustomerConfig CustomerConfig = Customer.GetCustomerConfigModel(CurrentUserCompanyID); if (CustomerConfig != null) { DepartStamp = CustomerConfig.CustomerStamp; PageHeadFile = CustomerConfig.PageHeadFile; PageFootFile = CustomerConfig.PageFootFile; } } } } this.ibtnWord.Attributes.Add("onclick", "ReplaceInput();"); }
/// <summary> /// 根据当前URL的域名信息 ,获取对应的公司ID /// </summary> /// <param name="host"></param> /// <returns></returns> private int GetCompanyIdByHost(string host) { EyouSoft.BLL.SysStructure.SystemDomain bll = new EyouSoft.BLL.SysStructure.SystemDomain(); EyouSoft.Model.SysStructure.SystemDomain domain = bll.GetDomain(host); int companyId = 0; if (domain != null) { companyId = domain.CompanyId; } return(companyId); }
/// <summary> /// 获取域名信息 /// </summary> /// <param name="domain">域名</param> /// <returns></returns> public EyouSoft.Model.SysStructure.SystemDomain GetDomain(string domain) { EyouSoft.Model.SysStructure.SystemDomain model = (EyouSoft.Model.SysStructure.SystemDomain) EyouSoft.Cache.Facade.EyouSoftCache.GetCache(EyouSoft.Cache.Tag.System.SystemDomain + domain); if (model == null) { model = dal.GetDomain(domain); if (model != null) { EyouSoft.Cache.Facade.EyouSoftCache.Add(EyouSoft.Cache.Tag.System.SystemDomain + domain, model, DateTime.Now.AddHours(2)); } } return(model); }
protected void Page_Load(object sender, EventArgs e) { //初始化BigLogo,CompanyName BigLogo = ""; EyouSoft.Model.SysStructure.SystemDomain domain = GetCompanyIdByHost(Request.Url.Host.ToLower()); if (domain != null) { EyouSoft.Model.CompanyStructure.CompanyInfo companyInfo = new EyouSoft.BLL.CompanyStructure.CompanyInfo().GetModel(domain.CompanyId, domain.SysId); if (companyInfo != null) { CompanyName = companyInfo.CompanyName; BigLogo = new EyouSoft.BLL.CompanyStructure.CompanySetting().GetCompanyLogo(domain.CompanyId, EyouSoft.Model.EnumType.CompanyStructure.CompanyUserType.专线用户); } } }
/// <summary> /// 获取域名信息 /// </summary> /// <param name="domain">域名</param> /// <returns></returns> public EyouSoft.Model.SysStructure.SystemDomain GetDomain(string domain) { EyouSoft.Model.SysStructure.SystemDomain model = null; DbCommand dc = this.SystemStore.GetSqlStringCommand(SQL_DOMAIN_SELECT); this.SystemStore.AddInParameter(dc, "domain", DbType.String, domain); using (IDataReader rdr = EyouSoft.Toolkit.DAL.DbHelper.ExecuteReader(dc, this.SystemStore)) { if (rdr.Read()) { model = new EyouSoft.Model.SysStructure.SystemDomain() { Domain = rdr["Domain"].ToString(), SysId = rdr.GetInt32(rdr.GetOrdinal("SysId")), CompanyId = rdr.GetInt32(rdr.GetOrdinal("CompanyId")), Url = rdr["Url"].ToString() }; } } return(model); }