protected override ResultStatus Export() { if (!StartExport()) { return(ResultStatus.Fail); } string lsFile = PbFunc.wf_copy_file(_ProgramID, "30370"); //message.OutputShowMessage只會儲存ok的狀態,如沒有任何一個ok代表全部function都沒有資料 MessageDisplay message = new MessageDisplay(); try { b30370 = new B30370(lsFile, emMonth.Text); //wf_30371() ShowMsg($"30371-年度期間法人機構期貨交易量統計表 轉檔中..."); message.OutputShowMessage = b30370.Wf30371(); //wf_30375() ShowMsg($"30375-年度期間法人機構期貨交易量統計表(維持率) 轉檔中..."); message.OutputShowMessage = b30370.Wf30375(); //連續跳2次無資料刪除檔案 if (string.IsNullOrEmpty(message.OutputShowMessage)) { if (File.Exists(lsFile)) { File.Delete(lsFile); } return(ResultStatus.Fail); } } catch (Exception ex) { if (File.Exists(lsFile)) { File.Delete(lsFile); } WriteLog(ex); return(ResultStatus.Fail); } finally { EndExport(); } return(ResultStatus.Success); }
public void Setup() { b30370 = new B30370(destinationFilePath, "2018/12"); //b30370 = new B30370(destinationFilePath, "2005/10"); //b30370 = new B30370(destinationFilePath, "2005/12"); }