public int UpdateTown(TownModel townModel)
 {
     try
     {
         return(townRepository.UpdateTown(townModel));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 2
0
        public ActionResult Edit(Town town)
        {
            if (!IsTownNameValid(town.TownName))
            {
                return(RedirectToAction("Index"));
            }

            if (ModelState.IsValid)
            {
                townRepository.UpdateTown(town);
                townRepository.Save();

                return(RedirectToAction("Index"));
            }

            return(View(town));
        }
Esempio n. 3
0
        public async Task <TownDto> UpdateTown(TownDto townUpdateDto)
        {
            TownDto updatedTown = await _townRepository.UpdateTown(townUpdateDto);

            return(updatedTown);
        }