Пример #1
0
        // Slet Greenkeeper
        public async void DeleteGreenkeeper()
        {
            try
            {
                if (Mwm.SelectedWorker == null)
                {
                    throw new Exception();
                }
                PersistencyService.DeleteGreenkeeper(Mwm.SelectedWorker.GreenkeeperID);
                Mwm.GreenkeeperInfoCollection.Clear();
                await Mwm.GreenkeeperHandler.GetGreenkeeperCollection();

                ContentDialog Gcd = new ContentDialog();
                Gcd.Content           = "Greenkeeper er slettet";
                Gcd.PrimaryButtonText = "OK";
                await Gcd.ShowAsync();
            }
            catch (Exception)
            {
                ContentDialog Gcd = new ContentDialog();
                Gcd.Content           = "Vælg venligst en greenkeeper";
                Gcd.PrimaryButtonText = "OK";
                await Gcd.ShowAsync();
            }
        }