Пример #1
0
        protected override ResultStatus Export()
        {
            if (!StartExport())
            {
                return(ResultStatus.Fail);
            }
            string lsFile = PbFunc.wf_copy_file(_ProgramID, "30360");
            //message.OutputShowMessage只會儲存ok的狀態,如沒有任何一個ok代表全部function都沒有資料
            MessageDisplay message = new MessageDisplay();

            try {
                b30360 = new B30360(lsFile, emMonth.Text);
                //wf_30361()
                ShowMsg($"30361-股票選擇權交易概況表 轉檔中...");
                message.OutputShowMessage = b30360.Wf30361();
                //wf_30362()
                ShowMsg($"30362-股票選擇權交易概況表 轉檔中...");
                message.OutputShowMessage = b30360.Wf30362();
                //wf_30363()
                ShowMsg($"30363-股票選擇權交易概況表 轉檔中...");
                message.OutputShowMessage = b30360.Wf30363();

                int stcCount = new D30360().ApdkSTCcount();
                if (stcCount > 0)
                {
                    //wf_30366()
                    ShowMsg($"30366-股票選擇權交易概況表 轉檔中...");
                    message.OutputShowMessage = b30360.Wf30366();
                    //wf_30367()
                    ShowMsg($"30367-股票選擇權交易概況表 轉檔中...");
                    message.OutputShowMessage = b30360.Wf30367();
                    //wf_30368()
                    ShowMsg($"30368-股票選擇權交易概況表 轉檔中...");
                    message.OutputShowMessage = b30360.Wf30368();
                }

                //連續跳3 or 6次無資料刪除檔案
                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);
        }
Пример #2
0
 public void Setup()
 {
     b30360 = new B30360(destinationFilePath, "2018/10");
     //b30360 = new B30360(destinationFilePath, "2005/10");
 }