示例#1
0
        public IActionResult Delete(CountryModel model)
        {
            try
            {
                new CountryHandler().DeleteCountry(model.ToCountryEntity(), 0);
                TempData.Set <AlertModel>("Alert", new AlertModel($"{model.Name} is deleted successfully", AlertModel.AlertType.Success));
            }
            catch (Exception)
            {
                TempData.Set <AlertModel>("Alert", new AlertModel($"failed to delete {model.Name}", AlertModel.AlertType.Error));
            }

            return(RedirectToAction("Manage"));
        }