Esempio n. 1
0
        public static Excel_underlyingInfoViewModel loadUnderInfo(DateTime refDate, string nameTrans)
        {
            // nameTrans를 가지고 code를 찾음.

            MARKETDATA_SYMBOL_INFO_Table_DAO dao = new MARKETDATA_SYMBOL_INFO_Table_DAO();

            dao.NAME_KOR_ = (nameTrans.Trim()).ToUpper();

            dao.selectNAME_KOR(DataBaseConnectManager.ConnectionFactory("myDB"));

            // 코드를 찾아서 symbol을 로드함.

            // symbol을 통해서 type을 로드함

            // type을 통해서 symbolVM을 만들음

            string underType = dao.SYMBOL_TYPE_;

            Excel_marketDataSymbol e_mds = Excel_loaderViewModel.CreateSymbolViewModel(underType);

            e_mds.setFromDAO(dao);

            Excel_underlyingInfoViewModel e_uivm = e_mds.underlyingInfoVM();

            e_uivm.BasePrice_ = e_mds.dataLoad(Excel_loaderViewModel.availableMarketDataDate(refDate), e_mds.Symbol_);

            return(e_uivm);
        }
        public static Excel_marketDataSymbol getDefinedSymbol(string code)
        {
            MARKETDATA_SYMBOL_INFO_Table_DAO dao = new MARKETDATA_SYMBOL_INFO_Table_DAO();

            dao.SYMBOL_ = code.Trim();

            dao.select(DataBaseConnectManager.ConnectionFactory("myDB"));

            // 코드를 찾아서 symbol을 로드함.

            // symbol을 통해서 type을 로드함

            // type을 통해서 symbolVM을 만들음

            string underType = dao.SYMBOL_TYPE_;

            if (underType == null)
            {
                throw new Exception("symbol doesn't exist in symbolList : " + dao.SYMBOL_);
            }

            Excel_marketDataSymbol e_mds = Excel_loaderViewModel.CreateSymbolViewModel(underType);

            e_mds.setFromDAO(dao);

            return(e_mds);
        }
        private void ViewModelChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            this.viewModel_ = this.DataContext as Excel_marketDataSymbolViewModel;

            this.symbolDataListView_.ItemsSource = this.viewModel_.SymbolDAOList_;

            this.selectedSymbol_ = new Excel_marketDataSymbol();
            //this.bindingPanel_.DataContext = this.SelectedSymbol_;
            //this.ScheduleDataGrid_.ItemsSource = this.viewModel_.Excel_scheduleViewModel_;
        }
        private void ViewModelChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            this.viewModel_ = this.DataContext as Excel_marketDataSymbolViewModel;

            this.symbolDataListView_.ItemsSource = this.viewModel_.SymbolDAOList_;

            this.selectedSymbol_ = new Excel_marketDataSymbol();
            //this.bindingPanel_.DataContext = this.SelectedSymbol_;
            //this.ScheduleDataGrid_.ItemsSource = this.viewModel_.Excel_scheduleViewModel_;
        }
Esempio n. 5
0
        public static string loadMarketData(DateTime refDate, string symbol)
        {
            string load = "not loaded";

            string underType = Excel_marketDataSymbol.underType(symbol);

            Excel_marketDataSymbol e_mds = CreateSymbolViewModel(underType);

            load = e_mds.dataLoad(refDate, symbol);

            return(load);
        }
Esempio n. 6
0
 public void deleteDao(Excel_marketDataSymbol excel_marketDataSymbol)
 {
     try
     {
         excel_marketDataSymbol.buildDAO().delete(DataBaseConnectManager.ConnectionFactory("myDB"));
         //this.symbolDAOList_.Add(excel_marketDataSymbol.buildDAO());
     }
     catch (Exception)
     {
         OutputLogViewModel.addResult("symbol data db insert error : " + this.addedDao_.SYMBOL_);
     }
 }
        public YieldTermStructure yieldCurveLoadFromDB(DateTime refDate, string code)
        {
            string provider = Excel_marketDataSymbol.getProvider(code);

            IRCurveMarketDataLoader irLoader = IRCurveMarketDataLoader.CreateMarketDataLoader(provider);

            this.excel_irCurveDataViewModelList_.Clear();

            irLoader.load(refDate, code, this.excel_irCurveDataViewModelList_);

            return(this.buildQLNet_YieldTS(this.excel_irCurveDataViewModelList_[0]));

            //mro_irLoader.load(refDate, this.symbol_, this.excel_irCurveDataViewModelList_);


            //CURVE_DATA_Table_DAOManager daoM = new CURVE_DATA_Table_DAOManager();

            //daoM.CURVE_CODE_ = this.symbol_;
            //daoM.KeyColumn_ = this.symbol_;

            //// 날짜 select 해서

            //daoM.select(DataBaseConnectManager.ConnectionFactory("myDB"));

            //Excel_irCurveDataViewModel e_icdvm = new Excel_irCurveDataViewModel();

            //string refDateStr = refDate.ToString(StringFormat.DbDateFormat_);

            //e_icdvm.ReferenceDate_ = refDate;
            //e_icdvm.Curve_code_ = this.symbol_;
            //e_icdvm.Excel_rateDataViewModelList_.Clear();

            //foreach (CURVE_DATA_Table_DAO item in daoM.DAOList_)
            //{
            //    Excel_rateDataViewModel e_rdvm = new Excel_rateDataViewModel();

            //    e_rdvm.Tenor_ = item.TENOR_;
            //    e_rdvm.Value_ = item.VALUE_;
            //    e_rdvm.RateType_ = item.CURVE_TYPE_;

            //    e_icdvm.Excel_rateDataViewModelList_.Add(e_rdvm);

            //}
        }
        public static List <Excel_marketDataSymbol> getDefinedSymbolFiltering(string filter)
        {
            List <Excel_marketDataSymbol> symbols = new List <Excel_marketDataSymbol>();

            MARKETDATA_SYMBOL_INFO_Table_DAOManager daoM = new MARKETDATA_SYMBOL_INFO_Table_DAOManager();

            daoM.selectFiltering(DataBaseConnectManager.ConnectionFactory("myDB"), filter);

            foreach (var item in daoM.DAOList_)
            {
                Excel_marketDataSymbol e_mds = new Excel_marketDataSymbol();

                e_mds.setFromDAO(item);

                symbols.Add(e_mds);
            }

            return(symbols);
        }
