public ActionResult CadastrarDepoimento(Depoimento depoimento, HttpPostedFileBase file) { try { depoimento.Data = DateTime.Now; facade.SalvarDepoimento(depoimento, file); return RedirectToAction("Index"); } catch { ViewData["Perfis"] = new SelectList(facade.PesquisarPerfil(null).ToList(), "Codigo", "Nome"); return View(depoimento); } }
public ActionResult AlterarDepoimento(Depoimento depoimento, HttpPostedFileBase file) { //TODO: na alteração a senha não é obrigatória (?) try { depoimento.Data = DateTime.Now; facade.SalvarDepoimento(depoimento, file); return RedirectToAction("Index"); } catch { ViewData["Perfis"] = new SelectList(facade.PesquisarPerfil(null).ToList(), "Codigo", "Nome"); return View(depoimento); } }