コード例 #1
0
        private void btnAddIdMapEntry_Click(object sender, EventArgs e)
        {
            CaptureSummaInfo();

            NewIdMapEntry newEntryForm = new NewIdMapEntry();

            newEntryForm.ShowDialog();

            if (newEntryForm.DialogResult == DialogResult.OK)
            {
                try {
                    int siteId  = Int32.Parse(newEntryForm.SiteId);
                    int summaId = Int32.Parse(newEntryForm.SummaId);

                    _summaIdMap.AddMapEntry(siteId, summaId);
                }
                catch (ArgumentException ae) {
                    new ErrorHandler(ae.ToString()).ShowDialog();
                }
                catch (FormatException fe) {
                    new ErrorHandler(fe.ToString()).ShowDialog();
                }
            }
            ShowAllSettings();
        }
コード例 #2
0
        private void LoadSummaIdMapSettings()
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(Path.Combine(_path, SUMMA_ID_MAP_FILENAME));
            _summaIdMap = new SummaIdMapDTO();

            XmlNodeList entries = null;

            try {
                entries = doc.DocumentElement.SelectNodes("/SummaSiteIdMap/SummaIdMapEntry");

                foreach (XmlNode entry in entries)
                {
                    _summaIdMap.AddMapEntry(
                        Int32.Parse(entry.Attributes["siteId"].Value),
                        Int32.Parse(entry.Attributes["summaSiteId"].Value)
                        );
                }
            }
            catch (XPathException xpe) {
                new ErrorHandler(xpe.ToString()).ShowDialog();
            }
            catch (FormatException fe) {
                new ErrorHandler(fe.ToString()).ShowDialog();
            }
        }
コード例 #3
0
 private void SetSummaIdMapDefaults()
 {
     _summaIdMap = new SummaIdMapDTO();
     _summaIdMap.AddMapEntry(1, 1);
 }