public override void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
        {
            FpmlSerializedCSharp.Excel_couponSchedule serial_Excel_couponSchedule = serial_Class as FpmlSerializedCSharp.Excel_couponSchedule;
            FpmlSerializedCSharp.Excel_condi_structuredAccrualCouponSchedule serial_Excel_condi_structuredAccrualCouponSchedule = serial_Excel_couponSchedule.Excel_condi_structuredAccrualCouponSchedule_;

            this.eventDate_ = StringConverter.xmlDateToDateTime(serial_Excel_condi_structuredAccrualCouponSchedule.EventDate_.ValueStr);

            this.payoffDate_ = StringConverter.xmlDateToDateTime(serial_Excel_condi_structuredAccrualCouponSchedule.PayoffDate_.ValueStr);

            this.calculationStartDate_ = StringConverter.xmlDateToDateTime(serial_Excel_condi_structuredAccrualCouponSchedule.CalculationStartDate_.ValueStr);

            this.calculationEndDate_ = StringConverter.xmlDateToDateTime(serial_Excel_condi_structuredAccrualCouponSchedule.CalculationEndDate_.ValueStr);

            this.description_ = serial_Excel_condi_structuredAccrualCouponSchedule.Description_.ValueStr;

            this.vba_description_ = serial_Excel_condi_structuredAccrualCouponSchedule.Vba_description_.ValueStr;

            FpmlSerializedCSharp.Range1D serial_range1D = serial_Excel_condi_structuredAccrualCouponSchedule.Range1D_;
            string range1Dtype = serial_range1D.Excel_type_.ValueStr;

            this.range1DViewModel_ = Range1DViewModel.CreateRange1D(range1Dtype);
            this.range1DViewModel_.setFromSerial(serial_range1D);

            FpmlSerializedCSharp.Excel_returnCalcInfo serial_excel_returnCalcInfo = serial_Excel_condi_structuredAccrualCouponSchedule.Excel_returnCalcInfo_;
            string excel_returnCalcInfotype = serial_excel_returnCalcInfo.Excel_type_.ValueStr;

            this.excel_returnCalcInfoViewModel_ = Excel_returnCalcInfoViewModel.CreateExcel_returnCalcInfo(excel_returnCalcInfotype);
            this.excel_returnCalcInfoViewModel_.setFromSerial(serial_excel_returnCalcInfo);

            this.dayCounter_ = serial_Excel_condi_structuredAccrualCouponSchedule.DayCounter_.ValueStr;

            this.detailScheduleType_ = serial_Excel_condi_structuredAccrualCouponSchedule.DetailScheduleType_.ValueStr;
        }
Exemple #2
0
        public void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
        {
            FpmlSerializedCSharp.Excel_multi_rangeND serial_Excel_multi_rangeND = serial_Class as FpmlSerializedCSharp.Excel_multi_rangeND;

            this.joint_type_ = serial_Excel_multi_rangeND.Joint_type_.ValueStr;

            List <FpmlSerializedCSharp.Range1D> serial_range1D = serial_Excel_multi_rangeND.Range1D_;

            this.range1DViewModel_ = new ObservableCollection <Range1DViewModel>();
            foreach (var item in serial_range1D)
            {
                string           type      = item.Excel_type_.ValueStr;
                Range1DViewModel viewModel = Range1DViewModel.CreateRange1D(type);
                viewModel.setFromSerial(item);
                this.range1DViewModel_.Add(viewModel);
            }

            List <FpmlSerializedCSharp.Excel_underlyingCalcID> serial_excel_underlyingCalcID = serial_Excel_multi_rangeND.Excel_underlyingCalcID_;

            this.excel_underlyingCalcIDViewModel_ = new ObservableCollection <Excel_underlyingCalcIDViewModel>();
            foreach (var item in serial_excel_underlyingCalcID)
            {
                string type = item.Excel_type_.ValueStr;
                Excel_underlyingCalcIDViewModel viewModel = Excel_underlyingCalcIDViewModel.CreateExcel_underlyingCalcID(type);
                viewModel.setFromSerial(item);
                this.excel_underlyingCalcIDViewModel_.Add(viewModel);
            }
        }
