public virtual ActionResult Editar(TMovie model)
 {
     model.Update();
     TMovieCategory.SaveCategories(model);
     TempData["Alerta"] = new Alert("success", "Filme alterado com sucesso");
     return(RedirectToAction("Index"));
 }
 public virtual ActionResult Cadastrar(TMovie model)
 {
     try
     {
         model.Date = DateTime.Now.GetCurrent();
         model.Save();
         TMovieCategory.SaveCategories(model);
         TempData["Alerta"] = new Alert("success", "Filme cadastrado com sucesso");
         return(RedirectToAction("Index"));
     }
     catch (SimpleValidationException ex)
     {
         ViewBag.EnumFormatMovie = EnumHelper.ListAll <FormatMovie>().ToSelectList(x => x, x => x.Description());
         ViewBag.EnumTypeMovie   = EnumHelper.ListAll <TypeMovie>().ToSelectList(x => x, x => x.Description());
         return(HandleViewException(model, ex));
     }
 }