Beispiel #1
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            UpdateListCountry();
            CountryViewModel countryViewModel = listCountry.Find(x => x.Id == id);//db.CountryViewModels.Find(id);

            country.DeleteCountry(countryViewModel);
            //db.CountryViewModels.Remove(countryViewModel);
            return(RedirectToAction("Index"));
        }
        public IHttpActionResult DeleteCountry(int Id)
        {
            string result = "";

            if (ModelState.IsValid)
            {
                try
                {
                    string CreatedBy = GlobalFunction.getLoggedInUser(Request.Headers.GetValues("Token").First());
                    result = objCountryVM.DeleteCountry(Id, CreatedBy);
                }
                catch (Exception ex)
                {
                    ErrorHandlerClass.LogError(ex);
                    result = ex.Message;
                }
            }
            else
            {
                result = "Enter Valid Mandatory Fields";
            }
            return(Ok(new { results = result }));
        }