public List <SelectListItem> GetdeptSelectItems() { Business.Sys_Role Sys_Role = new Business.Sys_Role(); List <Model.RoleInfo> RoleInfoList = Sys_Role.UserRoleList(); List <SelectListItem> deptSelectItems = new List <SelectListItem>(); SelectListItem item = new SelectListItem(); item.Text = "PC"; item.Value = "PC"; deptSelectItems.Add(item); item = new SelectListItem(); item.Text = "手机"; item.Value = "手机"; deptSelectItems.Add(item); return(deptSelectItems); }
public List <SelectListItem> GetdeptSelectItems() { Business.Sys_Role Sys_Role = new Business.Sys_Role(); List <Model.RoleInfo> RoleInfoList = Sys_Role.UserRoleList(); List <SelectListItem> deptSelectItems = new List <SelectListItem>(); SelectListItem item = new SelectListItem(); item.Text = "-请选择-"; item.Value = ""; item.Selected = true; deptSelectItems.Add(item); foreach (Model.RoleInfo d in RoleInfoList) { item = new SelectListItem(); item.Text = d.RoleName; item.Value = d.RoleCode.ToString(); item.Selected = false; deptSelectItems.Add(item); } return(deptSelectItems); }
public ActionResult GetRoleList(int limit, int offset, string SelectItem) { Business.Sys_Role Sys_Role = new Business.Sys_Role(); StringBuilder sb = new StringBuilder(); if (!string.IsNullOrEmpty(SelectItem)) { sb.Append(" and RoleCode='" + SelectItem + "'"); } return(Json(new { total = Sys_Role.GetRoleLisCount(sb.ToString()), rows = Sys_Role.UserRoleList(limit, offset, sb.ToString()) }, JsonRequestBehavior.AllowGet)); }