Esempio n. 1
0
        // 이건 그냥 partition 말고 전체 list로 하자. join 이 있어서리 linq로 못감.
        // 최근일자가 가져와짐.
        public void totalHedgeGreekPositionLoad()
        {
            this.LoadedHedgeGreekPositionVMList_.Clear();

            clsHITM_FP_GREEKRESULT_TB clstb_greekResult = new clsHITM_FP_GREEKRESULT_TB();

            // 최근일 check 
            // 결과가 있으면... 그날 가져옴... 없으면 전일자
            // 보통 예전 일이면 그냥 그날꺼 가져옴

            // 이놈은 생성을 언제 하냐면.... 다음날이 대면 그냥 생성해놓음.
            clsHDAT_BATCHJOB_RESULT_TB clstb_batchjob = new clsHDAT_BATCHJOB_RESULT_TB();
            
            string refDateStr = this.ReferenceDate_.ToString("yyyyMMdd");

            clstb_batchjob.BATCH_JOB_ID = (int)clsHDAT_BATCHJOB_RESULT_TB.BATCH_JOB_ID_Type.FP_CACULATION;
            clstb_batchjob.CALC_DT = refDateStr;

            clstb_batchjob.SelectOwn();

            clstb_greekResult.CALC_DT = clstb_batchjob.MaxCalcDateSelect();

            DataTable dt_greekResult = clstb_greekResult.Select();

            foreach (DataRow dr in dt_greekResult.Select())
            {
                HedgeGreekPositionViewModel vm = new HedgeGreekPositionViewModel();
                vm.DAO_ = clsHITM_FP_GREEKRESULT_TB.Create(dr);
                this.LoadedHedgeGreekPositionVMList_.Add(vm);
            }

            //if (clstb_batchjob.STATUS == (int)clsHDAT_BATCHJOB_RESULT_TB.STATUS_Type.CALCULATED)
            //{
            //    clstb_greekResult.CALC_DT = clstb_batchjob.CALC_DT;

            //    DataTable dt_greekResult = clstb_greekResult.Select();

            //    foreach (DataRow dr in dt_greekResult.Select())
            //    {
            //        HedgeGreekPositionViewModel vm = new HedgeGreekPositionViewModel();
            //        vm.DAO_ = clsHITM_FP_GREEKRESULT_TB.Create(dr);
            //        this.LoadedHedgeGreekPositionVMList_.Add(vm);
            //    }

            //}
            //else
            //{
            //    // 최근일
            //    refDateStr = clstb_batchjob.MaxCalcDateSelect();

            //    clstb_greekResult.CALC_DT = clstb_batchjob;

            //    DataTable dt_greekResult = clstb_greekResult.Select();

            //    foreach (DataRow dr in dt_greekResult.Select())
            //    {
            //        HedgeGreekPositionViewModel vm = new HedgeGreekPositionViewModel();
            //        vm.DAO_ = clsHITM_FP_GREEKRESULT_TB.Create(dr);
            //        this.LoadedHedgeGreekPositionVMList_.Add(vm);
            //    }
            //}

        }
Esempio n. 2
0
        public static void updateBatchJobID_end(DateTime refDate, clsHDAT_BATCHJOB_RESULT_TB.BATCH_JOB_ID_Type jobType)
        {
            // basedata 딴데서 만듬.

            clsHDAT_BATCHJOB_RESULT_TB clstb = new clsHDAT_BATCHJOB_RESULT_TB();

            clstb.BATCH_JOB_ID = (int)jobType;
            clstb.CALC_DT = refDate.ToString("yyyyMMdd");

            if (clstb.SelectOwn() == 0)
                { throw new Exception(" not yet started : " + clstb.CALC_DT + " " + clstb.BATCH_JOB_ID); }

            clstb.CALC_DT = refDate.ToString("yyyyMMdd");
            clstb.BATCH_JOB_ID = (int)jobType;
            //clstb.START_TIME = startTime.ToString("HH:mm:ss");
            clstb.END_TIME = DateTime.Now.ToString("HH:mm:ss");
            clstb.DURATION_TIME = "999999";// (DateTime.Now - ConvertingTool.ToDateTime(clstb.START_TIME)).ToString("HH:mm:ss");
            clstb.STATUS = (int)clsHDAT_BATCHJOB_RESULT_TB.STATUS_Type.CALCULATED;

            if (clstb.UpdateBatch() == 0)
                { throw new Exception("update fail : " + clstb.CALC_DT + " " + clstb.BATCH_JOB_ID); }

        }
Esempio n. 3
0
        public void init_generateAll()
        {
            clsHDAT_BATCHJOB_RESULT_TB clstb = new clsHDAT_BATCHJOB_RESULT_TB();

            clstb.CALC_DT = this.ReferenceDate_.ToString("yyyyMMdd");

            bool exist = ( clstb.SelectOwn() > 0) ? true : false;

            //clsHITM_FP_POSITION_TB clstb_position = new clsHITM_FP_POSITION_TB();

            //clstb_position.POSITION_DT = 

            if (!exist)
            {
                this.generateAll();
            }

        }