Example #1
0
File: Utils.cs Project: windygu/bbl
        /// <summary>
        /// 根据模板编号获取模板的相对目录
        /// </summary>
        /// <param name="templateId">模板编号</param>
        /// <returns></returns>
        private static string GetShopTemplateVirtualDirectory(EyouSoft.Model.EnumType.SysStructure.SiteTemplate template)
        {
            string s = string.Empty;

            switch (template)
            {
            case EyouSoft.Model.EnumType.SysStructure.SiteTemplate.模板一: s = "/shop/t1/"; break;
            }

            return(s);
        }
Example #2
0
File: Utils.cs Project: windygu/bbl
        /// <summary>
        /// 模板验证,模板编号若与相应的模板不对应,则跳转至相应模板
        /// </summary>
        /// <param name="companyId">公司编号</param>
        /// <param name="templateId">模板编号</param>
        public static void ShopTemplateValidate(int companyId, EyouSoft.Model.EnumType.SysStructure.SiteTemplate template)
        {
            var response = HttpContext.Current.Response;

            if (template == EyouSoft.Model.EnumType.SysStructure.SiteTemplate.None)
            {
                response.Clear();
                response.Write("未开通同行平台或未选择正常的同行模板。");
                response.End();
            }

            string currentExecutionFilePath = HttpContext.Current.Request.CurrentExecutionFilePath.ToLower();
            string templateVirtualDirectory = GetShopTemplateVirtualDirectory(template);

            if (currentExecutionFilePath.IndexOf(templateVirtualDirectory.ToLower()) < 0)
            {
                response.Redirect(GetShopTemplatePath(template));
            }
        }
Example #3
0
File: Utils.cs Project: windygu/bbl
 /// <summary>
 /// 根据模板编号获取模板的相对路径
 /// </summary>
 /// <param name="templateId">模板编号</param>
 /// <returns></returns>
 public static string GetShopTemplatePath(EyouSoft.Model.EnumType.SysStructure.SiteTemplate template)
 {
     return(GetShopTemplateVirtualDirectory(template) + "default.aspx");
 }