Esempio n. 9
0
        public static Excel_underlyingInfoViewModel loadUnderInfo2(DateTime refDate, string nameTrans)
        {
            // nameTrans를 가지고 code를 찾음.

            try
            {
                MARKETDATA_SYMBOL_INFO_Table_DAO dao = new MARKETDATA_SYMBOL_INFO_Table_DAO();

                dao.SYMBOL_ = nameTrans.Trim();

                dao.select(DataBaseConnectManager.ConnectionFactory("myDB"));

                // 코드를 찾아서 symbol을 로드함.

                // symbol을 통해서 type을 로드함

                // type을 통해서 symbolVM을 만들음

                string underType = dao.SYMBOL_TYPE_;

                if (underType == null)
                {
                    throw new Exception("symbol doesn't exist in symbolList : " + dao.SYMBOL_);
                }

                Excel_marketDataSymbol e_mds = Excel_loaderViewModel.CreateSymbolViewModel(underType);

                e_mds.setFromDAO(dao);

                Excel_underlyingInfoViewModel e_uivm = e_mds.underlyingInfoVM();

                e_uivm.BasePrice_ = e_mds.dataLoad(Excel_loaderViewModel.availableMarketDataDate(refDate), e_mds.Symbol_);

                return(e_uivm);
            }
            catch (Exception)
            {
                throw;
            }
        }
        public static List <Excel_marketDataSymbol> getDefinedSymbolALL()
        {
            List <Excel_marketDataSymbol> symbols = new List <Excel_marketDataSymbol>();

            MARKETDATA_SYMBOL_INFO_Table_DAOManager daoM = new MARKETDATA_SYMBOL_INFO_Table_DAOManager();

            daoM.selectAll(DataBaseConnectManager.ConnectionFactory("myDB"));

            foreach (var item in daoM.DAOList_)
            {
                string underType = item.SYMBOL_TYPE_;

                //Excel_marketDataSymbol e_mds = Excel_loaderViewModel.CreateSymbolViewModel(underType);
                Excel_marketDataSymbol e_mds = new Excel_marketDataSymbol();

                e_mds.setFromDAO(item);

                symbols.Add(e_mds);
            }

            return(symbols);
        }
        public static List<Excel_marketDataSymbol> getDefinedSymbolFiltering(string filter)
        {
            List<Excel_marketDataSymbol> symbols = new List<Excel_marketDataSymbol>();

            MARKETDATA_SYMBOL_INFO_Table_DAOManager daoM = new MARKETDATA_SYMBOL_INFO_Table_DAOManager();

            daoM.selectFiltering(DataBaseConnectManager.ConnectionFactory("myDB"), filter);

            foreach (var item in daoM.DAOList_)
	        {
                Excel_marketDataSymbol e_mds = new Excel_marketDataSymbol();

                e_mds.setFromDAO(item);

                symbols.Add(e_mds);
	        }

            return symbols;


        }
        public static List<Excel_marketDataSymbol> getDefinedSymbolALL()
        {
            List<Excel_marketDataSymbol> symbols = new List<Excel_marketDataSymbol>();

            MARKETDATA_SYMBOL_INFO_Table_DAOManager daoM = new MARKETDATA_SYMBOL_INFO_Table_DAOManager();

            daoM.selectAll(DataBaseConnectManager.ConnectionFactory("myDB"));

            foreach (var item in daoM.DAOList_)
            {
                string underType = item.SYMBOL_TYPE_;

                //Excel_marketDataSymbol e_mds = Excel_loaderViewModel.CreateSymbolViewModel(underType);
                Excel_marketDataSymbol e_mds = new Excel_marketDataSymbol();

                e_mds.setFromDAO(item);

                symbols.Add(e_mds);
            }

            return symbols;

        }
 public void deleteDao(Excel_marketDataSymbol excel_marketDataSymbol)
 {
     try
     {
         excel_marketDataSymbol.buildDAO().delete(DataBaseConnectManager.ConnectionFactory("myDB"));
         //this.symbolDAOList_.Add(excel_marketDataSymbol.buildDAO());
     }
     catch (Exception)
     {
         OutputLogViewModel.addResult("symbol data db insert error : " + this.addedDao_.SYMBOL_);
     }
 }