Example #1
0
        public bool setOCF(DateTime OCF_DATE, string DB_TYPE, string USER_ID)
        {
            OCF    ocf   = new OCF(DB_TYPE);
            BO_OCF boOCF = ocf.GetOCF();

            if (boOCF == null)
            {
                MessageDisplay.Error("交易日期檔(OCF)讀取錯誤!");
                return(false);
            }

            if (DB_TYPE == "futAH" || DB_TYPE == "optAH")
            {
                if (MessageDisplay.Choose($"請確定交易日期({boOCF.OCF_DATE.AsString("yyyy/MM/dd")}) 沒有例外而遞延日期?\r\n(eg.颱風,災害...)") == System.Windows.Forms.DialogResult.No)
                {
                    return(false);
                }
            }

            //清除異動紀錄檔
            daoFutAHOCFUPD.Delete();
            daoOptAHOCFUPD.Delete();

            if (DB_TYPE == "futAH")
            {
                daoFutAHOCFUPD.Insert(boOCF.OCF_PREV_DATE, boOCF.OCF_DATE, OCF_DATE, USER_ID);
                ConnectionInfo connectionInfo = SettingDragons.Instance.GetConnectionInfo(DB_TYPE);
                ResultData     resultData     = serviceCommon.ExecuteStoredProcedure(connectionInfo, "futAH.sp_FAH_chg_OCF_Hdata", null, false);
            }
            else if (DB_TYPE == "optAH")
            {
                daoOptAHOCFUPD.Insert(boOCF.OCF_PREV_DATE, boOCF.OCF_DATE, OCF_DATE, USER_ID);
                ConnectionInfo connectionInfo = SettingDragons.Instance.GetConnectionInfo(DB_TYPE);
                ResultData     resultData     = serviceCommon.ExecuteStoredProcedure(connectionInfo, "optAH.sp_OAH_chg_OCF_Hdata", null, false);
            }

            //更新OCF_DATE
            return(ocf.UpdateDate(OCF_DATE));
        }
Example #2
0
 /// <summary>
 /// 抓OCF這個TABLE存到物件裡
 /// </summary>
 public BO_OCF GetOCF()
 {
     return(daoOCF.GetOCF());
 }