public virtual bool ExportExcel(LigerGrid grid, ref ExcelConvertHelper.ExcelContext context, ref string Error) { QueryUser query = new QueryUser(); query.ligerGrid = grid; eContract.Common.ExcelConvertHelper.ColumnList columns = new eContract.Common.ExcelConvertHelper.ColumnList(); columns.Add(CasUserTable.C_USER_ACCOUNT, "登录名"); columns.Add(CasUserTable.C_ENGLISH_NAME, "姓名"); context = new ExcelConvertHelper.ExcelContext(); context.FileName = "UserList" + ".xls"; context.Title = "用户列表"; //context.Data = DataAccess.QueryDataSet(query); WhereBuilder where = query.ParseSQL(); context.Data = DataAccess.Select(where.SQLString, where.Parameters).Tables[0]; if (columns != null) { context.Columns.Add(columns); } CacheHelper.Instance.Set(WebCaching.UserId + "_" + ExcelHelper.EXPORT_EXCEL_CONTEXT, context); return(true); }
public virtual bool ExportExcel(LigerGrid grid, ref ExcelConvertHelper.ExcelContext context, ref string Error) { SecRoleQuery query = new SecRoleQuery(); query.ligerGrid = grid; eContract.Common.ExcelConvertHelper.ColumnList columns = new eContract.Common.ExcelConvertHelper.ColumnList(); columns.Add(SecRoleTable.C_ROLE_ID, "角色编号"); columns.Add("role_type_name", "角色类型"); columns.Add(SecRoleTable.C_ROLE_NAME, "角色名称"); columns.Add(SecRoleTable.C_REMARK, "角色描述"); context = new ExcelConvertHelper.ExcelContext(); context.FileName = "RoleList" + ".xls"; context.Title = "角色列表"; WhereBuilder where = query.ParseSQL(); context.Data = DataAccess.Select(where.SQLString, where.Parameters).Tables[0]; if (columns != null) { context.Columns.Add(columns); } CacheHelper.Instance.Set(WebCaching.UserId + "_" + ExcelHelper.EXPORT_EXCEL_CONTEXT, context); return(true); }