|
using Common;
|
using Dao;
|
using Model;
|
using System;
|
using System.Collections.Generic;
|
using System.Text;
|
using System.Web;
|
using System.Web.Profile;
|
using System.Web.SessionState;
|
|
public partial class _SysUser : PageBase<SysUser>, IRequiresSessionState
|
{
|
|
|
public List<SysDictData> userRoleList { get; set; } //账号类型或称用户角色。
|
public string IP { get; set; }
|
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
this.IP = this.Request.UserHostAddress;
|
this.CheckRight("104", FailedOperation.PromptOnly);
|
|
}
|
|
private string GenerateTextPadding(SysMenu menu)
|
{
|
return string.Format("<span style=\"width:{0}px;display:inline-block;\"></span>{1}.", (object)(menu.MenuLV * 20), (object)menu.MenuID);
|
}
|
|
protected string RenderFunctionTree()
|
{
|
using (UserDao userDao = new UserDao())
|
{
|
List<SysMenu> list = userDao.LoadSysMenuList();
|
StringBuilder stringBuilder = new StringBuilder();
|
stringBuilder.Append("<table cellpadding='5'>");
|
foreach (SysMenu menu in list)
|
stringBuilder.AppendFormat("<tr><td colspan='2'><span style='padding:5px;'>{2}</span>\r\n <input type=\"checkbox\" id=\"MenuID\" data-prentId='{5}' name=\"MenuID\" value=\"{0}\" {1}/><span style='padding:5px;'>{3} </span> \r\n <span style='padding:5px; color:#666666'>{4}</span></td></tr>", (object)menu.MenuID, (object)"", (object)this.GenerateTextPadding(menu), (object)menu.MenuName, (object)menu.Remark, (object)menu.ParentID);
|
stringBuilder.Append("</table>");
|
return stringBuilder.ToString();
|
}
|
}
|
|
//所有用户角色(字典类型为:USER_ROLE)
|
protected string UserRoleList()
|
{
|
using (SysDictDataDao sysDictDataDao = new SysDictDataDao())
|
{
|
SysDictData sysDictData = new SysDictData();
|
sysDictData.DictType = "USER_ROLE"; //字典类型:用户角色
|
sysDictData.Status = 1; //状态:1-启用
|
List<SysDictData> userRoleList = sysDictDataDao.getAllList(sysDictData);
|
|
//List<GwProduct> list = gwProductDao.getAllList(gwProduct);
|
|
StringBuilder stringBuilder = new StringBuilder();
|
stringBuilder.Append("<table cellpadding='5'>");
|
if (userRoleList.Count > 0)
|
{
|
for (int i = 0; i < userRoleList.Count; i++)
|
{
|
SysDictData bean = (SysDictData)userRoleList[i];
|
|
//行开始符
|
if (i % 5 == 0)
|
{
|
stringBuilder.Append("<tr>");
|
}
|
|
//行单元格
|
stringBuilder.AppendFormat("<td><input type=\"checkbox\" id=\"_UserRole\" name=\"_UserRole\" value=\"{0}\" /><span style='padding:5px;'>{1} </span> \r\n </td>", (object)bean.DictValue, (object)bean.DictLabel);
|
|
//行结束符
|
if (i % 5 == 4 || i == (userRoleList.Count - 1))
|
{
|
stringBuilder.Append("</tr>");
|
}
|
|
}
|
}
|
stringBuilder.Append("</table>");
|
|
return stringBuilder.ToString();
|
}
|
}
|
|
}
|