protected override ResultStatus Export() { if (!ExportBefore()) { return(ResultStatus.Fail); } MessageDisplay message = new MessageDisplay(); string saveFilePath = Path.Combine(GlobalInfo.DEFAULT_REPORT_DIRECTORY_PATH, $@"30505_{DateTime.Now.ToString("yyyy.MM.dd")}-{DateTime.Now.ToString("HH.mm.ss")}.csv"); try { //資料來源 b30505 = new B30505(saveFilePath, emStartDate.Text, emEndDate.Text); ShowMsg("30505-股票期貨最近月份契約買賣價差週資料統計表(單位:tick) 轉檔中..."); message.OutputShowMessage = b30505.Wf30505(); if (string.IsNullOrEmpty(message.OutputShowMessage)) { if (File.Exists(saveFilePath)) { File.Delete(saveFilePath); } return(ResultStatus.Fail); } } catch (Exception ex) { if (File.Exists(saveFilePath)) { File.Delete(saveFilePath); } WriteLog(ex); return(ResultStatus.Fail); } finally { ExportAfter(); } return(ResultStatus.Success); }
public void Wf30505Test() { string msgText = b30505.Wf30505(); Assert.IsNotNull(msgText); }