/// <summary> /// 返回该黄页的模板物理路径 /// </summary> /// <param name="cData">ZL_CommonModel</param> /// <param name="tempMod">ZL_PageTemplate:栏目</param> private string GetTempPath(M_CommonData cData, M_Templata tempMod, int pageID) { if (pageID == 0) { function.WriteErrMsg("未为该黄页栏目指定样式!"); return(""); } B_PageReg pageBll = new B_PageReg(); M_PageReg pageMod = pageBll.SelReturnModel(pageID); B_PageStyle styleBll = new B_PageStyle(); M_PageStyle styleMod = new M_PageStyle(); M_CommonData ItemInfo = conBll.GetCommonData(ItemID);//获取栏目信息 M_Templata Nodeinfo = tll.Getbyid(ItemInfo.NodeID); if (pageMod == null) { function.WriteErrMsg("未找到黄页信息" + pageID); return(""); } if (pageMod.NodeStyle != 0)//样式优先读取客户自己设定的,再读取我们后台设定的 { styleMod = styleBll.SelReturnModel(pageMod.NodeStyle); } else if (DataConverter.CLng(Nodeinfo.UserGroup) != 0) { styleMod = styleBll.SelReturnModel(DataConverter.CLng(Nodeinfo.UserGroup)); } else { function.WriteErrMsg("该栏目未指定样式!!"); return(""); } string modelist = tempMod.Modelinfo; string tempUrl = ""; string tempPath = ""; //------TempUrl为栏目所指定的Html模板路径. if (!string.IsNullOrEmpty(modelist)) //38,内容页/招聘内容页 { if (modelist.IndexOf("|") > 0 && modelist.IndexOf(",") > 0) //如绑定多个模型则以|分隔,每个模型,可绑定不同的黄页 { string[] modearr = modelist.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < modearr.Length; i++) { string[] arr = modearr[i].Split(new char[] { ',' }); if (cData.ModelID == Convert.ToInt32(arr[0])) { tempUrl = arr[1]; break; } } } else if (modelist.IndexOf(",") > 0) { tempUrl = modelist.Split(new char[] { ',' })[1]; } } //-----获取该黄页所绑定的样式,将栏目模板与样式模板路径组合,UserGroup即为其所绑定的样式ID tempPath = Server.MapPath(styleMod.StylePath + tempUrl); return(tempPath); }