private string GetChannelFullUrl(string level) { string channelUrl = ""; if (We7Helper.IsNumber(level)) { int index = int.Parse(level); if (index > 0) { string url = We7Helper.GetChannelUrlFromUrl(Request.RawUrl); int pos = 0; for (int i = 0, temp = 0; i <= index; i++) { temp = url.IndexOf("/", pos) + 1; if (temp == 0) { break; } else { pos = temp; } } url = url.Substring(0, pos); channelUrl = url; } } return(channelUrl); }
/// <summary> /// 构建标签项,完全可以通过控制每步骤的display属性 /// 进行功能项的控制,此属性完全可以进行如同模块式的管理 /// 设计页面、Tab名称、Tab显示属性、Tab所加载控件 /// 三者以控制其相应的显示 /// </summary> /// <returns></returns> string BuildNavString() { string strActive = @"<li class='TabIn' id='tab{0}' style='display:{2}'><a>{1}</a> </li>"; string strLink = @"<li class='TabOut' id='tab{0}' style='display:{2}'><a href='{3}'>{1}</a> </li>"; int tab = 1; string tabString = ""; string dispay = ""; string rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab"); rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved"); if (TabID != null && We7Helper.IsNumber(TabID)) { tab = int.Parse(TabID); } if (tab == 1) { tabString += string.Format(strActive, 1, "站点关联", dispay); Control ctl = this.LoadControl("Config_SiteSetting.ascx"); ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 1, "站点关联", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1")); } return(tabString); }
void LoadControl() { int tab = 0; if (TabID != null && We7Helper.IsNumber(TabID)) { tab = int.Parse(TabID); } //向动态控件传参 Permission_Func ctl = this.LoadControl("../Permissions/Permission_Func.ascx") as Permission_Func; ctl.OwnerType = OwnerType; ctl.OwnerID = OwnerID; if (tab == 0) { ctl.ObjectID = "System.Administration"; ctl.EntityID = "System.Administration"; } else { ctl.ObjectID = "System.User"; ctl.EntityID = "System.User"; } ContentHolder.Controls.Add(ctl); }
protected void DeleteButton_Click(object sender, EventArgs e) { if (DemoSiteMessage) { return; //是否是演示站点 } string name = NameTextBox.Text; string id = IDTextBox.Text; if (We7Helper.IsNumber(id)) { Messages.ShowError(name + "为系统角色,不允许删除!"); } else { try { AccountHelper.DeleteRole(id); //记录日志 string content = string.Format("删除了角色:“{0}”", name); AddLog("角色管理", content); Initialize(); } catch (Exception ex) { string messages = "删除角色【" + name + "】出错!出错原因:" + ex.Message; Messages.ShowError(messages); Initialize(); } } }
/// <summary> /// 判断后面的版本号是否比前面的更大 /// </summary> /// <param name="oldversion"></param> /// <param name="newversion"></param> /// <returns></returns> public static bool VersionLater(string oldversion, string newversion) { string[] oldNum = oldversion.Split('.'); string[] newNum = newversion.Split('.'); int min = oldNum.Length; if (newNum.Length < min) { min = newNum.Length; } bool isLater = false; for (int i = 0; i < min; i++) { if (We7Helper.IsNumber(oldNum[i]) && We7Helper.IsNumber(newNum[i])) { if (int.Parse(oldNum[i]) < int.Parse(newNum[i])) { isLater = true; break; } } } if (!isLater && newNum.Length > oldNum.Length) { isLater = true; } return(isLater); }
/// <summary> /// 根据栏目层数取得栏目Url名称 /// </summary> /// <param name="level">栏目等级</param> /// <returns>栏目名称</returns> public string GetChannelName(string level) { string channelName = "default"; if (We7Helper.IsNumber(level)) { int index = int.Parse(level); if (index > 0) { string url = We7Helper.GetChannelUrlFromUrl(Request.RawUrl); int pos = 0; for (int i = 0, temp = 0; i <= index; i++) { temp = url.IndexOf("/", pos) + 1; if (temp == 0) { break; } else { pos = temp; } } url = url.Substring(0, pos); channelName = ChannelHelper.GetChannelUrlFromUrl(url, Context.Request.ApplicationPath); } } return(channelName); }
/// <summary> /// 构建标签项,完全可以通过控制每步骤的display属性 /// 进行功能项的控制,此属性完全可以进行如同模块式的管理 /// 设计页面、Tab名称、Tab显示属性、Tab所加载控件 /// 三者以控制其相应的显示 /// </summary> /// <returns></returns> string BuildNavString() { string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>"; string strLink = @"<LI class=TabOut id=tab{0} style='display:{2}'><A href={3}>{1}</A> </LI>"; int tab = 1; string tabString = ""; string dispay = ""; string rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab"); rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved"); if (TabID != null && We7Helper.IsNumber(TabID)) { tab = int.Parse(TabID); } Role r = AccountHelper.GetRole(RoleID); if (tab == 1) { tabString += string.Format(strActive, 1, "回复统计", dispay); Control ctl = this.LoadControl("../Advice/controls/AdviceReplyStatisticsControl.ascx"); ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 1, "回复统计", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1")); } return(tabString); }
/// <summary> /// 根据文章对象(及flowxml)获取审核信息 /// </summary> /// <param name="articleID"></param> /// <returns></returns> public Processing GetArticleProcess(Article a) { if (a == null) { return(null); } else { Processing p = new Processing(); if (string.IsNullOrEmpty(a.ProcessState)) { p.CurLayerNO = "0"; } else { p.CurLayerNO = a.ProcessState; } p.ProcessDirection = a.ProcessDirection; p.ObjectID = a.ID; p.FromOtherSite = false; p.ArticleState = (ArticleStates)a.State; if (We7Helper.IsNumber(a.ProcessState) && ((ProcessStates)int.Parse(a.ProcessState)) == ProcessStates.Unaudit) { p.ArticleState = ArticleStates.Stopped; } Channel ch = ChannelHelper.GetChannel(a.OwnerID, null); if (ch != null) { if (!string.IsNullOrEmpty(ch.ProcessEnd) && We7Helper.IsNumber(ch.ProcessEnd)) { p.ProcessEndAction = (ProcessEnding)(int.Parse(ch.ProcessEnd)); } if (!string.IsNullOrEmpty(ch.ProcessLayerNO) && We7Helper.IsNumber(ch.ProcessLayerNO)) { p.ProcessTotalLayer = int.Parse(ch.ProcessLayerNO); } } p = FillDataByFlowXml(p, (ProcessObject)a); return(p); } }
/// <summary> /// 获取子栏目列表 /// </summary> /// <returns>栏目列表</returns> protected List <Channel> GetChannels() { ChannelQuery query = new ChannelQuery(); if (OrderFields == null || OrderFields == string.Empty) { OrderFields = "Index|Asc"; } query.OrderKeys = OrderFields; query.State = ArticleStates.Started; if (ParentID != null && ParentID.Length > 0) { query.ParentID = ParentID; } else if (Level != null && Level.Length > 0 & We7Helper.IsNumber(Level)) { query.ParentID = GetParentIDByLevel((int.Parse(Level) - 1).ToString()); } else { if (CurrentChannel == null) { query.ParentID = We7.We7Helper.EmptyGUID; } else { query.ParentID = CurrentChannel.ID; } } if (Tag != null && Tag.Length > 0) { query.Tag = Tag; } List <Channel> list = ChannelHelper.QueryChannels(query); if (list == null) { list = new List <Channel>(); } list = FormatChannelsData(list); return(list); }
/// <summary> /// 根据反馈获取审核信息 /// </summary> /// <param name="a"></param> /// <returns></returns> public Processing GetAdviceProcess(Advice a) { if (a == null) { return(null); } else { Processing p = new Processing(); if (string.IsNullOrEmpty(a.ProcessState)) { p.CurLayerNO = "-1"; } else { p.CurLayerNO = a.ProcessState; } p.ProcessDirection = a.ProcessDirection; p.ObjectID = a.ID; p.FromOtherSite = false; p.AdviceState = (AdviceState)a.State; if (We7Helper.IsNumber(a.ProcessState) && ((ProcessStates)int.Parse(a.ProcessState)) == ProcessStates.Unaudit) { p.AdviceState = AdviceState.WaitAccept; } AdviceType type = AdviceTypeHelper.GetAdviceType(a.TypeID); if (type != null) { if (!string.IsNullOrEmpty(type.ProcessEnd) && We7Helper.IsNumber(type.ProcessEnd)) { p.ProcessEndAction = (ProcessEnding)(int.Parse(type.ProcessEnd)); } p.ProcessTotalLayer = type.FlowSeries; } p = FillDataByFlowXml(p, (ProcessObject)a); return(p); } }
string BuildNavString() { string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>"; string strLink = @"<LI class=TabOut id=tab{0} style='display:{2}'><A href={3}>{1}</A> </LI>"; int tab = 1; string tabString = ""; string dispay = ""; //string rawurl = Helper.RemoveParamFromUrl(Request.RawUrl, "tab"); //rawurl = Helper.RemoveParamFromUrl(Request.RawUrl, "saved"); //rawurl = Helper.AddParamToUrl(rawurl, "group", GroupName); //rawurl = Helper.AddParamToUrl(rawurl, "model", ModelName); string rawUrl = RequestHelper.RemoveParam(Request.RawUrl, "tab"); rawUrl = RequestHelper.RemoveParam(rawUrl, "modelname"); rawUrl = RequestHelper.RemoveParam(rawUrl, "panel"); ModelInfo modelInfo = ModelHelper.GetModelInfoByName(ModelName); ContentModelType = modelInfo.Type; #region Article if (modelInfo.Type == ModelType.ARTICLE) { rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "modelname", RequestHelper.Get <string>("modelname")); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "tab", RequestHelper.Get <string>("tab", "1")); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "panel", RequestHelper.Get <string>("panel", "edit")); //记录操作历史,按照操作历史延续 if (TabID != null && We7Helper.IsNumber(TabID) && int.Parse(TabID) > 0) { tab = int.Parse(TabID); } if (tab == 1) { tabString += string.Format(strActive, 1, "后台信息录入", dispay); Control ctl = this.LoadControl("Controls/Panel_Edit.ascx"); ContentHolder.Controls.Add(ctl); } else { rawUrl = RequestHelper.RemoveParam(rawUrl, "panel"); rawUrl = RequestHelper.RemoveParam(rawUrl, "tab"); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "tab", "1"); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "panel", "edit"); tabString += string.Format(strLink, 1, "后台信息录入", dispay, rawUrl); } if (tab == 4) { tabString += string.Format(strActive, 4, "后台列表显示", dispay); Control ctl = this.LoadControl("Controls/Panel_List.ascx"); ContentHolder.Controls.Add(ctl); } else { rawUrl = RequestHelper.RemoveParam(rawUrl, "panel"); rawUrl = RequestHelper.RemoveParam(rawUrl, "tab"); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "tab", "4"); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "panel", "list"); tabString += string.Format(strLink, 4, "后台列表显示", dispay, rawUrl); } if (tab == 2) { tabString += string.Format(strActive, 2, "会员中心列表显示", dispay); Control ctl = this.LoadControl("Controls/Panel_List.ascx"); ContentHolder.Controls.Add(ctl); } else { rawUrl = RequestHelper.RemoveParam(rawUrl, "panel"); rawUrl = RequestHelper.RemoveParam(rawUrl, "tab"); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "tab", "2"); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "panel", "multi"); tabString += string.Format(strLink, 2, "会员中心列表显示", dispay, rawUrl); } if (tab == 3) { tabString += string.Format(strActive, 3, "会员中心录入", dispay); Control ctl = this.LoadControl("Controls/Panel_Edit.ascx"); ContentHolder.Controls.Add(ctl); } else { rawUrl = RequestHelper.RemoveParam(rawUrl, "panel"); rawUrl = RequestHelper.RemoveParam(rawUrl, "tab"); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "tab", "3"); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "panel", "multi"); tabString += string.Format(strLink, 3, "会员中心录入", dispay, rawUrl); } } #endregion #region ADVICE else if (modelInfo.Type == ModelType.ADVICE) { rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "modelname", RequestHelper.Get <string>("modelname")); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "tab", RequestHelper.Get <string>("tab", "1")); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "panel", RequestHelper.Get <string>("panel", "edit")); if (TabID != null && We7Helper.IsNumber(TabID) && int.Parse(TabID) > 0) { tab = int.Parse(TabID); } if (tab == 1) { tabString += string.Format(strActive, 1, "前台编辑", dispay); Control ctl = this.LoadControl("Controls/Panel_Edit.ascx"); ContentHolder.Controls.Add(ctl); } else { rawUrl = RequestHelper.RemoveParam(rawUrl, "panel"); rawUrl = RequestHelper.RemoveParam(rawUrl, "tab"); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "tab", "1"); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "panel", "edit"); tabString += string.Format(strLink, 1, "前台编辑", dispay, rawUrl); } if (tab == 2) { tabString += string.Format(strActive, 2, "后台编辑", dispay); Control ctl = this.LoadControl("Controls/Panel_Edit.ascx"); ContentHolder.Controls.Add(ctl); } else { rawUrl = RequestHelper.RemoveParam(rawUrl, "panel"); rawUrl = RequestHelper.RemoveParam(rawUrl, "tab"); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "tab", "2"); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "panel", "adminView"); tabString += string.Format(strLink, 2, "后台编辑", dispay, rawUrl); } } #endregion #region Account else if (modelInfo.Type == ModelType.ACCOUNT) { rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "modelname", RequestHelper.Get <string>("modelname")); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "tab", RequestHelper.Get <string>("tab", "1")); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "panel", RequestHelper.Get <string>("panel", "edit")); if (TabID != null && We7Helper.IsNumber(TabID) && int.Parse(TabID) > 0) { tab = int.Parse(TabID); } if (tab == 1) { tabString += string.Format(strActive, 1, "录入信息", dispay); Control ctl = this.LoadControl("Controls/Panel_Edit.ascx"); ContentHolder.Controls.Add(ctl); } else { rawUrl = RequestHelper.RemoveParam(rawUrl, "panel"); rawUrl = RequestHelper.RemoveParam(rawUrl, "tab"); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "tab", "1"); rawUrl = RequestHelper.AddOrUpdateParam(rawUrl, "panel", "edit"); tabString += string.Format(strLink, 1, "录入信息", dispay, rawUrl); } } #endregion return(tabString); }
/// <summary> /// 构建标签项,完全可以通过控制每步骤的display属性 /// 进行功能项的控制,此属性完全可以进行如同模块式的管理 /// 设计页面、Tab名称、Tab显示属性、Tab所加载控件 /// 三者以控制其相应的显示 /// </summary> /// <returns></returns> string BuildNavString() { string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>"; string strLink = @"<LI class=TabOut id=tab{0} style='display:{2}'><A href={3}>{1}</A> </LI>"; int tab = 1; string tabString = ""; string dispay = ""; string rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab"); rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved"); if (TabID != null && We7Helper.IsNumber(TabID)) { tab = int.Parse(TabID); } Role r = AccountHelper.GetRole(RoleID); if (tab == 1) { tabString += string.Format(strActive, 1, "基本信息", dispay); Control ctl = this.LoadControl("../Permissions/Role_Basic.ascx"); ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 1, "基本信息", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1")); } if (RoleID != null) { if (r != null) { dispay = ""; } else { dispay = "none"; } if (tab == 2) { tabString += string.Format(strActive, 2, "所属用户", dispay); Control ctl = this.LoadControl("../Permissions/Role_Accounts.ascx"); ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 2, "所属用户", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "2")); } if (tab == 3) { tabString += string.Format(strActive, 3, "模块权限", dispay); //向动态控件传参 Permission_Func ctl = this.LoadControl("../Permissions/Permission_Func.ascx") as Permission_Func; ctl.OwnerType = "role"; ctl.OwnerID = r.ID; if ((OwnerRank)r.RoleType == OwnerRank.Admin) { ctl.ObjectID = "System.Administration"; ctl.EntityID = "System.Administration"; } else { ctl.ObjectID = "System.User"; ctl.EntityID = "System.User"; } ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 3, "模块权限", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "3")); } // dispay = ""; //if (tab == 4) //{ // tabString += string.Format(strActive, 4, "功能权限", dispay); // //向动态控件传参 // Permission_Func ctl = this.LoadControl("../Permissions/Permission_Func.ascx") as Permission_Func; // ctl.OwnerType = "role"; // ctl.OwnerID = r.ID; // ctl.ObjectID = Helper.EmptyGUID; // ctl.EntityID = "System.Function"; // ContentHolder.Controls.Add(ctl); //} //else // tabString += string.Format(strLink, 4, "功能权限", dispay, Helper.AddParamToUrl(rawurl, "tab", "4")); } return(tabString); }
internal string BuildNavString() { string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>"; string strLink = @"<LI class=TabOut id=tab{0} style='display:{2}'><A href={3}>{1}</A> </LI>"; int tab = 1; string tabString = ""; string dispay = ""; string rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab"); rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved"); ContentHolder.Controls.Clear(); if (TabID != null && We7Helper.IsNumber(TabID)) { tab = int.Parse(TabID); } if (tab == 1) { tabString += string.Format(strActive, 1, "起始页", dispay); Control ctl = this.LoadControl("~/Admin/Plugin/controls/Plugin_Start.ascx"); Plugin_Start pctr = ctl as Plugin_Start; if (pctr != null) { pctr.PluginType = PluginType; } ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 1, "起始页", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1")); } if (IsQuery) { if (tab == 0) { tabString += string.Format(strActive, 0, "搜索结果", dispay); //AddListControl(PluginQueryType.USERDEFINED); AddListCtr(9); } } if (tab == 2) { tabString += string.Format(strActive, 2, "待授权插件", dispay); LoadMyPluginsCtr(); } else { tabString += string.Format(strLink, 2, "待授权插件", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "2")); } if (tab == 7) { tabString += string.Format(strActive, 7, "注册到本站的插件", dispay); LoadRegistedCtr(); } else { tabString += string.Format(strLink, 7, "注册到本站的插件", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "7")); } if (tab == 3) { tabString += string.Format(strActive, 3, "精选插件", dispay); //AddListControl(PluginQueryType.HOT); AddListCtr(1); } else { tabString += string.Format(strLink, 3, "精选插件", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "3")); } if (tab == 4) { tabString += string.Format(strActive, 4, "热门插件", dispay); //AddListControl(PluginQueryType.LATEST); AddListCtr(2); } else { tabString += string.Format(strLink, 4, "热门插件", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "4")); } if (tab == 5) { tabString += string.Format(strActive, 5, "最新添加", dispay); //AddListControl(PluginQueryType.UPDATED); AddListCtr(3); } else { tabString += string.Format(strLink, 5, "最新添加", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "5")); } if (tab == 6) { tabString += string.Format(strActive, 6, "最新更新", dispay); //AddListControl(PluginQueryType.UPDATED); AddListCtr(4); } else { tabString += string.Format(strLink, 6, "最新更新", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "6")); } return(tabString); }
/// <summary> /// 获取子栏目列表 /// </summary> /// <returns>栏目列表</returns> protected List <Channel> GetChannels() { List <Channel> list = new List <Channel>(); if (DesignHelper.IsDesigning) { list = DesignRecords; } else { StringBuilder sb = new StringBuilder(); sb.Append("ChannelDataProvider$GetChannels$"); sb.AppendFormat("ID:{0}$Url:{1}$", ID, We7Helper.GetChannelUrlFromUrl(Request.RawUrl)); list = CacheRecord.Create("channel").GetInstance <List <Channel> >(sb.ToString(), delegate() { ChannelQuery query = new ChannelQuery(); if (OrderFields == null || OrderFields == string.Empty) { OrderFields = "Index|Asc"; } query.OrderKeys = OrderFields; query.State = ArticleStates.Started; if (ParentID != null && ParentID.Length > 0) { query.ParentID = ParentID; } else if (Level != null && Level.Length > 0 & We7Helper.IsNumber(Level)) { query.ParentID = GetParentIDByLevel((int.Parse(Level) - 1).ToString()); } else { query.ParentID = ChannelID; } if (Tag != null && Tag.Length > 0) { query.Tag = Tag; } if (IncludeAllSons) { query.IncludeAllSons = true; } if (channelFlag && string.IsNullOrEmpty(level)) { if (ThisChannel == null) { ThisChannel = new Channel(); } ThisChannel.HaveSon = ChannelHelper.HasChild(ChannelID); if (!ThisChannel.HaveSon && noChildsDisplay) { query.ParentID = ThisChannel.ParentID; } } return(ChannelHelper.QueryChannels(query)); }); } return(list != null?FormatChannelsData(list) : new List <Channel>()); }
/// <summary> /// 构建标签项,完全可以通过控制每步骤的display属性 /// 进行功能项的控制,此属性完全可以进行如同模块式的管理 /// 设计页面、Tab名称、Tab显示属性、Tab所加载控件 /// 三者以控制其相应的显示 /// </summary> /// <returns></returns> string BuildNavString() { string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>"; string strLink = @"<LI class=TabOut id=tab{0} style='display:{2}'><A href={3}>{1}</A> </LI>"; int tab = 1; string tabString = ""; string dispay = ""; string rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab"); rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved"); if (TabID != null && We7Helper.IsNumber(TabID)) { tab = int.Parse(TabID); } if (tab == 1) { tabString += string.Format(strActive, 1, "基本信息", dispay); Control ctl = this.LoadControl("~/User/Controls/Account_Basic.ascx"); ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 1, "基本信息", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1")); } if (ActID != null) { Account acc = AccountHelper.GetAccount(ActID, new string[] { "LoginName", "UserType" }); string actName = acc.LoginName; if (acc != null) { dispay = ""; } else { dispay = "none"; } if (tab == 4) { tabString += string.Format(strActive, 4, "选项", dispay); Control ctl = this.LoadControl("~/User/Controls/Account_Extent.ascx"); ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 4, "选项", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "4")); } if (tab == 5) { tabString += string.Format(strActive, 5, "密码设置", dispay); Control ctl = this.LoadControl("~/User/Controls/Account_Password.ascx"); ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 5, "密码设置", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "5")); } } return(tabString); }
string BuildNavString() { string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>"; string strLink = @"<LI class=TabOut id=tab{0} style='display:{2}'><A href={3}>{1}</A> </LI>"; int tab = 1; string tabString = ""; string dispay = ""; string rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab"); rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved"); //记录操作历史,按照操作历史延续 if (!We7Helper.IsEmptyID(ChannelID) && Session["$We7_Channel_Tab"] != null) { tab = (int)Session["$We7_Channel_Tab"]; } if (TabID != null && We7Helper.IsNumber(TabID) && int.Parse(TabID) > 0) { tab = int.Parse(TabID); } if (tab == 1) { tabString += string.Format(strActive, 1, "基本信息", dispay); Control ctl = this.LoadControl("controls/Channel_basic.ascx"); ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 1, "基本信息", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1")); } if (!We7Helper.IsEmptyID(ChannelID)) { if (tab == 2) { tabString += string.Format(strActive, 2, "选项", dispay); Control ctl = this.LoadControl("controls/Channel_option.ascx"); ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 2, "选项", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "2")); } if (tab == 3) { tabString += string.Format(strActive, 3, "模板", dispay); Control ctl = this.LoadControl("controls/Channel_template.ascx"); ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 3, "模板", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "3")); } if (tab == 4) { tabString += string.Format(strActive, 4, "标签", dispay); Control ctl = this.LoadControl("controls/Channel_tag.ascx"); ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 4, "标签", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "4")); } if (tab == 5) { tabString += string.Format(strActive, 5, "权限", dispay); Control ctl = this.LoadControl("controls/Channel_authorize.ascx"); ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 5, "权限", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "5")); } if (SiteConfigs.GetConfig().SiteGroupEnabled) { MoreEventArgs evenArgs = new MoreEventArgs(); //ShareEvent shareEvent = new ShareEvent(); //shareEvent ShareEventFactory.Instance.OnLoadChannelShareConfig(tab, evenArgs); tabString += evenArgs.ReturnValue; Control c = evenArgs.ReturnObject as Control; if (c != null) { ContentHolder.Controls.Add(c); } } if (System.IO.File.Exists(Server.MapPath("/Plugins/IPStrategyPlugin/Plugin.xml"))) { if (tab == 7) { tabString += string.Format(strActive, 7, "IP过滤", dispay); Control ctl = this.LoadControl("controls/StrategySet.ascx"); if (ctl is StrategySet) { ((StrategySet)ctl).Mode = StrategyMode.CHANNEL; } ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 7, "IP过滤", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "7")); } } //if (tab == 8) //{ // tabString += string.Format(strActive, 8, "附加模块", dispay); // Control ctl = this.LoadControl("controls/Channel_Module.ascx"); // ContentHolder.Controls.Add(ctl); //} //else // tabString += string.Format(strLink, 8, "附加模块", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "8")); } Session["$We7_Channel_Tab"] = tab; return(tabString); }
string BuildNavString() { string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>"; string strLink = @"<LI class=TabOut id=tab{0} style='display:{2}'><A href={3}>{1}</A> </LI>"; int tab = 1; string tabString = ""; string dispay = ""; string rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab"); rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved"); if (TabID != null && We7Helper.IsNumber(TabID)) { tab = int.Parse(TabID); } //Article a = ArticleHelper.GetArticle(ChannelID); PluginInfo info = null, infoLocale = null; string isRemote = Request.QueryString["remote"]; if (!String.IsNullOrEmpty(isRemote) && isRemote.Trim() == "1") { info = GetRemotePluginInfo(); } else { info = PluginInfoCollection.CreateInstance(PluginType)[Request.QueryString["key"]]; } InitLeftDiv(info); ContentLiteral.Text = ""; if (tab == 1) { tabString += string.Format(strActive, 1, "简介", dispay); ContentLiteral.Text = info != null ? info.Description : ""; } else { tabString += string.Format(strLink, 1, "简介", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1")); } if (tab == 2) { tabString += string.Format(strActive, 2, "安装", dispay); ContentLiteral.Text = info != null ? info.Deployment.Introduction : ""; } else { tabString += string.Format(strLink, 2, "安装", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "2")); } if (tab == 3) { tabString += string.Format(strActive, 3, "截图", dispay); if (info != null) { StringBuilder sb = new StringBuilder(); foreach (string src in info.Snapshot) { sb.Append(String.Format("<img src='{2}/Temp/{0}/{1}' ></img>", Request.QueryString["key"], src, GeneralConfigs.GetConfig().PluginServer)); } ContentLiteral.Text = sb.ToString(); } } else { tabString += string.Format(strLink, 3, "截图", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "3")); } if (tab == 4) { tabString += string.Format(strActive, 4, "其它", dispay); ContentLiteral.Text = info != null ? info.Others : ""; } else { tabString += string.Format(strLink, 4, "其它", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "4")); } return(tabString); }
private string BuildNavString() { string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>"; string strLink = @"<LI class=TabOut id=tab{0} style='display:{2}'><A href={3}>{1}</A> </LI>"; int tab = 0; bool hasFirst = false; string tabString = ""; string dispay = ""; string rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab"); rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved"); if (TabID != null && We7Helper.IsNumber(TabID)) { tab = int.Parse(TabID); hasFirst = true; } if (Permisstions.Contains("Advice.Read") || Permisstions.Contains("Advice.Admin")) { if (tab == 1 || !hasFirst) { tabString += string.Format(strActive, 1, "全部", dispay); AddControl(10); hasFirst = true; } else { tabString += string.Format(strLink, 1, "全部", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1")); } } if (Permisstions.Contains("Advice.Read") || Permisstions.Contains("Advice.Admin") || Permisstions.Contains("Advice.Accept")) { if (tab == 2 || !hasFirst) { tabString += string.Format(strActive, 2, "待受理", dispay); AddControl(0); hasFirst = true; } else { tabString += string.Format(strLink, 2, "待受理", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "2")); } } if (Permisstions.Contains("Advice.Read") || Permisstions.Contains("Advice.Admin") || Permisstions.Contains("Advice.Handle")) { if (tab == 3 || !hasFirst) { tabString += string.Format(strActive, 3, "待办中", dispay); AddControl(2); hasFirst = true; } else { tabString += string.Format(strLink, 3, "待办中", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "3")); } } if (Permisstions.Contains("Advice.Read") || Permisstions.Contains("Advice.Admin") || Permisstions.Contains("Advice.Accept") || Permisstions.Contains("Advice.Handle")) { if (tab == 6 || !hasFirst) { tabString += string.Format(strActive, 6, "不受理", dispay); AddControl(1); hasFirst = true; } else { tabString += string.Format(strLink, 6, "不受理", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "6")); } } if (Permisstions.Contains("Advice.Read") || Permisstions.Contains("Advice.Admin") || Permisstions.Contains("Advice.Accept") || Permisstions.Contains("Advice.Handle")) { if (tab == 5 || !hasFirst) { tabString += string.Format(strActive, 5, "已办结", dispay); AddControl(9); hasFirst = true; } else { tabString += string.Format(strLink, 5, "已办结", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "5")); } } if (Permisstions.Contains("Advice.Read") || Permisstions.Contains("Advice.Admin") || Permisstions.Contains("Advice.Accept") || Permisstions.Contains("Advice.Handle")) { if (tab == 4 || !hasFirst) { tabString += string.Format(strActive, 4, "转办记录", dispay); AddControl(3); hasFirst = true; } else { tabString += string.Format(strLink, 4, "转办记录", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "4")); } } return(tabString); }
/// <summary> /// 根据回复邮件更新反馈回复 /// 此方法仅用于反射环境 /// </summary> /// <param name="subject">标题</param> /// <param name="sn">反馈信息流水号</param> /// <param name="body">回复内容</param> /// <param name="replyTime">回复时间</param> /// <returns></returns> public bool UpdateReplyByEmail(string subject, string sn, string body, string replyTime, string rawManage, string user, string stateText) { int start = sn.IndexOf("#"); HelperFactory hf = (HelperFactory)HttpContext.Current.Application[HelperFactory.ApplicationID]; Assistant = hf.Assistant; AdviceReplyHelper arh = new AdviceReplyHelper(); arh.Assistant = hf.Assistant; string adviceSN = sn.Remove(start, 1); if (adviceSN != "") { int intAdviceSN = 0; if (!int.TryParse(adviceSN, out intAdviceSN)) { return(false); } Criteria c = new Criteria(CriteriaType.Equals, "SN", adviceSN); if (Assistant.Count <Advice>(c) < 0) { return(false); } else { List <Advice> advice = Assistant.List <Advice>(c, null); for (int i = 0; i < advice.Count; i++) { if (advice != null) { //处理反馈回复信息 AdviceReply adviceReply = new AdviceReply(); adviceReply.AdviceID = advice[i].ID; adviceReply.Title = subject; adviceReply.Content = body; Account account = AccountHelper.GetAccountByEmail(user); if (account == null) { return(true); } adviceReply.UserID = account.ID; adviceReply.MailBody = rawManage; adviceReply.CreateDate = DateTime.Now; adviceReply.Updated = DateTime.Now; //更新反馈信息 advice[i].ReplyCount += 1;//增加回复数 advice[i].Updated = DateTime.Now; advice[i].ToHandleTime = Convert.ToDateTime(replyTime); advice[i].ToOtherHandleUserID = adviceReply.UserID; if (stateText == "上报办理") { advice[i].State = (int)AdviceState.Checking; advice[i].ProcessState = ((int)AdviceState.Checking).ToString(); } else { advice[i].State = (int)AdviceState.Finished; advice[i].ProcessState = ((int)ProcessStates.Finished).ToString(); } advice[i].IsRead = 1; //处理反馈进度 Processing ap = ProcessingHelper.GetAdviceProcess(advice[i]); if (ap == null) { ap = new Processing(); ap.ObjectID = advice[i].ID; ap.CurLayerNO = "1"; ap.ProcessAccountID = adviceReply.UserID; ap.ProcessDirection = "1"; ap.Remark = ""; ap.CreateDate = DateTime.Now; } ap.UpdateDate = DateTime.Now; ap.ProcessAccountID = adviceReply.UserID; ap.ProcessDirection = advice[i].ProcessDirection = "1"; #region 孟添加 AdviceType adviceType = AdviceTypeHelper.GetAdviceType(advice[i].TypeID); switch (advice[i].State) { case (int)AdviceState.All: break; case (int)AdviceState.WaitAccept: case (int)AdviceState.WaitHandle: case (int)AdviceState.Finished: break; case (int)AdviceState.Checking: int auditLevel = 0; if (We7Helper.IsNumber(advice[i].ProcessState)) { auditLevel = int.Parse(advice[i].ProcessState); } if (auditLevel < 0) { auditLevel = 0; } auditLevel += 1; if (auditLevel > adviceType.FlowSeries) { advice[i].ProcessState = ((int)AdviceState.Finished).ToString(); advice[i].State = (int)AdviceState.Finished; advice[i].MustHandle = 0; } else { advice[i].ProcessState = auditLevel.ToString(); } break; default: break; } ap.CurLayerNO = advice[i].ProcessState; #endregion OperationAdviceInfo(adviceReply, advice[i], ap); if (advice[i].State == (int)AdviceState.Finished) { AdviceEmailConfigs adviceEmailConfigs = new AdviceEmailConfigs(); AdviceEmailConfigInfo info = adviceEmailConfigs["ReplyUser"]; SendResultMailToAdvicer(advice[i], adviceReply, null, info); } if (stateText == "上报办理") { advice[i].State = (int)AdviceState.Checking; AdviceReplyHelper.UpdateReplyByAdviceID(adviceReply, null); } else { advice[i].State = (int)AdviceState.Finished; } UpdateAdvice(advice[i], new string[] { "IsRead", "State", "ProcessState" }); } } return(true); } } else { return(false); } }
/// <summary> /// 从Url中取得ID号 /// </summary> /// <returns></returns> public static string GetIDFromUrl() { string path = HttpContext.Current.Request.RawUrl; //取得Url的原始地址 GeneralConfigInfo si = GeneralConfigs.GetConfig(); if (si == null) { return(""); } string ext = si.UrlFormat; if (ext == null || ext.Length == 0) { ext = "html"; } if (path.LastIndexOf("?") > -1) { if (path.ToLower().IndexOf("article=") > -1) { path = path.Substring(path.ToLower().IndexOf("article=") + 8); } else { path = path.Remove(path.LastIndexOf("?")); } } string mathstr = @"/(\w|\s|(-)|(_))+\." + ext + "$"; if (path.ToLower().EndsWith("default." + ext)) { path = path.Remove(path.Length - 12); } if (path.ToLower().EndsWith("index." + ext)) { path = path.Remove(path.Length - 10); } if (Regex.IsMatch(path, mathstr)) { int lastSlash = path.LastIndexOf("/"); if (lastSlash > -1) { path = path.Remove(0, lastSlash + 1); } int lastDot = path.LastIndexOf("."); if (lastDot > -1) { path = path.Remove(lastDot, path.Length - lastDot); } if (We7Helper.IsGUID(We7Helper.FormatToGUID(path))) { path = We7Helper.FormatToGUID(path); } else { int lastSub = path.LastIndexOf("-"); if (lastSub > -1) { path = path.Remove(0, lastSub + 1); } if (!We7Helper.IsNumber(path)) { path = ""; } else { path = HelperFactory.Instance.GetHelper <ArticleHelper>().GetArticleIDBySN(path); } } return(path); } else { return(string.Empty); } }
/// <summary> /// 构建标签项,完全可以通过控制每步骤的display属性 /// 进行功能项的控制,此属性完全可以进行如同模块式的管理 /// 设计页面、Tab名称、Tab显示属性、Tab所加载控件 /// 三者以控制其相应的显示 /// </summary> /// <returns></returns> string BuildNavString() { string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>"; string strLink = @"<LI class=TabOut id=tab{0} style='display:{2}'><A href={3}>{1}</A> </LI>"; int tab = 1; string tabString = ""; string dispay = ""; string rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab"); rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved"); if (TabID != null && We7Helper.IsNumber(TabID)) { tab = int.Parse(TabID); } Role r = AccountHelper.GetRole(RoleID); if (tab == 1) { tabString += string.Format(strActive, 1, "基本属性", dispay); Control ctl = this.LoadControl("../Advice/controls/Advice_Option.ascx"); ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 1, "基本属性", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1")); } if (AdviceTypeID == null || AdviceTypeID == "") { return(tabString); } else { if (tab == 2) { tabString += string.Format(strActive, 2, "办理流程", dispay); Control ctl = this.LoadControl("../Advice/controls/Advice_Config.ascx"); ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 2, "办理流程", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "2")); } if (tab == 3) { tabString += string.Format(strActive, 3, "反馈表单", dispay); Control ctl = this.LoadControl("../Advice/controls/Advice_File.ascx"); ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 3, "反馈表单", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "3")); } if (tab == 4) { tabString += string.Format(strActive, 4, "办理权限", dispay); Control ctl = this.LoadControl("../Advice/controls/Advice_Authorize.ascx"); ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 4, "办理权限", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "4")); } return(tabString); } }
/// <summary> /// 操作信息 /// </summary> /// <returns></returns> protected bool OperationInfo(AdviceState state, string direction, bool saveReply) { try { AdviceType adviceType = AdviceTypeHelper.GetAdviceType(AdviceTypeID); Advice a = ThisAdvice; //处理反馈回复信息 AdviceReply adviceReply = null; if (saveReply) { adviceReply = new AdviceReply(); adviceReply.AdviceID = AdviceID; adviceReply.Content = We7Helper.ConvertPageBreakFromVisualToChar(ReplyContentTextBox.Value); adviceReply.Suggest = ToAdviceTextBox.Text; adviceReply.UserID = AccountID; adviceReply.CreateDate = DateTime.Now; adviceReply.Updated = DateTime.Now; //增加回复数 a.ReplyCount += 1; } //更新反馈信息 a.Updated = DateTime.Now; a.ToHandleTime = DateTime.Now; if (UserIDTextBox.Text.Trim() != "") { a.ToOtherHandleUserID = UserIDTextBox.Text.ToString(); } else { a.ToOtherHandleUserID = AccountID; } a.State = (int)state; //处理反馈进度 Advice oldAdvice = AdviceHelper.GetAdvice(AdviceID); Processing ap = ProcessHelper.GetAdviceProcess(oldAdvice); ap.UpdateDate = DateTime.Now; ap.ProcessAccountID = AccountID; ap.ApproveName = AccountHelper.GetAccount(AccountID, new string[] { "LastName" }).LastName; ap.ProcessDirection = direction.ToString(); ap.Remark = ToAdviceTextBox.Text; if (state == AdviceState.WaitHandle) { a.ProcessState = ((int)state).ToString(); string myText = "请 {0} 办理一下反馈“{1}”。"; string userName = AccountHelper.GetAccount(UserIDTextBox.Text, new string[] { "LastName" }).LastName; ap.Remark = string.Format(myText, userName, a.Title) + "<br>" + ap.Remark; } switch (state) { case AdviceState.All: break; case AdviceState.WaitAccept: case AdviceState.WaitHandle: case AdviceState.Finished: break; case AdviceState.Checking: int auditLevel = 0; if (We7Helper.IsNumber(a.ProcessState)) { auditLevel = int.Parse(a.ProcessState); } if (auditLevel < 0) { auditLevel = 0; } auditLevel += 1; if (auditLevel > adviceType.FlowSeries) { a.ProcessState = ((int)AdviceState.Finished).ToString(); a.State = (int)AdviceState.Finished; a.MustHandle = 0; } else { a.ProcessState = auditLevel.ToString(); } break; default: break; } ap.CurLayerNO = a.ProcessState; ap.AdviceState = (AdviceState)a.State; AdviceHelper.OperationAdviceInfo(adviceReply, oldAdvice, ap); if (state == AdviceState.WaitHandle) { AdviceHelper.UpdateAdvice(a, new string[] { "ToHandleTime", "ToOtherHandleUserID" }); } if (state == AdviceState.Finished) { AdviceEmailConfigs adviceEmailConfigs = new AdviceEmailConfigs(); AdviceEmailConfigInfo info = adviceEmailConfigs["ReplyUser"]; AdviceHelper.SendResultMailToAdvicer(a, adviceReply, adviceType, info); } return(true); } catch (Exception ex) { Messages.ShowError(" 信息操作失败!原因:" + ex.Message); return(false); } }
/// <summary> /// 构建标签项,完全可以通过控制每步骤的display属性 /// 进行功能项的控制,此属性完全可以进行如同模块式的管理 /// 设计页面、Tab名称、Tab显示属性、Tab所加载控件 /// 三者以控制其相应的显示 /// </summary> /// <returns></returns> string BuildNavString() { string strActive = @"<LI class=TabIn id=tab{0} style='display:{2}'><A>{1}</A> </LI>"; string strLink = @"<LI class=TabOut id=tab{0} style='display:{2}'><A href={3}>{1}</A> </LI>"; int tab = 1; string tabString = ""; string dispay = ""; string rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "tab"); rawurl = We7Helper.RemoveParamFromUrl(Request.RawUrl, "saved"); if (TabID != null && We7Helper.IsNumber(TabID)) { tab = int.Parse(TabID); } if (tab == 1) { tabString += string.Format(strActive, 1, "基本信息", dispay); Control ctl = this.LoadControl("../Permissions/Account_Basic.ascx"); ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 1, "基本信息", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "1")); } if (ActID != null) { Account acc = AccountHelper.GetAccount(ActID, new string[] { "LoginName", "UserType" }); string actName = acc.LoginName; if (acc != null) { dispay = ""; } else { dispay = "none"; } if (tab == 4) { tabString += string.Format(strActive, 4, "选项", dispay); Control ctl = this.LoadControl("../Permissions/Account_Extend.ascx"); ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 4, "选项", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "4")); } if (tab == 2) { tabString += string.Format(strActive, 2, "角色设置", dispay); Account_Roles ctl = this.LoadControl("../Permissions/Account_Roles.ascx") as Account_Roles; if (acc.UserType == (int)OwnerRank.Admin) { ctl.RoleType = OwnerRank.All; } else { ctl.RoleType = (OwnerRank)acc.UserType; } ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 2, "角色设置", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "2")); } if (tab == 3) { tabString += string.Format(strActive, 3, "会员菜单", dispay); //向动态控件传参 Permission_Func ctl = this.LoadControl("../Permissions/Permission_Func.ascx") as Permission_Func; ctl.OwnerType = "account"; ctl.OwnerID = ActID; ctl.ObjectID = "System.User"; ctl.EntityID = "System.User"; ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 3, "会员菜单", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "3")); } //if (acc.UserType == (int)OwnerRank.Admin) if (Security.CurrentAccountID.Equals(We7Helper.EmptyGUID))//这儿修改后的意思是只有超级管理员才能设置管理员 { if (tab == 6) { tabString += string.Format(strActive, 6, "后台菜单", dispay); //向动态控件传参 Permission_Func ctl = this.LoadControl("../Permissions/Permission_Func.ascx") as Permission_Func; ctl.OwnerType = "account"; ctl.OwnerID = ActID; ctl.ObjectID = "System.Administration"; ctl.EntityID = "System.Administration"; ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 6, "后台菜单", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "6")); } } if (tab == 5) { tabString += string.Format(strActive, 5, "积分", dispay); Account_Points ctl = this.LoadControl("../Permissions/Account_Points.ascx") as Account_Points; ContentHolder.Controls.Add(ctl); } else { tabString += string.Format(strLink, 5, "积分", dispay, We7Helper.AddParamToUrl(rawurl, "tab", "5")); } } return(tabString); }