Ejemplo n.º 1
0
        public ApiResult Export(RequestVisitRecordQDTO request)
        {
            var rootpath = ConfigurationManager.AppSettings["rootpath"].ToString();
            var fileid   = "recordList_" + DateTime.Now.ToString("yyyy-MM-dd");
            var filename = fileid + ".xls";

            var filePath = System.IO.Path.Combine(rootpath, filename);

            File.WriteAllBytes(filePath, Encoding.UTF8.GetBytes(recordService.ExportQuery(request)));
            return(fileid.ToApiResult());
        }