コード例 #1
0
        public IActionResult OutOperationLogsExcel(int uid)
        {
            string    sql      = $"select o.id,u.user_name,o.Create_Time,o.Ipadds,o.Content from operation_log o join users u on o.uid = u.uid where o.uid={uid};";
            DataSet   ds       = sqlServerHelper.GetDataSet(sql);
            DataTable dt       = ds.Tables[0];
            var       stream   = GetHelper.ExcelOut(dt);
            var       type     = "application/ectet-stream";
            var       filename = $"{DateTime.Now.ToString("yyyyMMddhhmmss")}.xls";

            return(File(stream.ToArray(), type, filename));
        }
コード例 #2
0
        public IActionResult OutLogLogsExcel(int uid)
        {
            string    sql      = $"select l.id,l.uid,l.Create_Time,l.Log_Seate,l.Log_LP,l.Log_City from log_log l join users u on l.uid = u.uid where l.uid={uid};";
            DataSet   ds       = sqlServerHelper.GetDataSet(sql);
            DataTable dt       = ds.Tables[0];
            var       stream   = GetHelper.ExcelOut(dt);
            var       type     = "application/ectet-stream";
            var       filename = $"{DateTime.Now.ToString("yyyyMMddhhmmss")}.xls";

            return(File(stream.ToArray(), type, filename));
        }