public ActionResult Create(Street street) { if (_streetService.CreateStreet(street)) { object item = new { value = street.StreetId, name = street.Name }; return Json(item); } return View(street); }
public bool EditStreet(Street street) { try { _streetRepository.EditStreet(street); return true; } catch { return false; } }
public bool CreateStreet(Street street) { try { _streetRepository.CreateStreet(street); return true; } catch(Exception ex ) { _validationDictionary.AddError("_FORM", ex.Message); return false; } }
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); }