コード例 #1
0
        public ActionResult NewLocation(LocationModel location)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    LocationServices.CreateLocation(location);
                    return(RedirectToAction("LocationListing"));
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
                ModelState.AddModelError(String.Empty, Constants.ServerError);
            }

            ViewBag.Action = "NewLocation";
            return(View("LocationDetail", location));
        }