/// <summary> /// 角色下拉框控件 /// </summary> /// <param name="helper"></param> /// <param name="id"></param> /// <param name="width"></param> /// <param name="selectedValue">选中值</param> /// <param name="defaultValue"></param> /// <param name="defaultText"></param> /// <returns></returns> public static string SelectRole(this HtmlHelper helper, string id, string width, string selectedValue, string defaultValue, string defaultText) { StringBuilder sb = new StringBuilder(); sb.AppendFormat("<select id=\"{0}\" name=\"{1}\" style=\"width:{2}\" class=\"input-select\">", id, id, width); if (!string.IsNullOrWhiteSpace(defaultText)) { sb.AppendFormat("<option value=\"{0}\">{1}</option>", defaultValue, defaultText); } RoleInfoQuery roleQuery = new RoleInfoQuery(); roleQuery.JournalID = SiteConfig.SiteID; roleQuery.GroupID = (int)EnumMemberGroup.Editor; ISiteSystemFacadeService sysService = ServiceContainer.Instance.Container.Resolve <ISiteSystemFacadeService>(); IList <RoleInfoEntity> listRole = sysService.GetRoleList(roleQuery); foreach (RoleInfoEntity item in listRole) { if (item.RoleID.ToString().Equals(selectedValue)) { sb.AppendFormat("<option value=\"{0}\" selected=\"selected\">{1}</option>", item.RoleID.ToString(), item.RoleName); } else { sb.AppendFormat("<option value=\"{0}\">{1}</option>", item.RoleID.ToString(), item.RoleName); } } sb.Append("</select>"); return(sb.ToString()); }
/// <summary> /// 角色修改 /// </summary> /// <returns></returns> public ActionResult Edit(long?RoleID) { RoleInfoEntity roleEntity = new RoleInfoEntity(); if (RoleID != null) { ISiteSystemFacadeService sysService = ServiceContainer.Instance.Container.Resolve <ISiteSystemFacadeService>(); roleEntity = sysService.GetRoleEntity(new RoleInfoQuery { RoleID = RoleID.Value }); } return(View(roleEntity)); }
/// <summary> /// 查看 /// </summary> /// <param name="MenuID"></param> /// <returns></returns> public ActionResult View(long?MenuID) { MenuEntity menuEntity = new MenuEntity(); if (MenuID != null) { MenuQuery query = new MenuQuery(); query.JournalID = JournalID; query.MenuID = MenuID.Value; ISiteSystemFacadeService siteSystemService = ServiceContainer.Instance.Container.Resolve <ISiteSystemFacadeService>(); menuEntity = siteSystemService.GetMenu(query); } return(View(menuEntity)); }
/// <summary> /// 带有作者和专家的角色下拉框控件 /// </summary> /// <param name="helper"></param> /// <param name="id"></param> /// <param name="width"></param> /// <param name="selectedValue">选中值</param> /// <param name="defaultValue"></param> /// <param name="defaultText"></param> /// <returns></returns> public static string SelectAllRole(this HtmlHelper helper, string id, string width, string selectedValue, string defaultValue, string defaultText) { StringBuilder sb = new StringBuilder(); sb.AppendFormat("<select id=\"{0}\" name=\"{1}\" style=\"width:{2}\" class=\"input-select\">", id, id, width); if (!string.IsNullOrWhiteSpace(defaultText)) { sb.AppendFormat("<option value=\"{0}\">{1}</option>", defaultValue, defaultText); } RoleInfoQuery roleQuery = new RoleInfoQuery(); roleQuery.JournalID = SiteConfig.SiteID; roleQuery.GroupID = (int)EnumMemberGroup.Editor; ISiteSystemFacadeService sysService = ServiceContainer.Instance.Container.Resolve <ISiteSystemFacadeService>(); IList <RoleInfoEntity> listRole = sysService.GetRoleList(roleQuery); # region 添加作者和专家组