Esempio n. 1
0
        public override void loadLegInfo(string inst_id)
        {
            // leg info
            this.LegDAO_.INSTRUMENT_ID = inst_id;

            if (this.LegDAO_.SelectOwn() == 0) { throw new Exception("data not exist"); }

            // cash flow
            this.FP_CashFlowList_.Clear();

            clsMAST_CF_FIXED_TB clstb_cf = new clsMAST_CF_FIXED_TB();

            clstb_cf.LEG_ID = inst_id;

            DataTable resultTb = clstb_cf.Select();

            foreach (DataRow dr in resultTb.Select())
            {
                FP_FixedRateCoupon fp_fixed = new FP_FixedRateCoupon();

                fp_fixed.DAO_ = clsMAST_CF_FIXED_TB.Create(dr);

                fp_fixed.Notional_ = fp_fixed.DAO_.NOTIONAL;
                fp_fixed.CalculationStartDate_ = ConvertingTool.ToDateTime(fp_fixed.DAO_.CALC_START_DT);
                fp_fixed.CalculationEndDate_ = ConvertingTool.ToDateTime(fp_fixed.DAO_.CALC_END_DT);
                fp_fixed.PaymentDate_ = ConvertingTool.ToDateTime(fp_fixed.DAO_.PAYMENT_DT);

                this.FP_CashFlowList_.Add(fp_fixed);

            }
        }
Esempio n. 2
0
        private void load_fp_fixed()
        {
            clsMAST_CF_FIXED_TB clstb = new clsMAST_CF_FIXED_TB();

            DataTable dt = clstb.Select();

            foreach (DataRow dr in dt.Select())
            {
                FP_FixedRateCoupon fp_fixed = new FP_FixedRateCoupon() { DAO_ = clsMAST_CF_FIXED_TB.Create(dr) };
                this.FP_CashFlowList_.Add(fp_fixed);
            }
        }
Esempio n. 3
0
        private void cashflow(string legID,int type,List<FP_CashFlow> fp_cfList)
        {
            CultureInfo us = new CultureInfo("en-US");

            if (type == 0)
            {
                clsMAST_CF_FIXED_TB tb = new clsMAST_CF_FIXED_TB();

                tb.LEG_ID = legID;

                DataTable resultTb = tb.Select();

                foreach ( DataRow dr in resultTb.Select() )
                {
                    FP_FixedRateCoupon fp_fixed = new FP_FixedRateCoupon();

                    fp_fixed.DAO_ = clsMAST_CF_FIXED_TB.Create(dr);

                    fp_fixed.Notional_ = fp_fixed.DAO_.NOTIONAL;
                    fp_fixed.CalculationStartDate_ = DateTime.ParseExact(fp_fixed.DAO_.CALC_START_DT,"yyyyMMdd",us);
                    fp_fixed.CalculationEndDate_ = DateTime.ParseExact(fp_fixed.DAO_.CALC_END_DT, "yyyyMMdd", us);
                    fp_fixed.PaymentDate_ = DateTime.ParseExact(fp_fixed.DAO_.PAYMENT_DT, "yyyyMMdd", us);

                    fp_cfList.Add(fp_fixed);

                }

            }
            else if (type == 1)
            {
                clsMAST_CF_VANILLA_FLOATING_TB tb = new clsMAST_CF_VANILLA_FLOATING_TB();

                tb.LEG_ID = legID;

                DataTable resultTb = tb.Select();

                foreach (DataRow dr in resultTb.Select())
                {
                    FP_FloatingRateCoupon fp_floating = new FP_FloatingRateCoupon();

                    fp_floating.DAO_ = clsMAST_CF_VANILLA_FLOATING_TB.Create(dr);

                    fp_floating.Notional_ = fp_floating.DAO_.NOTIONAL;
                    fp_floating.CalculationStartDate_ = DateTime.ParseExact(fp_floating.DAO_.CALC_START_DT, "yyyyMMdd", us);
                    fp_floating.CalculationEndDate_ = DateTime.ParseExact(fp_floating.DAO_.CALC_END_DT, "yyyyMMdd", us);
                    fp_floating.PaymentDate_ = DateTime.ParseExact(fp_floating.DAO_.PAYMENT_DT, "yyyyMMdd", us);

                    fp_cfList.Add(fp_floating);

                }

                this.FixingIndexCD_ = ((FP_FloatingRateCoupon)fp_cfList[0]).DAO_.FIXING_INDEX_CD;
            }
            else
            {

            }
        }