Exemple #3
0
        public override void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
        {
            FpmlSerializedCSharp.EventCalculation    serial_EventCalculation    = serial_Class as FpmlSerializedCSharp.EventCalculation;
            FpmlSerializedCSharp.SimpleRangeEventCal serial_SimpleRangeEventCal = serial_EventCalculation.SimpleRangeEventCal_;

            FpmlSerializedCSharp.Range1D serial_range1D = serial_SimpleRangeEventCal.Range1D_;
            string range1Dtype = serial_range1D.Excel_type_.ValueStr;

            this.range1DViewModel_ = Range1DViewModel.CreateRange1D(range1Dtype);
            this.range1DViewModel_.setFromSerial(serial_range1D);

            FpmlSerializedCSharp.ReferenceCalculationInfo serial_referenceCalculationInfo = serial_SimpleRangeEventCal.ReferenceCalculationInfo_;
            string referenceCalculationInfotype = serial_referenceCalculationInfo.Excel_type_.ValueStr;

            this.referenceCalculationInfoViewModel_ = ReferenceCalculationInfoViewModel.CreateReferenceCalculationInfo(referenceCalculationInfotype);
            this.referenceCalculationInfoViewModel_.setFromSerial(serial_referenceCalculationInfo);

            FpmlSerializedCSharp.DateInformation serial_dateInformation = serial_SimpleRangeEventCal.DateInformation_;
            string dateInformationtype = serial_dateInformation.Excel_type_.ValueStr;

            this.dateInformationViewModel_ = DateInformationViewModel.CreateDateInformation(dateInformationtype);
            this.dateInformationViewModel_.setFromSerial(serial_dateInformation);

            FpmlSerializedCSharp.JointSimpleCalculation serial_jointSimpleCalculation = serial_SimpleRangeEventCal.JointSimpleCalculation_;
            string jointSimpleCalculationtype = serial_jointSimpleCalculation.Excel_type_.ValueStr;

            this.jointSimpleCalculationViewModel_ = JointSimpleCalculationViewModel.CreateJointSimpleCalculation(jointSimpleCalculationtype);
            this.jointSimpleCalculationViewModel_.setFromSerial(serial_jointSimpleCalculation);
        }
        public override void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
        {
            FpmlSerializedCSharp.Excel_couponSchedule serial_Excel_couponSchedule = serial_Class as FpmlSerializedCSharp.Excel_couponSchedule;
            FpmlSerializedCSharp.Excel_multiCondi_structuredAccrualCouponSchedule serial_Excel_multiCondi_structuredAccrualCouponSchedule = serial_Excel_couponSchedule.Excel_multiCondi_structuredAccrualCouponSchedule_;

            this.eventDate_ = StringConverter.xmlDateToDateTime(serial_Excel_multiCondi_structuredAccrualCouponSchedule.EventDate_.ValueStr);

            this.payoffDate_ = StringConverter.xmlDateToDateTime(serial_Excel_multiCondi_structuredAccrualCouponSchedule.PayoffDate_.ValueStr);

            this.calculationStartDate_ = StringConverter.xmlDateToDateTime(serial_Excel_multiCondi_structuredAccrualCouponSchedule.CalculationStartDate_.ValueStr);

            this.calculationEndDate_ = StringConverter.xmlDateToDateTime(serial_Excel_multiCondi_structuredAccrualCouponSchedule.CalculationEndDate_.ValueStr);

            this.description_ = serial_Excel_multiCondi_structuredAccrualCouponSchedule.Description_.ValueStr;

            this.vba_description_ = serial_Excel_multiCondi_structuredAccrualCouponSchedule.Vba_description_.ValueStr;

            List <FpmlSerializedCSharp.Range1D> serial_range1D = serial_Excel_multiCondi_structuredAccrualCouponSchedule.Range1D_;

            this.range1DViewModel_ = new ObservableCollection <Range1DViewModel>();
            foreach (var item in serial_range1D)
            {
                string           type      = item.Excel_type_.ValueStr;
                Range1DViewModel viewModel = Range1DViewModel.CreateRange1D(type);
                viewModel.setFromSerial(item);
                this.range1DViewModel_.Add(viewModel);
            }

            List <FpmlSerializedCSharp.Excel_underlyingCalcID> serial_excel_underlyingCalcID = serial_Excel_multiCondi_structuredAccrualCouponSchedule.Excel_underlyingCalcID_;

            this.excel_underlyingCalcIDViewModel_ = new ObservableCollection <Excel_underlyingCalcIDViewModel>();
            foreach (var item in serial_excel_underlyingCalcID)
            {
                string type = item.Excel_type_.ValueStr;
                Excel_underlyingCalcIDViewModel viewModel = Excel_underlyingCalcIDViewModel.CreateExcel_underlyingCalcID(type);
                viewModel.setFromSerial(item);
                this.excel_underlyingCalcIDViewModel_.Add(viewModel);
            }

            List <FpmlSerializedCSharp.Excel_returnCalcInfo> serial_excel_returnCalcInfo = serial_Excel_multiCondi_structuredAccrualCouponSchedule.Excel_returnCalcInfo_;

            this.excel_returnCalcInfoViewModel_ = new ObservableCollection <Excel_returnCalcInfoViewModel>();
            foreach (var item in serial_excel_returnCalcInfo)
            {
                string type = item.Excel_type_.ValueStr;
                Excel_returnCalcInfoViewModel viewModel = Excel_returnCalcInfoViewModel.CreateExcel_returnCalcInfo(type);
                viewModel.setFromSerial(item);
                this.excel_returnCalcInfoViewModel_.Add(viewModel);
            }

            this.dayCounter_ = serial_Excel_multiCondi_structuredAccrualCouponSchedule.DayCounter_.ValueStr;

            this.detailScheduleType_ = serial_Excel_multiCondi_structuredAccrualCouponSchedule.DetailScheduleType_.ValueStr;
        }
