public ActionResult Paywalls()
 {
     try
     {
         NameValueCollection nameValueCollection = HttpUtility.ParseQueryString(Request.Url.Query);
         string u = nameValueCollection["u"];
         if (u == SiteMessagesEnum.s.ToString())
         {
             SiteMessage message = new SiteMessage();
             message.MessageType = SiteMessageType.Success;
             message.Message = "Successfully Added New Paywall.";
             this.AddMessage(message);
         }
         if (u == SiteMessagesEnum.su.ToString())
         {
             SiteMessage message = new SiteMessage();
             message.MessageType = SiteMessageType.Success;
             message.Message = "Successfully Updated Paywall.";
             this.AddMessage(message);
         }
         if (u == SiteMessagesEnum.sus.ToString())
         {
             SiteMessage message = new SiteMessage();
             message.MessageType = SiteMessageType.Success;
             message.Message = "Successfully Updated Settings.";
             this.AddMessage(message);
         }
         //DisplayPaywall pw = new DisplayPaywall();
         Paywall pw = new Paywall();
         Guid ownerId = RDN.Library.Classes.Account.User.GetMemberId();
         DisplayPaywall dpw = pw.GetPaywalls(ownerId);
         dpw.InternalReference = ownerId;
         if (!dpw.AcceptPaymentsViaPaypal && !dpw.AcceptPaymentsViaStripe)
         {
             SiteMessage message = new SiteMessage();
             message.MessageType = SiteMessageType.Info;
             message.Message = "Please setup a payment processor under Merchant Settings.";
             this.AddMessage(message);
         }
         dpw.ReturnUrl = Url.Encode(Request.RawUrl);
         return View(dpw);
     }
     catch (Exception exception)
     {
         ErrorDatabaseManager.AddException(exception, exception.GetType());
     }
     return Redirect(Url.Content("~/?u=" + SiteMessagesEnum.sww));
 }
 public ActionResult ViewTournament(string pid, string id)
 {
     try
     {
         NameValueCollection nameValueCollection = HttpUtility.ParseQueryString(Request.Url.Query);
         string u = nameValueCollection["u"];
         if (u == SiteMessagesEnum.s.ToString())
         {
             SiteMessage message = new SiteMessage();
             message.MessageType = SiteMessageType.Success;
             message.Message = "Successfully Updated Tournament.";
             this.AddMessage(message);
         }
         if (u == SiteMessagesEnum.sup.ToString())
         {
             SiteMessage message = new SiteMessage();
             message.MessageType = SiteMessageType.Success;
             message.Message = "Successfully Updated Logo.";
             this.AddMessage(message);
         }
         Guid memId = RDN.Library.Classes.Account.User.GetMemberId();
         var tourny = Tournament.GetTournamentToManage(new Guid(id), new Guid(pid));
         Paywall pw = new Paywall();
         var pws = pw.GetPaywalls(memId);
         Dictionary<int, string> countries = LocationFactory.GetCountriesDictionary();
         var counTemp = countries.Select(item => new SelectListItem { Text = item.Value, Value = item.Key.ToString() }).ToList();
         //ViewData["TournamentClass"] = tourny.TournamentClass.ToSelectListDropDown();
         //var list =    Enum.GetValues(typeof(TournamentTypeEnum)).Cast<TournamentTypeEnum>().ToList();
         MerchantGateway mg = new MerchantGateway();
         tourny.AvailableShops = mg.GetPublicMerchants();
         ViewBag.Countries = new SelectList(counTemp, "Value", "Text", tourny.CountryId);
         ViewBag.PayWalls = new SelectList(pws.Paywalls, "PaywallId", "DescriptionOfPaywall", tourny.PaywallId);
         return View(tourny);
     }
     catch (Exception exception)
     {
         ErrorDatabaseManager.AddException(exception, exception.GetType());
     }
     return Redirect(Url.Content("~/?u=" + SiteMessagesEnum.sww));
 }
        public ActionResult Manage(string pid, string id)
        {
            try
            {
                NameValueCollection nameValueCollection = HttpUtility.ParseQueryString(Request.Url.Query);
                string u = nameValueCollection["u"];
                if (u == SiteMessagesEnum.s.ToString())
                {
                    SiteMessage message = new SiteMessage();
                    message.MessageType = SiteMessageType.Success;
                    message.Message = "Successfully Updated Game.";
                    this.AddMessage(message);
                }
                var memId = RDN.Library.Classes.Account.User.GetMemberId();
                var game = GameManager.GetGameForManagement(new Guid(id), new Guid(pid), memId);
                Paywall pw = new Paywall();
                var pws = pw.GetPaywalls(memId);
                game.Paywalls = pws.Paywalls;
                MerchantGateway mg = new MerchantGateway();
                game.AvailableShops = mg.GetPublicMerchants();



                ViewBag.PayWalls = new SelectList(game.Paywalls, "PaywallId", "DescriptionOfPaywall", game.SelectedPaywall);
                if (game != null)
                    return View(game);
            }
            catch (Exception exception)
            {
                ErrorDatabaseManager.AddException(exception, GetType());
            }
            return Redirect(Url.Content("~/?u=" + SiteMessagesEnum.na));
        }