public override void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class) { FpmlSerializedCSharp.Excel_vanillaFloatingBond_subtype serial_Excel_vanillaFloatingBond_subtype = serial_Class as FpmlSerializedCSharp.Excel_vanillaFloatingBond_subtype; FpmlSerializedCSharp.Excel_vanillaFloatingBond_simple serial_Excel_vanillaFloatingBond_simple = serial_Excel_vanillaFloatingBond_subtype.Excel_vanillaFloatingBond_simple_; this.maturity_ = serial_Excel_vanillaFloatingBond_simple.Maturity_.ValueStr; this.maturityPeriod_ = serial_Excel_vanillaFloatingBond_simple.MaturityPeriod_.ValueStr; this.couponTenor_ = serial_Excel_vanillaFloatingBond_simple.CouponTenor_.ValueStr; this.couponTenorPeriod_ = serial_Excel_vanillaFloatingBond_simple.CouponTenorPeriod_.ValueStr; List <FpmlSerializedCSharp.Excel_vanillaFloatingBond_subSchedule> serial_excel_vanillaFloatingBond_subSchedule = serial_Excel_vanillaFloatingBond_simple.Excel_vanillaFloatingBond_subSchedule_; this.excel_vanillaFloatingBond_subScheduleViewModel_ = new ObservableCollection <Excel_vanillaFloatingBond_subScheduleViewModel>(); foreach (var item in serial_excel_vanillaFloatingBond_subSchedule) { string type = item.Excel_type_.ValueStr; Excel_vanillaFloatingBond_subScheduleViewModel viewModel = Excel_vanillaFloatingBond_subScheduleViewModel.CreateExcel_vanillaFloatingBond_subSchedule(type); viewModel.setFromSerial(item); this.excel_vanillaFloatingBond_subScheduleViewModel_.Add(viewModel); } this.gearing_ = serial_Excel_vanillaFloatingBond_simple.Gearing_.ValueStr; this.spread_ = serial_Excel_vanillaFloatingBond_simple.Spread_.ValueStr; this.settlementDays_ = serial_Excel_vanillaFloatingBond_simple.SettlementDays_.ValueStr; }
public void scheduleDataGenerate() { VanillaFloatingBond_TradeString vfb_ts = new VanillaFloatingBond_TradeString(); vfb_ts.parsingString(this.productString_); this.excel_vanillaFloatingBond_subScheduleViewModel_.Clear(); #region block //this.scheduleGeneratorVM_.InitialDate_ = this.effectiveDate_; ////QLNet.Period maturityPeriod = new Period(maturityTenor, tu); //QLNet.Period maturityPeriod = new Period(this.maturity_); //// Y 말고 M도 처리해야함 // 우선은 int로 하자 1.5Y이런거는 잠시 대기 //int maturityTenor = maturityPeriod.length(); //TimeUnit tu = maturityPeriod.units(); //TimeUnit.Years; //this.scheduleGeneratorVM_.EndDate_ = this.effectiveDate_.AddYears(maturityTenor); //QLNet.Period couponPeriod = new Period(this.couponTenor_); //new Period(couponTenor, tu); //// coupon //int couponTenor = couponPeriod.length(); //double couponMultiplier = Convert.ToDouble(couponPeriod.frequency());//1.0; //this.scheduleGeneratorVM_.Tenor_ = couponPeriod.ToShortString(); //int addingDays = 0; //this.scheduleGeneratorVM_.genDates(addingDays); //ObservableCollection<DateTime> eventDates = this.scheduleGeneratorVM_.Dates_; //int scheduleLength = eventDates.Count; //this.SettlementDays_ = Convert.ToInt32(tsm.SettlementDays_); #endregion for (int i = 0; i < this.scheduleGeneratorVM_.Dates_.Count - 1; i++) { Excel_vanillaFloatingBond_subScheduleViewModel data = new Excel_vanillaFloatingBond_subScheduleViewModel(); data.EventDate_ = new DateTime(); data.CalculationStartDate_ = this.scheduleGeneratorVM_.Dates_[i]; data.CalculationEndDate_ = this.scheduleGeneratorVM_.Dates_[i + 1]; data.FixingDate_ = this.scheduleGeneratorVM_.Dates_[i]; data.PaymentDate_ = this.scheduleGeneratorVM_.Dates_[i + 1].AddDays(Convert.ToDouble(this.scheduleGeneratorVM_.PaymentDays_)); data.Gearing_ = this.Gearing_; data.Spread_ = this.Spread_; this.excel_vanillaFloatingBond_subScheduleViewModel_.Add(data); } }
private Excel_vanillaFloatingCouponScheduleViewModel excel_vanillaSimpleVMBuild(Excel_vanillaFloatingBond_subScheduleViewModel excel_subScheduleVM) { Excel_vanillaFloatingCouponScheduleViewModel e_vfcsvm = new Excel_vanillaFloatingCouponScheduleViewModel(); e_vfcsvm.EventDate_ = excel_subScheduleVM.EventDate_; e_vfcsvm.CalculationStartDate_ = excel_subScheduleVM.CalculationStartDate_; e_vfcsvm.CalculationEndDate_ = excel_subScheduleVM.CalculationEndDate_; e_vfcsvm.PayoffDate_ = excel_subScheduleVM.PaymentDate_; e_vfcsvm.Gearing_ = excel_subScheduleVM.Gearing_; e_vfcsvm.Spread_ = excel_subScheduleVM.Spread_; e_vfcsvm.Excel_underlyingCalcInfoViewModel_ = this.excel_underlyingCalcInfoViewModel_; e_vfcsvm.Excel_underlyingCalcIDViewModel_ = new Excel_maximumUnderlyingCalcIDViewModel(); return(e_vfcsvm); }
private Excel_vanillaFloatingCouponScheduleViewModel excel_vanillaSimpleVMBuild(Excel_vanillaFloatingBond_subScheduleViewModel excel_subScheduleVM) { Excel_vanillaFloatingCouponScheduleViewModel e_vfcsvm = new Excel_vanillaFloatingCouponScheduleViewModel(); e_vfcsvm.EventDate_ = excel_subScheduleVM.EventDate_; e_vfcsvm.CalculationStartDate_ = excel_subScheduleVM.CalculationStartDate_; e_vfcsvm.CalculationEndDate_ = excel_subScheduleVM.CalculationEndDate_; e_vfcsvm.PayoffDate_ = excel_subScheduleVM.PaymentDate_; e_vfcsvm.Gearing_ = excel_subScheduleVM.Gearing_; e_vfcsvm.Spread_ = excel_subScheduleVM.Spread_; e_vfcsvm.Excel_underlyingCalcInfoViewModel_ = this.excel_underlyingCalcInfoViewModel_; e_vfcsvm.Excel_underlyingCalcIDViewModel_ = new Excel_maximumUnderlyingCalcIDViewModel(); return e_vfcsvm; }
public override void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class) { FpmlSerializedCSharp.Excel_vanillaFloatingBond_subtype serial_Excel_vanillaFloatingBond_subtype = serial_Class as FpmlSerializedCSharp.Excel_vanillaFloatingBond_subtype; FpmlSerializedCSharp.Excel_vanillaFloatingBond_simple serial_Excel_vanillaFloatingBond_simple = serial_Excel_vanillaFloatingBond_subtype.Excel_vanillaFloatingBond_simple_; this.maturity_ = serial_Excel_vanillaFloatingBond_simple.Maturity_.ValueStr; this.maturityPeriod_ = serial_Excel_vanillaFloatingBond_simple.MaturityPeriod_.ValueStr; this.couponTenor_ = serial_Excel_vanillaFloatingBond_simple.CouponTenor_.ValueStr; this.couponTenorPeriod_ = serial_Excel_vanillaFloatingBond_simple.CouponTenorPeriod_.ValueStr; List<FpmlSerializedCSharp.Excel_vanillaFloatingBond_subSchedule> serial_excel_vanillaFloatingBond_subSchedule = serial_Excel_vanillaFloatingBond_simple.Excel_vanillaFloatingBond_subSchedule_; this.excel_vanillaFloatingBond_subScheduleViewModel_ = new ObservableCollection<Excel_vanillaFloatingBond_subScheduleViewModel>(); foreach (var item in serial_excel_vanillaFloatingBond_subSchedule) { //string type = item.Excel_type_.ValueStr; Excel_vanillaFloatingBond_subScheduleViewModel viewModel = new Excel_vanillaFloatingBond_subScheduleViewModel(); viewModel.setFromSerial(item); this.excel_vanillaFloatingBond_subScheduleViewModel_.Add(viewModel); } this.gearing_ = serial_Excel_vanillaFloatingBond_simple.Gearing_.ValueStr; this.spread_ = serial_Excel_vanillaFloatingBond_simple.Spread_.ValueStr; this.settlementDays_ = serial_Excel_vanillaFloatingBond_simple.SettlementDays_.ValueStr; }