예제 #1
0
        public SettingTabControler(MainWindowControler mainControler, MainWindow window) : base(window, mainControler)
        {
            DisplayItem = new SettingsDisplayItem();

            Window.Settings_MaintainLocationGrid.DataContext = DisplayItem;
            Window.Settings_SettingsGrid.DataContext         = DisplayItem;
        }
예제 #2
0
        internal static E_DBReturnCode SmartAddCountry(SettingsDisplayItem displayItem, out string errorMessage)
        {
            var            countryName                  = displayItem.CountryName;
            var            areaName                     = displayItem.AreaName;
            var            subAreaName                  = displayItem.SubAreaName;
            var            subjectLocationName          = displayItem.SubjectLocationName;
            double?        subjectLocationNameLatitude  = displayItem.SubjectLocationLatitude;
            double?        subjectLocationNameLongitude = displayItem.SubjectLocationLongitude;
            GPSCoordinates subjectLocationCoordinates   = new GPSCoordinates(subjectLocationNameLatitude, subjectLocationNameLongitude);

            // some consistency checks
            if (string.IsNullOrEmpty(countryName))
            {
                throw new Exception("Country must be set when adding a country (DataAccessAdapter::SmartAddCountry).\n");
            }
            if (!string.IsNullOrEmpty(subAreaName) && string.IsNullOrEmpty(areaName))
            {
                throw new Exception("Area name must be set if SubArea name is set (DataAccessAdapter::SmartAddCountry\n");
            }

            return(PersistenceManager.SmartAddCountry(countryName, areaName, subAreaName, subjectLocationName, subjectLocationCoordinates, out errorMessage));
        }