コード例 #1
0
 public ActionResult Create(Street street)
 {
     if (_streetService.CreateStreet(street))
     {
         object item = new { value = street.StreetId, name = street.Name };
         return Json(item);
     }
     return View(street);
 }
コード例 #2
0
 public bool EditStreet(Street street)
 {
     try
     {
         _streetRepository.EditStreet(street);
         return true;
     }
     catch
     {
         return false;
     }
 }
コード例 #3
0
 public bool CreateStreet(Street street)
 {
     try
     {
         _streetRepository.CreateStreet(street);
         return true;
     }
     catch(Exception ex )
     {
         _validationDictionary.AddError("_FORM", ex.Message);
         return false;
     }
 }
コード例 #4
0
        public ActionResult Edit(Street street)
        {
            if (_streetService.EditStreet(street))
            {
                //todo: analize section

                //var streets = _streetService.ListStreets();
                //var resultView = View("Index", streets);
                //StringResult sr = new StringResult();
                //sr.ViewName = resultView.ViewName;
                //sr.MasterName = resultView.MasterName;
                //sr.ViewData = new ViewDataDictionary(streets);
                //sr.TempData = resultView.TempData;
                //// let them eat cake
                //sr.ExecuteResult(this.ControllerContext);
                //Session["DialogData"] = sr.Html.Replace("\"", "'");

                return RedirectToAction("Index", "Address");
            }
            return View(street);
        }