Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public void Setup()
 {
     b30505 = new B30505(destinationFilePath, "2018/10/11", "2018/10/21");
 }