Beispiel #1
0
 void EditItem()
 {
     if (SelectedItem != null)
     {
         FeatDialog fd = new FeatDialog(_v.Context, SelectedItem);
         fd.FeatComplete += (sender, e) =>
         {
             SelectedItem.CopyFrom(e);
             Feat.UpdateCustomFeat(SelectedItem);
             RefreshPage();
         };
         fd.Show();
     }
 }
Beispiel #2
0
        public override async Task SaveAsync()
        {
            var city = EditItem;

            if (city.Id != 0)
            {
                var oldCity = await _cityService.GetById(city.Id);

                var newCity = _mapper.Map <CityViewModel, City>(city);
                await _cityService.Update(oldCity, newCity);

                SelectedItem.CopyFrom(EditItem);
            }
            else
            {
                var newCity = _mapper.Map <CityViewModel, City>(city);
                await _cityService.Create(newCity);

                Items.Add(city);
            }
        }
Beispiel #3
0
        public async override Task SaveAsync()
        {
            var language = EditItem;

            if (language.Id != 0)
            {
                var oldLanguage = await _languageService.GetById(language.Id);

                var newLanguage = _mapper.Map <LanguageViewModel, Language>(language);
                await _languageService.Update(oldLanguage, newLanguage);

                SelectedItem.CopyFrom(EditItem);
            }
            else
            {
                var newLanguage = _mapper.Map <LanguageViewModel, Language>(language);
                await _languageService.Create(newLanguage);

                Items.Add(language);
            }
        }
        public async override Task SaveAsync()
        {
            var country = EditItem;

            if (country.Id != 0)
            {
                var oldCountry = await _countryService.GetById(country.Id);

                var newCountry = _mapper.Map <CountryViewModel, Country>(country);
                await _countryService.Update(oldCountry, newCountry);

                SelectedItem.CopyFrom(EditItem);
            }
            else
            {
                var newCountry = _mapper.Map <CountryViewModel, Country>(country);
                await _countryService.Create(newCountry);

                Items.Add(country);
            }
        }