Esempio n. 1
0
 public ActionResult Options(OptionsViewModel model, IPrincipal principal)
 {
     if (!ModelState.IsValid)
     {
         return View(model);
     }
     var u = new UserUpdater(DocumentSession, _ => { });
     if (model.RadioChoiceWatched == "choice-episode")
     {
         u.SetEpisodeWatched(principal.Identity.Name, model.SourceId);
     }
     if (model.RadioChoiceWatched == "choice-season")
     {
         u.SetSeasonWatched(principal.Identity.Name, model.SourceId);
     }
     if (model.RadioChoiceWatched == "choice-custom")
     {
         var foo = model.RadioChoiceCustom.ToLower().Split('x');
         u.SetLastWatchedTo(principal.Identity.Name, model.SourceId, int.Parse(foo[0]), int.Parse(foo[1]));
     }
     return View("Index");
 }