private void ViewModelChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            this.viewModel_ = this.DataContext as Excel_noteInfoViewModel;
            this.viewModel_.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(viewModel_PropertyChanged);

            this.bindingPanel_.DataContext = this.viewModel_;

            this.currencyCombo_.DataContext = this.viewModel_.Currency_;
        }
        private void ViewModelChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            this.viewModel_ = this.DataContext as Excel_noteInfoViewModel;
            this.viewModel_.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(viewModel_PropertyChanged);
            
            this.bindingPanel_.DataContext = this.viewModel_;

            this.currencyCombo_.DataContext = this.viewModel_.Currency_;
        }
        public void makeIssueInfo(DateTime effectiveDate,DateTime maturityDate, double notional, string currency,string dayCounter)
        {
            Excel_noteInfoViewModel e_nvm = new Excel_noteInfoViewModel();

            e_nvm.EffectiveDate_ = effectiveDate;
            e_nvm.MaturityDate_ = maturityDate;
            e_nvm.Notional_ = notional.ToString();
            e_nvm.Currency_ = new CurrencyViewModel(currency,currency);
            //e_nvm.dayCounter
            
            this.instVM_.Excel_interfaceViewModel_.Excel_issueInfoViewModel_ = e_nvm;
        }
        public void makeIssueInfo(DateTime effectiveDate, DateTime maturityDate, double notional, string currency, string dayCounter)
        {
            Excel_noteInfoViewModel e_nvm = new Excel_noteInfoViewModel();

            e_nvm.EffectiveDate_ = effectiveDate;
            e_nvm.MaturityDate_  = maturityDate;
            e_nvm.Notional_      = notional.ToString();
            e_nvm.Currency_      = new CurrencyViewModel(currency, currency);
            //e_nvm.dayCounter

            this.instVM_.Excel_interfaceViewModel_.Excel_issueInfoViewModel_ = e_nvm;
        }
コード例 #5
0
        public string set_issueInfo(double notional,
                                    DateTime effDate,
                                    DateTime matDate,
                                    string currency,
                                    double notionalPayment,
                                    bool overwrite = true)
        {
            try
            {
                if (effDate == null || effDate.Year == 1899)
                    throw new Exception("effectiveDate empty");

                if (matDate == null || matDate.Year == 1899)
                    throw new Exception("maturityDate empty");

                if (effDate >= matDate)
                    throw new Exception("maturity must be later than effective");

                Excel_noteInfoViewModel e_noteInfo = new Excel_noteInfoViewModel();

                e_noteInfo.Notional_ = notional.ToString();
                e_noteInfo.EffectiveDate_ = effDate;
                e_noteInfo.MaturityDate_ = matDate;
                e_noteInfo.Currency_ = new CurrencyViewModel(currency, currency);
                e_noteInfo.IncludeNotionalPayment_ = notionalPayment.ToString();

                this.InstVM_.Excel_interfaceViewModel_.Excel_issueInfoViewModel_ = e_noteInfo;

                List<string> member = new List<string>() {"instType", "type", "notional", "effDate", "matDate", "currency"};
                List<string> value = new List<string>() { "hifive","issueInfo", notional.ToString(), StringConverter.xmlDateTimeToDateString(effDate), StringConverter.xmlDateTimeToDateString(matDate), currency.ToString() };

                e_noteInfo.VBA_description_ = this.vba_description(member, value);

                return "set complete";
            }
            catch (Exception e)
            {
                return "add fail : " + e.Message;
            }
        }