Ejemplo n.º 1
0
        protected override ResultStatus Export()
        {
            if (!StartExport())
            {
                return(ResultStatus.Fail);
            }
            string         saveFilePath = PbFunc.wf_copy_file(_ProgramID, "40200");
            MessageDisplay message      = new MessageDisplay();

            try {
                b40200 = new B40200(saveFilePath, emStartDate.Text, emEndDate.Text);

                ShowMsg("40200-指數類期貨價格及現貨資料下載 轉檔中...");
                message.OutputShowMessage = b40200.Wf40200();
                if (string.IsNullOrEmpty(message.OutputShowMessage))
                {
                    ShowMsg("轉檔有錯誤!");
                    if (File.Exists(saveFilePath))
                    {
                        File.Delete(saveFilePath);
                    }
                    return(ResultStatus.Fail);
                }
            }
            catch (Exception ex) {
                ShowMsg("轉檔有錯誤!");
                this.Cursor = Cursors.Arrow;
                if (File.Exists(saveFilePath))
                {
                    File.Delete(saveFilePath);
                }
                WriteLog(ex);
                return(ResultStatus.Fail);
            }
            finally {
                EndExport();
            }

            return(ResultStatus.Success);
        }
Ejemplo n.º 2
0
 public void Setup()
 {
     b40200 = new B40200(destinationFilePath, "2018/10/01", "2018/12/01");
     //b40200 = new B40200(destinationFilePath, "2005/10/01","2005/12/01");
 }