Exemplo n.º 1
0
 /// <summary>
 /// 点击导出
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ImgBtnExport_Click(object sender, ImageClickEventArgs e)
 {
     if (ActionValidator("SystemRolesExpert"))
     {
         DataTable dt = DbHelperSql.GetDataTable("SystemRoles", "RloeName,Remarks", (string.IsNullOrEmpty(tbRoleName.Text) ? string.Empty : " RoleName Like '%" + tbRoleName.Text + "%' "), "ID desc").Tables[0]; //导出;
         dt.Columns[0].ColumnName = "角色名称";
         dt.Columns[1].ColumnName = "备注说明";
         ExcelManage.HaikanExcelExport("角色信息列表", dt);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 点击导出
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void BtnExport_Click(object sender, EventArgs e)
        {
            DataTable dt = DbHelperSql.GetDataTable("SystemLog", "UserName,TimeStr,ActionStr,IPAddress", "UserName like '%" + txtUserName.Text.Trim() + "%'  order by ID desc", "").Tables[0]; //导出;

            dt.Columns[0].ColumnName = "用户名";
            dt.Columns[1].ColumnName = "日志时间";
            dt.Columns[2].ColumnName = "操作内容";
            dt.Columns[3].ColumnName = "IP地址";
            ExcelManage.HaikanExcelExport("操作日志", dt);
            AddSystemLog("导出操作日志", "导出");
        }