// GET: /Plano/PlanoCreate public ActionResult PlanoCreate() { Plano plano = new Plano(); PlanoViewModel planoVM = new PlanoViewModel(plano); return View(planoVM); }
// // GET: /Plano/PlanoDelete/5 public ActionResult PlanoDelete(int? id, bool? saveChangesError = false) { if (id == null) { //return new HttpStatusCodeResult(HttpStatusCode.BadRequest); //throw new InvalidOperationException("Something very bad happened while doing important stuff"); throw new Exception(); } if (saveChangesError.GetValueOrDefault()) { ViewBag.ErrorMessage = "Erro na exclusão. Tente novamente ou, se o problema persistir, entre em contato com o suporte."; } var plano = _planoAppService.Get(id ?? default(int)); if (plano == null) { //return HttpNotFound(); throw new Exception(); } PlanoViewModel planoVM = new PlanoViewModel(plano); return View(planoVM); }
// GET: /Plano/PlanoEdit/5 public ActionResult PlanoEdit(int? id) { if (id == null) { //return new HttpStatusCodeResult(HttpStatusCode.BadRequest); throw new Exception(); } var plano = _planoAppService.Get(id ?? default(int)); if (plano == null) { //return HttpNotFound(); throw new Exception(); } PlanoViewModel planoVM = new PlanoViewModel(plano); return View(planoVM); }