Esempio n. 1
0
        public async Task <ActionResult> Delete(CountryIdModel Country)
        {
            //CountryModel model = await CountryService.Get(Country);
            await CountryService.Remove(Country);

            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        public async Task <CountryModel> GetCountry(CountryIdModel model)
        {
            KadabraCountry Country = await repository.FindOne(f => f.Id == model.Id);

            return(new CountryModel()
            {
                Id = Country.Id,
                ImageFlag = Country.ImageFlag,
                Name = Country.Name,
                CountryKey = Country.CountryKey
            });
        }
Esempio n. 3
0
        public async Task <CountryModel> GetCountry(CountryIdModel countryId)
        {
            HttpResponseMessage response = await apiClient.PostAsJsonAsync("Kadabra/Country/GetCountry", countryId);

            if (response.IsSuccessStatusCode)
            {
                return(await response.Content.ReadAsAsync <CountryModel>());
            }
            else
            {
                return(null);
            }
        }
Esempio n. 4
0
        public async Task <IHttpActionResult> DeleteCountry(CountryIdModel country)
        {
            if (!ModelState.IsValid)
            {
                return(InternalServerError());
            }
            try
            {
                await services.Remove(country);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }
Esempio n. 5
0
        public async Task <ActionResult> Edit(CountryIdModel Country)
        {
            CountryModel model = await CountryService.GetCountry(Country);

            return(View(model));
        }
Esempio n. 6
0
 public async Task <CountryModel> GetCountry(CountryIdModel model)
 {
     return(await services.GetCountry(model));
 }
Esempio n. 7
0
        public async Task Remove(CountryIdModel country)
        {
            HttpResponseMessage response = await apiClient.PostAsJsonAsync("Kadabra/Country/DeleteCountry", country);

            response.EnsureSuccessStatusCode();
        }
Esempio n. 8
0
        public async Task Remove(CountryIdModel Country)
        {
            await repository.Delete(t => t.Id == Country.Id);

            await repository.Save();
        }