Exemple #5
0
        public void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
        {
            FpmlSerializedCSharp.RangeCondition1D serial_RangeCondition1D = serial_Class as FpmlSerializedCSharp.RangeCondition1D;

            FpmlSerializedCSharp.Range1D serial_range1D = serial_RangeCondition1D.Range1D_;
            string range1Dtype = serial_range1D.Excel_type_.ValueStr;

            this.range1DViewModel_ = Range1DViewModel.CreateRange1D(range1Dtype);
            this.range1DViewModel_.setFromSerial(serial_range1D);

            this.constValue_ = serial_RangeCondition1D.ConstValue_.ValueStr;

            this.refName_ = serial_RangeCondition1D.RefName_.ValueStr;
        }
 public  void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
 {
     FpmlSerializedCSharp.RangeCondition1D serial_RangeCondition1D = serial_Class as FpmlSerializedCSharp.RangeCondition1D;
 
     FpmlSerializedCSharp.Range1D serial_range1D = serial_RangeCondition1D.Range1D_;
     string range1Dtype = serial_range1D.Excel_type_.ValueStr;
     this.range1DViewModel_ = Range1DViewModel.CreateRange1D(range1Dtype);
     this.range1DViewModel_.setFromSerial(serial_range1D);
     
     this.constValue_ = serial_RangeCondition1D.ConstValue_.ValueStr;
     
     this.refName_ = serial_RangeCondition1D.RefName_.ValueStr;
     
 }
 public override void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
 {
     FpmlSerializedCSharp.Excel_couponSchedule serial_Excel_couponSchedule = serial_Class as FpmlSerializedCSharp.Excel_couponSchedule;
     FpmlSerializedCSharp.Excel_condi_structuredAccrualCouponSchedule serial_Excel_condi_structuredAccrualCouponSchedule = serial_Excel_couponSchedule.Excel_condi_structuredAccrualCouponSchedule_;
 
     this.eventDate_ = StringConverter.xmlDateToDateTime(serial_Excel_condi_structuredAccrualCouponSchedule.EventDate_.ValueStr);
     
     this.payoffDate_ = StringConverter.xmlDateToDateTime(serial_Excel_condi_structuredAccrualCouponSchedule.PayoffDate_.ValueStr);
     
     this.calculationStartDate_ = StringConverter.xmlDateToDateTime(serial_Excel_condi_structuredAccrualCouponSchedule.CalculationStartDate_.ValueStr);
     
     this.calculationEndDate_ = StringConverter.xmlDateToDateTime(serial_Excel_condi_structuredAccrualCouponSchedule.CalculationEndDate_.ValueStr);
     
     this.description_ = serial_Excel_condi_structuredAccrualCouponSchedule.Description_.ValueStr;
     
     this.vba_description_ = serial_Excel_condi_structuredAccrualCouponSchedule.Vba_description_.ValueStr;
     
     FpmlSerializedCSharp.Range1D serial_range1D = serial_Excel_condi_structuredAccrualCouponSchedule.Range1D_;
     string range1Dtype = serial_range1D.Excel_type_.ValueStr;
     this.range1DViewModel_ = Range1DViewModel.CreateRange1D(range1Dtype);
     this.range1DViewModel_.setFromSerial(serial_range1D);
     
     FpmlSerializedCSharp.Excel_returnCalcInfo serial_excel_returnCalcInfo = serial_Excel_condi_structuredAccrualCouponSchedule.Excel_returnCalcInfo_;
     string excel_returnCalcInfotype = serial_excel_returnCalcInfo.Excel_type_.ValueStr;
     this.excel_returnCalcInfoViewModel_ = Excel_returnCalcInfoViewModel.CreateExcel_returnCalcInfo(excel_returnCalcInfotype);
     this.excel_returnCalcInfoViewModel_.setFromSerial(serial_excel_returnCalcInfo);
     
     this.dayCounter_ = serial_Excel_condi_structuredAccrualCouponSchedule.DayCounter_.ValueStr;
     
     this.detailScheduleType_ = serial_Excel_condi_structuredAccrualCouponSchedule.DetailScheduleType_.ValueStr;
     
 }
        public override void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
        {
            FpmlSerializedCSharp.Excel_couponSchedule serial_Excel_couponSchedule = serial_Class as FpmlSerializedCSharp.Excel_couponSchedule;
            FpmlSerializedCSharp.Excel_multiCondi_structuredAccrualCouponSchedule serial_Excel_multiCondi_structuredAccrualCouponSchedule 
                = serial_Excel_couponSchedule.Excel_multiCondi_structuredAccrualCouponSchedule_;

            base.setFromSerial(serial_Excel_couponSchedule.Excel_additionalOption_);

            this.eventDate_ = StringConverter.xmlDateToDateTime(serial_Excel_multiCondi_structuredAccrualCouponSchedule.EventDate_.ValueStr);
            this.payoffDate_ = StringConverter.xmlDateToDateTime(serial_Excel_multiCondi_structuredAccrualCouponSchedule.PayoffDate_.ValueStr);
            this.calculationStartDate_ = StringConverter.xmlDateToDateTime(serial_Excel_multiCondi_structuredAccrualCouponSchedule.CalculationStartDate_.ValueStr);
            this.calculationEndDate_ = StringConverter.xmlDateToDateTime(serial_Excel_multiCondi_structuredAccrualCouponSchedule.CalculationEndDate_.ValueStr);
            this.description_ = serial_Excel_multiCondi_structuredAccrualCouponSchedule.Description_.ValueStr;
            this.vba_description_ = serial_Excel_multiCondi_structuredAccrualCouponSchedule.Vba_description_.ValueStr;

            List<FpmlSerializedCSharp.Range1D> serial_range1D = serial_Excel_multiCondi_structuredAccrualCouponSchedule.Range1D_;
            this.range1DViewModel_ = new ObservableCollection<Range1DViewModel>();
            foreach (var item in serial_range1D)
            {
                Range1DViewModel viewModel = new Range1DViewModel();
                viewModel.setFromSerial(item);
                this.range1DViewModel_.Add(viewModel);
            }

            List<FpmlSerializedCSharp.Excel_underlyingCalcID> serial_excel_underlyingCalcID = serial_Excel_multiCondi_structuredAccrualCouponSchedule.Excel_underlyingCalcID_;
            this.excel_underlyingCalcIDViewModel_ = new ObservableCollection<Excel_underlyingCalcIDViewModel>();
            foreach (var item in serial_excel_underlyingCalcID)
            {
                string type = item.Excel_type_.ValueStr;
                Excel_underlyingCalcIDViewModel viewModel = Excel_underlyingCalcIDViewModel.CreateExcel_underlyingCalcID(type);
                viewModel.setFromSerial(item);
                this.excel_underlyingCalcIDViewModel_.Add(viewModel);
            }
            
            List<FpmlSerializedCSharp.Excel_returnCalcInfo> serial_excel_returnCalcInfo = serial_Excel_multiCondi_structuredAccrualCouponSchedule.Excel_returnCalcInfo_;
            this.excel_returnCalcInfoViewModel_ = new ObservableCollection<Excel_returnCalcInfoViewModel>();
            foreach (var item in serial_excel_returnCalcInfo)
            {
                string type = item.Excel_type_.ValueStr;
                Excel_returnCalcInfoViewModel viewModel = Excel_returnCalcInfoViewModel.CreateExcel_returnCalcInfo(type);
                viewModel.setFromSerial(item);
                this.excel_returnCalcInfoViewModel_.Add(viewModel);
            }
            
            this.dayCounter_ = serial_Excel_multiCondi_structuredAccrualCouponSchedule.DayCounter_.ValueStr;
            this.detailScheduleType_ = serial_Excel_multiCondi_structuredAccrualCouponSchedule.DetailScheduleType_.ValueStr;
        }
 public  void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
 {
     FpmlSerializedCSharp.Excel_multi_rangeND serial_Excel_multi_rangeND = serial_Class as FpmlSerializedCSharp.Excel_multi_rangeND;
 
     this.joint_type_ = serial_Excel_multi_rangeND.Joint_type_.ValueStr;
     
     List<FpmlSerializedCSharp.Range1D> serial_range1D = serial_Excel_multi_rangeND.Range1D_;
     this.range1DViewModel_ = new ObservableCollection<Range1DViewModel>();
     foreach (var item in serial_range1D)
     {
         Range1DViewModel viewModel = new Range1DViewModel();
         viewModel.setFromSerial(item);
         this.range1DViewModel_.Add(viewModel);
     }
     
     List<FpmlSerializedCSharp.Excel_underlyingCalcID> serial_excel_underlyingCalcID = serial_Excel_multi_rangeND.Excel_underlyingCalcID_;
     this.excel_underlyingCalcIDViewModel_ = new ObservableCollection<Excel_underlyingCalcIDViewModel>();
     foreach (var item in serial_excel_underlyingCalcID)
     {
         string type = item.Excel_type_.ValueStr;
         Excel_underlyingCalcIDViewModel viewModel = Excel_underlyingCalcIDViewModel.CreateExcel_underlyingCalcID(type);
         viewModel.setFromSerial(item);
         this.excel_underlyingCalcIDViewModel_.Add(viewModel);
     }
     
 }
        public void addSingleConditionDualRangAccrualFixedCoupon(DateTime calculationStartDate,
                                                DateTime calculationEndDate,
                                                DateTime payoffDate,
                                                List<double> lowerRngList,
                                                List<string> referenceUnderCodeList,
                                                List<double> upperRngList,
                                                double fixedRate)
        {
            Excel_multiCondi_multiRng_structuredAccrualCouponScheduleViewModel e_mc_mr_sacsvm
                    = new Excel_multiCondi_multiRng_structuredAccrualCouponScheduleViewModel();

            e_mc_mr_sacsvm.EventDate_ = payoffDate;

            e_mc_mr_sacsvm.CalculationStartDate_ = calculationStartDate;
            e_mc_mr_sacsvm.CalculationEndDate_ = calculationEndDate;
            e_mc_mr_sacsvm.PayoffDate_ = payoffDate;

            int rangeCount = lowerRngList.Count;

            Excel_multi_rangeNDViewModel e_m_rngNDVM = new Excel_multi_rangeNDViewModel();

            for (int i = 0; i < rangeCount; i++)
            {
                Range1DViewModel accRng1D = new Range1DViewModel();

                accRng1D.LowerBound_ = lowerRngList[i].ToString();

                DateTime effDate = this.instVM_.Excel_interfaceViewModel_.Excel_issueInfoViewModel_.EffectiveDate_;
                
                //this.addUnderlying(Excel_loaderViewModel.loadUnderInfo2(effDate, referenceUnderCodeList[i]));
                this.addUnderlying(effDate, referenceUnderCodeList[i]);

                Excel_choiceUnderlyingCalcIDViewModel choiceUnderCalcIDVM = new Excel_choiceUnderlyingCalcIDViewModel();

                choiceUnderCalcIDVM.EventDate_ = payoffDate;

                Excel_selectedUnderlyingViewModel selectedUnder = new Excel_selectedUnderlyingViewModel();
                selectedUnder.Code_ = referenceUnderCodeList[i];
                selectedUnder.NameTrans_ = new NameTrans(referenceUnderCodeList[i]);
                selectedUnder.Checked_ = true;

                choiceUnderCalcIDVM.Excel_selectedUnderlyingViewModel_.Add(selectedUnder);

                accRng1D.UpperBound_ = upperRngList[i].ToString();

                e_m_rngNDVM.Range1DViewModel_.Add(accRng1D);
                e_m_rngNDVM.Excel_underlyingCalcIDViewModel_.Add(choiceUnderCalcIDVM);
            }

            e_mc_mr_sacsvm.Excel_multi_rangeNDViewModel_.Add(e_m_rngNDVM);

            Excel_constReturnCalViewModel e_crcvm = new Excel_constReturnCalViewModel();

            e_crcvm.ConstReturn_ = fixedRate.ToString();

            e_mc_mr_sacsvm.Excel_returnCalcInfoViewModel_.Add(e_crcvm);

            //e_mc_sacsvm.FixedRate_ = fixedRate.ToString();

            Excel_structuredBondViewModel e_sbvm = this.instVM_.Excel_interfaceViewModel_ as Excel_structuredBondViewModel;

            e_sbvm.Excel_couponScheduleListViewModel_.Excel_couponScheduleViewModel_.Add(e_mc_mr_sacsvm);

            //this.instVM_.Excel_interfaceViewModel_ = e_sbvm;
        }
 public override void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
 {
     FpmlSerializedCSharp.EventCalculation serial_EventCalculation = serial_Class as FpmlSerializedCSharp.EventCalculation;
     FpmlSerializedCSharp.SimpleRangeEventCal serial_SimpleRangeEventCal = serial_EventCalculation.SimpleRangeEventCal_;
 
     FpmlSerializedCSharp.Range1D serial_range1D = serial_SimpleRangeEventCal.Range1D_;
     string range1Dtype = serial_range1D.Excel_type_.ValueStr;
     this.range1DViewModel_ = Range1DViewModel.CreateRange1D(range1Dtype);
     this.range1DViewModel_.setFromSerial(serial_range1D);
     
     FpmlSerializedCSharp.ReferenceCalculationInfo serial_referenceCalculationInfo = serial_SimpleRangeEventCal.ReferenceCalculationInfo_;
     string referenceCalculationInfotype = serial_referenceCalculationInfo.Excel_type_.ValueStr;
     this.referenceCalculationInfoViewModel_ = ReferenceCalculationInfoViewModel.CreateReferenceCalculationInfo(referenceCalculationInfotype);
     this.referenceCalculationInfoViewModel_.setFromSerial(serial_referenceCalculationInfo);
     
     FpmlSerializedCSharp.DateInformation serial_dateInformation = serial_SimpleRangeEventCal.DateInformation_;
     string dateInformationtype = serial_dateInformation.Excel_type_.ValueStr;
     this.dateInformationViewModel_ = DateInformationViewModel.CreateDateInformation(dateInformationtype);
     this.dateInformationViewModel_.setFromSerial(serial_dateInformation);
     
     FpmlSerializedCSharp.JointSimpleCalculation serial_jointSimpleCalculation = serial_SimpleRangeEventCal.JointSimpleCalculation_;
     string jointSimpleCalculationtype = serial_jointSimpleCalculation.Excel_type_.ValueStr;
     this.jointSimpleCalculationViewModel_ = JointSimpleCalculationViewModel.CreateJointSimpleCalculation(jointSimpleCalculationtype);
     this.jointSimpleCalculationViewModel_.setFromSerial(serial_jointSimpleCalculation);
     
 }
        public string addSingleConditionDualRangAccrualFixedCoupon(DateTime calculationStartDate,
                                                DateTime calculationEndDate,
                                                DateTime payoffDate,
                                                List<double> lowerRngList,
                                                List<string> referenceUnderCodeList,
                                                List<double> upperRngList,
                                                double fixedRate)
        {
            try
            {
                #region CheckParameter

                if (calculationStartDate >= calculationEndDate)
                    throw new Exception("startDate must be earlier than endDate");

                //// check underlying 
                //if ( !this.hasUnderlyings(underlyings))
                //    throw new Exception(underlyings + " does not exist. add underlying first.");


                #endregion

                Excel_multiCondi_multiRng_structuredAccrualCouponScheduleViewModel e_mc_mr_sacsvm
                        = new Excel_multiCondi_multiRng_structuredAccrualCouponScheduleViewModel();

                e_mc_mr_sacsvm.EventDate_ = payoffDate;

                e_mc_mr_sacsvm.CalculationStartDate_ = calculationStartDate;
                e_mc_mr_sacsvm.CalculationEndDate_ = calculationEndDate;
                e_mc_mr_sacsvm.PayoffDate_ = payoffDate;

                int rangeCount = lowerRngList.Count;

                Excel_multi_rangeNDViewModel e_m_rngNDVM = new Excel_multi_rangeNDViewModel();

                for (int i = 0; i < rangeCount; i++)
                {
                    Range1DViewModel accRng1D = new Range1DViewModel();

                    accRng1D.LowerBound_ = lowerRngList[i].ToString();

                    DateTime effDate = this.InstVM_.Excel_interfaceViewModel_.Excel_issueInfoViewModel_.EffectiveDate_;

                    //this.addUnderlying(Excel_loaderViewModel.loadUnderInfo2(effDate, referenceUnderCodeList[i]));
                    this.addUnderlying(referenceUnderCodeList[i]);

                    Excel_choiceUnderlyingCalcIDViewModel choiceUnderCalcIDVM = new Excel_choiceUnderlyingCalcIDViewModel();

                    choiceUnderCalcIDVM.EventDate_ = payoffDate;

                    Excel_selectedUnderlyingViewModel selectedUnder = new Excel_selectedUnderlyingViewModel();
                    selectedUnder.Code_ = referenceUnderCodeList[i];
                    selectedUnder.NameTrans_ = new NameTrans(referenceUnderCodeList[i]);
                    selectedUnder.Checked_ = true;

                    choiceUnderCalcIDVM.Excel_selectedUnderlyingViewModel_.Add(selectedUnder);

                    accRng1D.UpperBound_ = upperRngList[i].ToString();

                    e_m_rngNDVM.Range1DViewModel_.Add(accRng1D);
                    e_m_rngNDVM.Excel_underlyingCalcIDViewModel_.Add(choiceUnderCalcIDVM);
                }

                e_mc_mr_sacsvm.Excel_multi_rangeNDViewModel_.Add(e_m_rngNDVM);

                Excel_constReturnCalViewModel e_crcvm = new Excel_constReturnCalViewModel();

                e_crcvm.ConstReturn_ = fixedRate.ToString();

                e_mc_mr_sacsvm.Excel_returnCalcInfoViewModel_.Add(e_crcvm);

                //e_mc_sacsvm.FixedRate_ = fixedRate.ToString();

                Excel_structuredBondViewModel e_sbvm = this.InstVM_.Excel_interfaceViewModel_ as Excel_structuredBondViewModel;

                e_sbvm.Excel_couponScheduleListViewModel_.Excel_couponScheduleViewModel_.Add(e_mc_mr_sacsvm);

                //this.instVM_.Excel_interfaceViewModel_ = e_sbvm;

                return "OK";
            }
            catch (Exception)
            {
                return "singleConditionDualRangAccrualFixedCoupon Add Fail";
            }
        }
        public void addSingleConditionDualRangAccrualFixedCoupon(DateTime calculationStartDate,
                                                                 DateTime calculationEndDate,
                                                                 DateTime payoffDate,
                                                                 List <double> lowerRngList,
                                                                 List <string> referenceUnderCodeList,
                                                                 List <double> upperRngList,
                                                                 double fixedRate)
        {
            Excel_multiCondi_multiRng_structuredAccrualCouponScheduleViewModel e_mc_mr_sacsvm
                = new Excel_multiCondi_multiRng_structuredAccrualCouponScheduleViewModel();

            e_mc_mr_sacsvm.EventDate_ = payoffDate;

            e_mc_mr_sacsvm.CalculationStartDate_ = calculationStartDate;
            e_mc_mr_sacsvm.CalculationEndDate_   = calculationEndDate;
            e_mc_mr_sacsvm.PayoffDate_           = payoffDate;

            int rangeCount = lowerRngList.Count;

            Excel_multi_rangeNDViewModel e_m_rngNDVM = new Excel_multi_rangeNDViewModel();

            for (int i = 0; i < rangeCount; i++)
            {
                Range1DViewModel accRng1D = new Range1DViewModel();

                accRng1D.LowerBound_ = lowerRngList[i].ToString();

                DateTime effDate = this.instVM_.Excel_interfaceViewModel_.Excel_issueInfoViewModel_.EffectiveDate_;

                //this.addUnderlying(Excel_loaderViewModel.loadUnderInfo2(effDate, referenceUnderCodeList[i]));
                this.addUnderlying(effDate, referenceUnderCodeList[i]);

                Excel_choiceUnderlyingCalcIDViewModel choiceUnderCalcIDVM = new Excel_choiceUnderlyingCalcIDViewModel();

                choiceUnderCalcIDVM.EventDate_ = payoffDate;

                Excel_selectedUnderlyingViewModel selectedUnder = new Excel_selectedUnderlyingViewModel();
                selectedUnder.Code_      = referenceUnderCodeList[i];
                selectedUnder.NameTrans_ = new NameTrans(referenceUnderCodeList[i]);
                selectedUnder.Checked_   = true;

                choiceUnderCalcIDVM.Excel_selectedUnderlyingViewModel_.Add(selectedUnder);

                accRng1D.UpperBound_ = upperRngList[i].ToString();

                e_m_rngNDVM.Range1DViewModel_.Add(accRng1D);
                e_m_rngNDVM.Excel_underlyingCalcIDViewModel_.Add(choiceUnderCalcIDVM);
            }

            e_mc_mr_sacsvm.Excel_multi_rangeNDViewModel_.Add(e_m_rngNDVM);

            Excel_constReturnCalViewModel e_crcvm = new Excel_constReturnCalViewModel();

            e_crcvm.ConstReturn_ = fixedRate.ToString();

            e_mc_mr_sacsvm.Excel_returnCalcInfoViewModel_.Add(e_crcvm);

            //e_mc_sacsvm.FixedRate_ = fixedRate.ToString();

            Excel_structuredBondViewModel e_sbvm = this.instVM_.Excel_interfaceViewModel_ as Excel_structuredBondViewModel;

            e_sbvm.Excel_couponScheduleListViewModel_.Excel_couponScheduleViewModel_.Add(e_mc_mr_sacsvm);

            //this.instVM_.Excel_interfaceViewModel_ = e_sbvm;
        }