Ejemplo n.º 1
0
        public void booking(string bookCode, Excel_instrument_structuredBondViewModel e_inst_sbvm)
        {
            //find book

            BookViewModel bvm = this.getBook(bookCode);

            bvm.booking(e_inst_sbvm);
        }
Ejemplo n.º 2
0
        public static Excel_instrumentViewModel CreateInstrument(string itemCode)
        {
            string[] sp = itemCode.Split('_');

            string typeNum = sp[1];

            if (typeNum == "700")
            {
                Excel_instrumentViewModel e_ivm = new Excel_instrument_hifiveViewModel();
                return(e_ivm);
            }
            else if (typeNum == "333")
            {
                Excel_instrumentViewModel e_ivm = new Excel_instrument_fixedBondViewModel();
                return(e_ivm);
            }
            else if (typeNum == "340")
            {
                Excel_instrumentViewModel e_ivm = new Excel_instrument_structuredBondViewModel();
                return(e_ivm);
            }
            else if (typeNum == "444")
            {
                Excel_instrumentViewModel e_ivm = new Excel_instrument_compositeOptionViewModel();
                return(e_ivm);
            }
            else if (typeNum == "450")
            {
                Excel_instrumentViewModel e_ivm = new Excel_instrument_multiAssetCompositeOptionViewModel();
                return(e_ivm);
            }
            else if (typeNum == "600")
            {
                Excel_instrumentViewModel e_ivm = new Excel_instrument_structuredSwapViewModel();
                return(e_ivm);
            }
            else if (typeNum == "700")
            {
                Excel_instrumentViewModel e_ivm = new Excel_instrument_hifiveViewModel();
                return(e_ivm);
            }

            else
            {
                Excel_instrumentViewModel e_ivm = new Excel_instrument_generalViewModel();
                return(e_ivm);
            }
        }
 private static void testStructuredBondCalculation()
 {
     Excel_instrument_structuredBondViewModel inst = new Excel_instrument_structuredBondViewModel();
     DateTime refDate = new DateTime(2014, 12, 10);
     inst.calculate("testInst", refDate);
 }
 public Make_instrument_structuredBond()
 {
     this.instVM_ = new Excel_instrument_structuredBondViewModel(true);
 }
        public string load_instrument(string itemCode)
        {
            try
            {
                Excel_instrumentViewModel e_i_hvm = MasterInformationViewModel.loadInstrumentVM(itemCode);

                //this.InstVM_ = new Excel_instrument_hifiveViewModel();
                this.InstVM_ = e_i_hvm as Excel_instrument_structuredBondViewModel;

                if (this.InstVM_ == null)
                    throw new Exception("instrument is not structuredBond type");

                this.InstVM_.loadInterfaceVMFromXml(XMLFileLoader.LoadInstrument(itemCode));

                //
                Excel_standardParaViewModel e_spvm = this.InstVM_.Excel_parameterViewModel_ as Excel_standardParaViewModel;
                //

                foreach (var item in InstVM_.Excel_interfaceViewModel_.Excel_underlyingCalcInfoViewModel_.Excel_underlyingInfoViewModel_)
                {
                    Excel_underlyingInfo_paraViewModel e_u_pvm = new Excel_underlyingInfo_paraViewModel();

                    e_u_pvm.buildParaSetting(item);

                    e_spvm.Excel_underlyingCalcInfo_paraViewModel_.Excel_underlyingInfo_paraViewModel_.Add(e_u_pvm);
                    e_spvm.Excel_underlyingCalcInfo_paraViewModel_.Excel_correlationInfo_paraViewModel_.addDiagonal(e_u_pvm);

                }

                return "load complete";
            }
            catch (Exception e)
            {
                return "load err : " + e.Message;
            }
        }
        public void booking(string bookCode, Excel_instrument_structuredBondViewModel e_inst_sbvm)
        {
            //find book

            BookViewModel bvm = this.getBook(bookCode);

            bvm.booking(e_inst_sbvm);

        }
        public static Excel_instrumentViewModel CreateInstrument(string itemCode)
        {
            string[] sp = itemCode.Split('_');

            string typeNum = sp[1];

            if (typeNum == "700")
            {
                Excel_instrumentViewModel e_ivm = new Excel_instrument_hifiveViewModel();
                return e_ivm;
            }
            else if (typeNum == "333")
            {
                Excel_instrumentViewModel e_ivm = new Excel_instrument_fixedBondViewModel();
                return e_ivm;
            }
            else if (typeNum == "340")
            {
                Excel_instrumentViewModel e_ivm = new Excel_instrument_structuredBondViewModel();
                return e_ivm;
            }
            else if (typeNum == "444")  
            {
                Excel_instrumentViewModel e_ivm = new Excel_instrument_compositeOptionViewModel();
                return e_ivm;
            }
            else if (typeNum == "450")
            {
                Excel_instrumentViewModel e_ivm = new Excel_instrument_multiAssetCompositeOptionViewModel();
                return e_ivm;
            
            }
            else if (typeNum == "600")
            {
                Excel_instrumentViewModel e_ivm = new Excel_instrument_structuredSwapViewModel();
                return e_ivm;
            }
            else if (typeNum == "700")
            {
                Excel_instrumentViewModel e_ivm = new Excel_instrument_hifiveViewModel();
                return e_ivm;
            }

            else
            {
                Excel_instrumentViewModel e_ivm = new Excel_instrument_generalViewModel();
                return e_ivm;
            }

        }
 public Make_instrument_structuredBond()
 {
     this.instVM_ = new Excel_instrument_structuredBondViewModel(true);
 }