//得到角色列表 protected string GetHtmlData() { try { Rc.Cloud.Model.Model_SysRoleParameter parameter = new Rc.Cloud.Model.Model_SysRoleParameter(); parameter.MODEL_SysRole.SysRole_Name = txtRoleName.Text.Trim(); var modelList = new Rc.Cloud.BLL.BLL_SysRole().GetSysRoleModelList(parameter, PageIndex, PageSize, out rCount, out pCount); int i = 0; StringBuilder strHtmlData = new StringBuilder(); strHtmlData.Append("<table class='table_list' cellpadding='0' cellspacing='0' >"); strHtmlData.Append("<tr class='tr_title'>"); strHtmlData.Append("<td >角色名称</td>"); strHtmlData.Append("<td >创建时间</td>"); strHtmlData.Append("<td style='width:10%;'>操作</td>"); strHtmlData.Append("</tr>"); foreach (var item in modelList) { i++; string css = string.Empty; if (i % 2 == 0) { css = "tr_con_001"; } else { css = "tr_con_002"; } strHtmlData.Append("<tr class='" + css + "'>"); strHtmlData.Append("<td>" + item.SysRole_Name + "</td>"); strHtmlData.Append("<td>" + (item.CreateTime.HasValue ? item.CreateTime.Value.ToShortDateString() : "") + "</td>"); strHtmlData.Append("<td class='cc'>"); strHtmlData.Append("<a href='SysRoleModuleFunction.aspx?id=" + item.SysRole_ID + ""); strHtmlData.Append("&dname=" + Server.UrlEncode(item.SysRole_Name) + ""); strHtmlData.Append("&iurl=" + Server.UrlEncode(Request.Url.ToString()) + ""); strHtmlData.Append("'"); strHtmlData.Append(">设置权限</a></td>"); strHtmlData.Append(" "); strHtmlData.Append("</tr>"); } strHtmlData.Append("</table>"); if (i == 0) { strHtmlData.Append(" <div class='nodata_div'>暂无数据</div>"); } return(strHtmlData.ToString()); } catch (Exception ex) { new BLL_clsAuth().AddLogErrorFromBS(Module_Id, string.Format("类:{0},方法:{1},错误信息:{2}, 详细:{3}", ex.TargetSite.DeclaringType.ToString(), ex.TargetSite.Name.ToString(), ex.Message, ex.StackTrace)); throw ex; } }
//得到角色列表 protected string GetHtmlData() { try { Rc.Cloud.Model.Model_SysRoleParameter parameter = new Rc.Cloud.Model.Model_SysRoleParameter(); parameter.MODEL_SysRole.SysRole_Name = txtRoleName.Text.Trim(); var modelList = new Rc.Cloud.BLL.BLL_SysRole().GetSysRoleModelList(parameter, PageIndex, PageSize, out rCount, out pCount); int i = 0; StringBuilder strHtmlData = new StringBuilder(); strHtmlData.Append("<table class='table table-hover table-bordered'>"); strHtmlData.Append("<thead>"); strHtmlData.Append("<tr>"); strHtmlData.Append("<th>角色名称</th>"); strHtmlData.Append("<th>创建时间</th>"); strHtmlData.Append("<th>操作</th>"); strHtmlData.Append("</tr>"); strHtmlData.Append("</thead>"); strHtmlData.Append("<tbody>"); foreach (var item in modelList) { i++; string css = string.Empty; strHtmlData.Append("<tr>"); strHtmlData.Append("<td>" + item.SysRole_Name + "</td>"); strHtmlData.Append("<td>" + (item.CreateTime.HasValue ? item.CreateTime.Value.ToShortDateString() : "") + "</td>"); strHtmlData.Append("<td class='opera'>"); strHtmlData.AppendFormat("<a href='SysRoleModuleFunction.aspx?id={0}&dname={1}&iurl={2}'>设置权限</a>" , item.SysRole_ID , Server.UrlEncode(item.SysRole_Name) , Server.UrlEncode(Request.Url.ToString())); strHtmlData.AppendFormat("<a href='javascript:;' onclick=\"showPop('{0}','{1}');\">编辑</a>" , item.SysRole_ID , Server.UrlEncode(item.SysRole_Name)); strHtmlData.Append("</td>"); strHtmlData.Append("</tr>"); } strHtmlData.Append("</tbody>"); strHtmlData.Append("</table>"); if (i == 0) { strHtmlData.Append("<div class='nodata'>暂无数据</div>"); } return(strHtmlData.ToString()); } catch (Exception ex) { new BLL_clsAuth().AddLogErrorFromBS(Module_Id, string.Format("类:{0},方法:{1},错误信息:{2}, 详细:{3}", ex.TargetSite.DeclaringType.ToString(), ex.TargetSite.Name.ToString(), ex.Message, ex.StackTrace)); throw ex; } }