Ejemplo n.º 1
0
        private void LoadSummaryButton_Click(object sender, EventArgs e)
        {
            enableAll(false);
            TextBoxTraceListener _textBoxListener = new TextBoxTraceListener(ProgressReport);

            Trace.Listeners.Add(_textBoxListener);
            try
            {
                PairsEventInformation eventInformation = PairsGeneral.getEventInformation_(Utilities.compressText_(Summary.Text));
                if (!eventInformation.isACBLSummary)
                {
                    throw new Exception("The provide summary cannot be parsed as an ACBL Summary. Only ACBL Summaries can be uploaded using this application.");
                }
                string eventName = Utilities.makeIdentifier_("" + PairsEventName.SelectedItem);
                eventInformation.databaseFileName  = Path.Combine(Globals.m_rootDirectory, "Databases", eventName + ".mdb");
                eventInformation.webpagesDirectory = Path.Combine(Globals.m_rootDirectory, "Webpages", eventName);
                PairsDatabaseParameters databaseParameters = PairsGeneral.createDefaultDatabaseParameters();
                ProgressReport.Clear();
                if (!Steps.GetItemChecked(0))
                {
                    PairsSummaryToDatabase std = new PairsSummaryToDatabase(eventInformation);
                    std.loadSummaryIntoDatabase();
                    databaseParameters = std.getDatabaseParameters();
                    Steps.SetItemChecked(0, true);
                    Steps.Refresh();
                }
                else
                {
                    databaseParameters = PairsGeneral.createDefaultDatabaseParameters();
                    PairsGeneral.loadPairsDatabaseInformation(eventInformation.databaseFileName, out databaseParameters);
                }
                ProgressReport.Clear();
                if (!Steps.GetItemChecked(1))
                {
                    PairsDatabaseToWebpages dtw = new PairsDatabaseToWebpages(eventInformation, databaseParameters);
                    dtw.createWebpages_();
                    Steps.SetItemChecked(1, true);
                    Steps.Refresh();
                }
                ProgressReport.Clear();
                if (!Steps.GetItemChecked(2))
                {
                    String   sitename = m_configParameters.Configs["appSettings"].Get("GoogleSiteName");
                    String   username = "******";
                    String   password = "******";
                    SitesAPI sa       = new SitesAPI(sitename: sitename, username: username, password: password, replaceLinks: true, logHTTPTraffic: false);
                    sa.uploadDirectory(eventInformation.webpagesDirectory, m_configParameters.Configs["EventPageMapping"].Get("" + PairsEventName.SelectedItem));
                    Steps.SetItemChecked(2, true);
                    Steps.Refresh();
                }
                MessageBox.Show("Webpages created at " + GooglePage.Text);
                ProgressReport.Clear();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Exception : " + ex.Message + " was thrown. Please check your files and run again!!!");
            }
            Trace.Listeners.Remove(_textBoxListener);
            enableAll(true);
        }
Ejemplo n.º 2
0
 private void loadSummaryCompleted(bool success)
 {
     m_loadSummaryRunning = false;
     if (success)
     {
         m_databaseParameters = m_pairsSummaryToDatabase.getDatabaseParameters();
         createWebpages();
     }
 }
Ejemplo n.º 3
0
        private void loadSummaryIntoDatabase()
        {
            PairsSummaryToDatabase std = new PairsSummaryToDatabase(m_eventInformation);
            TextBoxTraceListener   _textBoxListener = new TextBoxTraceListener(CD_Status);

            Trace.Listeners.Add(_textBoxListener);
            try
            {
                std.loadSummaryIntoDatabase();
                m_databaseParameters = std.getDatabaseParameters();
                Trace.Listeners.Remove(_textBoxListener);
                CW_RootFolder.Text = m_eventInformation.webpagesDirectory;
                ControlTabs.SelectTab("CreateWebpagesTab");
            }
            catch (Exception e)
            {
                Trace.Listeners.Remove(_textBoxListener);
                throw e;
            }
        }