Exemple #1
0
 public ActionResult Index(int? groupId)
 {
     if (groupId == null)
     {
         return RedirectToAction("Index", "User");
     }
     var service = new Service();
     User user = service.GetUser(User.Identity.Name);
     if (service.IsMemberOfGroup(user.UserID, groupId.Value))
     {
         GroupFeedViewModel model = service.GetGroupFeed(groupId.Value, user.UserID);
         if (Request.IsAjaxRequest())
         {
             return Json(RenderPartialViewToString("GroupFeed", model), JsonRequestBehavior.AllowGet);
         }
         SetUserFeedback();
         return View(model);
     }
     return RedirectToAction("Index", "User");
 }