示例#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_VANILLA_FLOATING_TB clstb_vanilla_cf = new clsMAST_CF_VANILLA_FLOATING_TB();

            clstb_vanilla_cf.LEG_ID = inst_id;

            DataTable resultTb = clstb_vanilla_cf.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_ = ConvertingTool.ToDateTime(fp_floating.DAO_.CALC_START_DT);
                fp_floating.CalculationEndDate_ = ConvertingTool.ToDateTime(fp_floating.DAO_.CALC_END_DT);
                fp_floating.PaymentDate_ = ConvertingTool.ToDateTime(fp_floating.DAO_.PAYMENT_DT);

                this.FP_CashFlowList_.Add(fp_floating);

            }
        }
示例#2
0
        private void load_fp_vanillaFloating()
        {
            clsMAST_CF_VANILLA_FLOATING_TB clstb = new clsMAST_CF_VANILLA_FLOATING_TB();

            DataTable dt = clstb.Select();

            foreach (DataRow dr in dt.Select())
            {
                FP_FloatingRateCoupon fp_fixed = new FP_FloatingRateCoupon() { DAO_ = clsMAST_CF_VANILLA_FLOATING_TB.Create(dr) };
                this.FP_CashFlowList_.Add(fp_fixed);
            }
        }
		public clsMAST_CF_VANILLA_FLOATING_TB Clone()
		{
			try
			{
				clsMAST_CF_VANILLA_FLOATING_TB cloneTB = new clsMAST_CF_VANILLA_FLOATING_TB();
				
				
				cloneTB._CASHFLOW_DT = this._CASHFLOW_DT;
				cloneTB._LEG_ID = this._LEG_ID;
				cloneTB._LEG_TYP = this._LEG_TYP;
				cloneTB._NOTIONAL = this._NOTIONAL;
				cloneTB._PAY_RECEIVE = this._PAY_RECEIVE;
				cloneTB._CALC_START_DT = this._CALC_START_DT;
				cloneTB._CALC_END_DT = this._CALC_END_DT;
				cloneTB._PAYMENT_DT = this._PAYMENT_DT;
				cloneTB._FIXING_DT = this._FIXING_DT;
				cloneTB._FIXING_INDEX_CD = this._FIXING_INDEX_CD;
				cloneTB._GREARING = this._GREARING;
				cloneTB._SPREAD = this._SPREAD;
				cloneTB._FIXED_FIXING = this._FIXED_FIXING;
				cloneTB._FIXING_CALCLATION_TYP = this._FIXING_CALCLATION_TYP;
				cloneTB._FIXED_FIXING_CALCLATED = this._FIXED_FIXING_CALCLATED; 
				
				return cloneTB;
			}
			catch(Exception ex)
			{
				throw new Exception(ex.Message);
			}
		}
		public static clsMAST_CF_VANILLA_FLOATING_TB Create(DataRow dr)
		{
			try
			{
				clsMAST_CF_VANILLA_FLOATING_TB tb = new clsMAST_CF_VANILLA_FLOATING_TB();
				
				
				tb._CASHFLOW_DT = Convert.ToString(dr[0]);
				tb._LEG_ID = Convert.ToString(dr[1]);
				tb._LEG_TYP = Convert.ToInt32(dr[2]);
				tb._NOTIONAL = Convert.ToDouble(dr[3]);
				tb._PAY_RECEIVE = Convert.ToInt32(dr[4]);
				tb._CALC_START_DT = Convert.ToString(dr[5]);
				tb._CALC_END_DT = Convert.ToString(dr[6]);
				tb._PAYMENT_DT = Convert.ToString(dr[7]);
				tb._FIXING_DT = Convert.ToString(dr[8]);
				tb._FIXING_INDEX_CD = Convert.ToString(dr[9]);
				tb._GREARING = Convert.ToDouble(dr[10]);
				tb._SPREAD = Convert.ToDouble(dr[11]);
				tb._FIXED_FIXING = Convert.ToDouble(dr[12]);
				tb._FIXING_CALCLATION_TYP = Convert.ToInt32(dr[13]);
				tb._FIXED_FIXING_CALCLATED = Convert.ToInt32(dr[14]); 
				
				return tb;
			}
			catch(Exception ex)
			{
				throw new Exception(ex.Message);
			}
		}
示例#5
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
            {

            }
        }