예제 #1
0
        public void batch_calculate()
        { 
            // if empty result가 없으면 만듬.
            //this.build_calculation();

            // load 함 ------------------------------------------------------------------
            clsMAST_FP_INSTRUMENT_TB clstb_mast = new clsMAST_FP_INSTRUMENT_TB();

            DataTable dt = clstb_mast.SelectAliveInstruments(this.ReferenceDate_);

            List<Financial_instrument> fi_list = new List<Financial_instrument>();

            foreach (DataRow dr in dt.Select())
            {
                clsMAST_FP_INSTRUMENT_TB tb = clsMAST_FP_INSTRUMENT_TB.Create(dr);

                Financial_instrument fi = Financial_instrument.CreateInstrument(tb);

                fi_list.Add(fi);
            }

            // 파라메터 아직 디폴트 ---------------------------------------------
            FP_Parameter fp_parameter = new FP_Parameter();
            fp_parameter.CalcDate_ = this.ReferenceDate_;
            fp_parameter.defaultLoad();
            // ------------------------------------------------------------------

                foreach (Financial_instrument roop_fi in fi_list)
                {
                    // 내부에서 cash_flow까지 같이 돌음.
                    roop_fi.delete_result(this.ReferenceDate_,roop_fi.baseDAO_.INSTRUMENT_ID);
                    roop_fi.calculate(this.ReferenceDate_, fp_parameter);
                }
            //try
            //{
            //}
            //catch (Exception e)
            //{
            //    this.LogManager_.addLog(e.Message);
            //}

            // ------------------------------------------------------------------

            //clstb.END_TIME = DateTime.Now.ToString("HHmmdd");
            //clstb.STATUS = (int)clsHDAT_BATCHJOB_RESULT_TB.STATUS_Type.CALCULATED;

            //clstb.Update();


        }