예제 #1
0
파일: FP_CashFlow.cs 프로젝트: minikie/test
        // 우선 pay하고 rec 구분의 문제로 나중에 구현함.. 우선 direct로 insert함.
        public void build_emptyCashFlow(DateTime refDate,string inst_id,int inst_typ,int pay_rec,int seq)
        { 
            clsHITM_FP_CASHFLOWRESULT_TB clstb = new clsHITM_FP_CASHFLOWRESULT_TB();

            clstb.FP_CASHFLOW_RESULT_ID = IDGenerator.getNewCashResultID(inst_id, refDate.ToString("yyyyMMdd"), pay_rec,seq);
            clstb.NOTIONAL = this.Notional_;
            clstb.CALC_DT = refDate.ToString("yyyyMMdd");
            clstb.CASHFLOW_DT = this.PaymentDate_.ToString("yyyyMMdd");
            clstb.CASHFLOW_TYP = (int)this.LEG_TYP_Type_;
            clstb.SEQ = seq;
            clstb.INSTRUMENT_ID = inst_id;
            clstb.INSTRUMENT_TYP = inst_typ;
            clstb.PAY_REC = pay_rec;
            clstb.CASHFLOW = 0.0;
            clstb.DISCOUNT_FACTOR = 0.0;
            clstb.CALCULATED_TIME = "999999";

            clstb.Insert();

        }
예제 #2
0
파일: FP_CashFlow.cs 프로젝트: minikie/test
        public void cf_insert(DateTime calcDate,
                            int seq,
                            string inst_id,
                            int inst_typ,
                            int pay_rec) 
        {
            clsHITM_FP_CASHFLOWRESULT_TB clstb = new clsHITM_FP_CASHFLOWRESULT_TB();

            clstb.FP_CASHFLOW_RESULT_ID
                = IDGenerator.getNewCashResultID(inst_id, calcDate.ToString("yyyyMMdd"), pay_rec,seq); // 생성

            clstb.NOTIONAL = this.Notional_;
            clstb.CALC_DT = calcDate.ToString("yyyyMMdd");             // 인자
            clstb.CASHFLOW_DT = this.PaymentDate_.ToString("yyyyMMdd"); // 내부
            clstb.CASHFLOW_TYP = (int)this.LEG_TYP_Type_; // 내부
            clstb.SEQ = seq; // 인자
            clstb.INSTRUMENT_ID = inst_id; //인자
            clstb.INSTRUMENT_TYP = inst_typ;
            //clstb.PAY_REC = (this.CashFlowAmount_ > 0) ? 1 : -1;
            clstb.PAY_REC = pay_rec;
            clstb.CASHFLOW = Math.Round(this.CashFlowAmount_); // 인자
            clstb.DISCOUNT_FACTOR = this.DiscountFactor_;
            clstb.CALCULATED_TIME = "999999"; // 생성

            clstb.Insert();
            //if (clstb.Insert () ) { throw new Exception("insert fail"); };
            //if (clstb.UpdateCashFlow() != 1) { throw new Exception("update fail"); };

        }