コード例 #1
0
        private bool LoadPortfolioBuildingObject()
        {
            // check root path
            if (!Directory.Exists(this.tbInputDir.Text.Trim()))
            {
                MessageBox.Show("Main Folder " + this.tbInputDir.Text.Trim() + " does not exist. Please enter a valid folder name.");
                return(false);
            }

            // check output path
            if (!Directory.Exists(this.tbInputDir.Text.Trim() + @"\Output Files"))
            {
                MessageBox.Show(@"Output Folder " + this.tbInputDir.Text.Trim() + @"\Output Files" + " does not exist. Please make sure this folder exists.");
                return(false);
            }

            try
            {
                tmp_portfolioBuildingFile = new PortfolioBuildingFile(m_rootFolder + @"\PortfolioBuilding.csv");
                tmp_portfolioBuildingFile.ReadFile();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error loading PortfolioBuilding.csv");
                return(false);
            }

            return(true);
        }
コード例 #2
0
        private void LoadInfoFromRootFolder()
        {
            // abandon changes if all is not well

            // Load Managers
            bool ableToLoad = true;

            if (!LoadManagerDataObjects())
            {
                ableToLoad = false;
            }
            if (!ableToLoad)
            {
                MessageBox.Show("Unable to initialize data from folder. Data displayed in UI does not reflect data in folder.");
                return;
            }


            // read existing portfolio building info
            if (!LoadPortfolioBuildingObject())
            {
                ableToLoad = false;
            }
            if (!ableToLoad)
            {
                MessageBox.Show("Unable to initialize data from folder. Data displayed in UI does not reflect data in folder.");
                return;
            }

            // save main
            Properties.Settings.Default.MainFolder = this.tbInputDir.Text.Trim();
            Properties.Settings.Default.Save();

            // managers
            // if all is well, assign temp file objects to globals
            // for display in UI
            m_aliasNamesFile        = tmp_aliasNamesFile;
            m_dbStatsFile           = tmp_dbStatsFile;
            m_citiStatsFile         = tmp_citiStatsFile;
            m_jlsStatsFile          = tmp_jlsStatsFile;
            m_stitchStatsFile       = tmp_stitchStatsFile;
            m_managerFile           = tmp_managerFile;
            m_stitchDatabaseFile    = tmp_stitchDatabaseFile;
            m_portfolioBuildingFile = tmp_portfolioBuildingFile;


            //CreateManagerObjects_FromAliasNamesAndStitch();
            //ShowManagerData();
            //ShowPortfolioBuilding();


            CreateManagerObjects_ManagerFile();

            ShowManagerData();
            ShowPortfolioBuilding();


            // benchmarks
            LoadBenchmarks();

            // manager
            string path = Properties.Settings.Default.MainFolder + @"\Output Files\Stitchdata Brads Format.csv";
        }