Exemplo 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);

            }
        }
Exemplo n.º 2
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
            {

            }
        }
Exemplo n.º 3
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);
            }
        }
Exemplo n.º 4
0
		public clsMAST_CF_FIXED_TB Clone()
		{
			try
			{
				clsMAST_CF_FIXED_TB cloneTB = new clsMAST_CF_FIXED_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._FIXED_RATE = this._FIXED_RATE; 
				
				return cloneTB;
			}
			catch(Exception ex)
			{
				throw new Exception(ex.Message);
			}
		}
Exemplo n.º 5
0
		public static clsMAST_CF_FIXED_TB Create(DataRow dr)
		{
			try
			{
				clsMAST_CF_FIXED_TB tb = new clsMAST_CF_FIXED_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._FIXED_RATE = Convert.ToDouble(dr[8]); 
				
				return tb;
			}
			catch(Exception ex)
			{
				throw new Exception(ex.Message);
			}
		}