예제 #1
0
        public Guid?AddCity(string cityName, string countryShort)
        {
            if (string.IsNullOrEmpty(cityName))
            {
                throw new ArgumentException("City name doesn't exist");
            }

            using (var scope = _dbContextScope.Create())
            {
                return(_addressRepository.AddCity(cityName, countryShort));
            }
        }
예제 #2
0
 public ActionResult CreateCity(ViewAddress viewaddress, long stateId, long countryId, String returnTo)
 {
     try
     {
         if (ModelState.IsValid)
         {
             _addressRepository.AddCity(viewaddress, GetUserId());
             return(RedirectToAction("SelectCity", new { id = stateId, countryID = countryId, returnTo }));
         }
         return(View(viewaddress));
     }
     catch (Exception e)
     {
         ExceptionMessageToViewBag(e);
         return(View("Error"));
     }
 }