コード例 #1
0
        internal void HandleDelete()
        {
            var selectedItem = _listerWindow.LocationListView.SelectedItem as LocationListerDisplayItem;

            if (selectedItem is LocationListerDisplayItem displayItem)
            {
                if (DataAccess.DataAccessAdapter.DeleteShootingLocationById((displayItem.Tag as ShootingLocation).Id, out string errorMessagse) == DataAccess.PersistenceManager.E_DBReturnCode.error)
                {
                    ShowMessage(errorMessagse, E_MessageType.error);
                }
                else
                {
                    Mouse.OverrideCursor = Cursors.Wait;

                    AllDisplayItems.Remove(displayItem);
                    CurrentDisplayItem.Reset();

                    _locationTabControler.RefreshAllObjectsFromDB();
                    _locationTabControler.ReloadAndRefreshControls();

                    Mouse.OverrideCursor = null;

                    ShowMessage("Shooting location successfully deleted.", E_MessageType.success);
                }
            }
        }
コード例 #2
0
        public void ReloadAndRefreshControls()
        {
            // read from database
            RefreshAllCountriesFromDB();
            _settingControler.RefreshAllObjectsFromDB();
            _locationControler.RefreshAllObjectsFromDB(false); // use parameter to avoid double refreshing

            // refresh the country control
            RefreshCountryControls();
            _settingControler.ReloadAndRefreshControls();
            _locationControler.ReloadAndRefreshControls();
        }