Ejemplo n.º 1
0
        private void addUnderlying(string underCodes)
        {
            string[] underCodeList = underCodes.Split(',', '|');

            foreach (var item2 in underCodeList)
            {
                bool existFlag = false;

                // ir part A
                foreach (var item in this.swapInterfaceVM_.Excel_swapLegViewModel_[0].getExcel_underlyingCalcInfoViewModel().Excel_underlyingInfoViewModel_)
                {
                    if (item2.Trim().ToUpper() == item.KrCode_.ToUpper())
                    {
                        existFlag = true;
                    }
                }

                // hifive part B
                foreach (var item in this.swapInterfaceVM_.Excel_swapLegViewModel_[1].getExcel_underlyingCalcInfoViewModel().Excel_underlyingInfoViewModel_)
                {
                    if (item2.Trim().ToUpper() == item.KrCode_.ToUpper())
                    {
                        existFlag = true;
                    }
                }

                if (!existFlag)
                {
                    Excel_underlyingInfoViewModel e_uivm = Excel_loaderViewModel.loadUnderInfoWithoutBasePrice(item2);

                    this.InstVM_.Excel_interfaceViewModel_.Excel_underlyingCalcInfoViewModel_.
                    Excel_underlyingInfoViewModel_.Add(e_uivm);

                    Excel_standardSwapParaViewModel e_sspvm = this.InstVM_.Excel_parameterViewModel_ as Excel_standardSwapParaViewModel;

                    Excel_underlyingInfo_paraViewModel e_ui_pvm = new Excel_underlyingInfo_paraViewModel();

                    e_ui_pvm.buildParaSetting(e_uivm);

                    e_sspvm.Excel_underlyingCalcInfo_paraViewModel_.Excel_underlyingInfo_paraViewModel_.Add(e_ui_pvm);

                    e_sspvm.Excel_underlyingCalcInfo_paraViewModel_.Excel_correlationInfo_paraViewModel_.addDiagonal(e_ui_pvm);
                }
            }

            return;
        }
Ejemplo n.º 2
0
        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);
            }
        }