public ActionResult Edit(Teste teste, FormCollection collection) { teste.Nome = collection["Nome"]; try { var bll = new TesteBll(); bll.Save(teste); Success("Sucesso", "Salvo com sucesso!", true); return(RedirectToAction("/")); } catch (Exception ex) { Danger("Erro", string.Format(ex.Message), true); return(View(teste)); } }
public ActionResult Create(Teste teste, FormCollection collection) { try { var bll = new TesteBll(); bll.Save(teste); Success("Sucesso", "Salvo com sucesso!", true); return(RedirectToAction("Index")); } catch (Exception ex) { Danger("Erro", string.Format("Erro: " + ex.Message), true); return(View()); } }