Пример #1
0
        /// <summary>
        /// Add USGS data.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void addOwrd_Click(object sender, EventArgs e)
        {
            ImportOWRD dlg = new ImportOWRD();

            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string msg = "";
                try
                {
                    ShowAsBusy("connecting to OWRD web site");

                    foreach (string siteID in dlg.SiteIDs)
                    {
                        var ds = dlg.OwrdDataSet;
                        var s  = new Owrd.OwrdSeries(siteID, ds, dlg.IncludeProvisional);
                        s.Read(dlg.T1, dlg.T2);

                        if (s.Count == 0)
                        {
                            msg = "Error: no OWRD data was found";
                        }
                        else
                        {
                            msg = "read " + s.Count + " records";
                            DB.AddSeries(s, CurrentFolder);
                        }
                        if (s.Messages.Count > 1)
                        {
                            MessageBox.Show(s.Messages.ToString() + "\nCheck Tools->View Log for additional information.", "Duplicates Ignored", MessageBoxButtons.OK);
                        }
                    }
                }
                finally
                {
                    ShowAsReady(msg);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Add USGS data.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void addOwrd_Click(object sender, EventArgs e)
        {
            ImportOWRD dlg = new ImportOWRD();
            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {

                string msg = "";
                try
                {
                    ShowAsBusy("connecting to OWRD web site");

                    foreach (string siteID in dlg.SiteIDs)
                    {
                        var ds = dlg.OwrdDataSet;
                        var s = new Owrd.OwrdSeries(siteID, ds,dlg.IncludeProvisional);
                        s.Read(dlg.T1, dlg.T2);

                        if (s.Count == 0)
                        {
                            msg = "Error: no OWRD data was found";
                        }
                        else
                        {
                            msg = "read " + s.Count + " records";
                            DB.AddSeries(s, CurrentFolder);
                        }
                        if (s.Messages.Count > 1)
                        {
                            MessageBox.Show(s.Messages.ToString() + "\nCheck Tools->View Log for additional information.", "Duplicates Ignored", MessageBoxButtons.OK);
                        }
                    }

                }
                finally
                {
                    ShowAsReady(msg);
                }

            }
        }