public ActionResult AcceptPlayerGrid(int page, string offerId) { Guid offerGuid; if (Guid.TryParse(offerId, out offerGuid)) { ViewData["Page"] = page; var app = new FacebookWebClient(); var fbContext = FacebookWebContext.Current; TennisUserModel existingUser = ModelUtils.GetTennisUsers(this.DB).Where(tu => tu.FacebookId == fbContext.UserId).FirstOrDefault(); var model = new AcceptPlayersDataGridModel(offerGuid, existingUser, this.DB); model.IsPostBack = false; return(Json ( new { PlayerGrid = RenderPartialViewToString("PlayerGrid", model) } )); } else { // BUGBUG: return error } return(Json("")); }
public ActionResult AcceptPlayerGrid(int page, string offerId) { Guid offerGuid; if (Guid.TryParse(offerId, out offerGuid)) { ViewData["Page"] = page; var app = new FacebookWebClient(); var fbContext = FacebookWebContext.Current; TennisUserModel existingUser = ModelUtils.GetTennisUsers(this.DB).Where(tu => tu.FacebookId == fbContext.UserId).FirstOrDefault(); var model = new AcceptPlayersDataGridModel(offerGuid, existingUser, this.DB); model.IsPostBack = false; return Json ( new { PlayerGrid = RenderPartialViewToString("PlayerGrid", model) } ); } else { // BUGBUG: return error } return Json(""); }