public ActionResult EditBoutRequest(BoutList BoutChallenge)
        {
            try
            {
                bool execute = RDN.Library.Classes.League.BoutList.UpdateEvent(BoutChallenge);

                return Redirect(Url.Content("~/boutchallenge/view/all?u=" + SiteMessagesEnum.s));
            }
            catch (Exception exception)
            {
                ErrorDatabaseManager.AddException(exception, exception.GetType());
            }
            return Redirect(Url.Content("~/?u=" + SiteMessagesEnum.sww));

        }
예제 #2
0
 private static BoutList DisplayBoutList(DataModels.Bouts.BoutList BoutLists)
 {
     BoutList bl = new BoutList();
     bl.ChallengeId = BoutLists.ChallengeId;
     bl.CrowdSize = BoutLists.CrowdSize;
     bl.CurrentRanking = BoutLists.CurrentRanking;
     bl.StartDateOfEvent = BoutLists.DateOfEvent;
     bl.EndDateOfEvent = BoutLists.EndDateOfEvent.GetValueOrDefault();
     bl.EventInformation = BoutLists.EventInformation;
     bl.IsHangOverBoutOffered = BoutLists.IsHangOverBoutOffered;
     bl.IsOfferTravelStipend = BoutLists.IsOfferTravelStipend;
     bl.IsSkaterHousingOffered = BoutLists.IsSkaterHousingOffered;
     bl.IsStreamLive = BoutLists.IsStreamLive;
     bl.LeagueId = BoutLists.League.LeagueId;
     bl.LeagueName = BoutLists.League.Name;
     bl.Location = BoutLists.Location;
     bl.RuleSetId = BoutLists.RuleSetId;
     bl.RuleSetName =RDN.Portable.Util.Enums.EnumExt.ToFreindlyName((RuleSetsUsedEnum)BoutLists.RuleSetId);
     bl.TravelStipendAmount = BoutLists.TravelStipendAmount;
     bl.IsAwayGame = BoutLists.IsAwayGame;
     bl.DisplayToPublic = BoutLists.IsPublic;
     return bl;
 }
        public ActionResult BoutChallengeRequest(BoutList BoutChallenge)
        {
            try
            {
                var memId = RDN.Library.Classes.Account.User.GetMemberId();
                var league = MemberCache.GetLeagueOfMember(memId);
                var executeId = RDN.Library.Classes.League.BoutList.SaveBoutRequestList(league.LeagueId, BoutChallenge);

                var token = FacebookData.GetLatestAccessToken();

                //FacebookFactory.Initialize(token).GetPageAuthorization(ConfigurationManager.AppSettings["FacebookPageName"].ToString(), ConfigurationManager.AppSettings["FacebookPageId"].ToString())
                //    .PostToFanPage("Bout Challenge:" + BoutChallenge.LeagueName + "@" + BoutChallenge.StartDateOfEvent.Date + "\n" + RDN.Portable.Config.ServerConfig.WEBSITE_INTERNAL_DEFAULT_LOCATION + "/bout-challenge/view/" + executeId, "", "", "", "", "");

                FacebookFactory.Initialize(token).GetPageAuthorization(ConfigurationManager.AppSettings["FacebookPageName2"].ToString(), ConfigurationManager.AppSettings["FacebookPageId2"].ToString())
                        .PostToFanPage("Bout Challenge: " + league.Name + " @ " + BoutChallenge.StartDateOfEvent.Date.ToShortDateString() + "\n\n" + RDN.Portable.Config.ServerConfig.WEBSITE_DEFAULT_LOCATION + "/bout-challenge/view/" + executeId, "", "", "", "", "");
                try
                {

                    ///Twitter
                    TwitterFactory.Initialize(ConfigurationManager.AppSettings["TwitterConsumerKey"].ToString(), ConfigurationManager.AppSettings["TwitterConsumerSecret"].ToString(), ConfigurationManager.AppSettings["TwitterToken"].ToString(), ConfigurationManager.AppSettings["TwitterTokenSecret"].ToString())
                              .SendMessage("Bout Challenge: " + league.Name + " @ " + BoutChallenge.StartDateOfEvent.Date.ToShortDateString() + " #rollerderby " + RDN.Portable.Config.ServerConfig.WEBSITE_DEFAULT_LOCATION + "/bout-challenge/view/" + executeId);
                }
                catch (Exception exception)
                {
                    ErrorDatabaseManager.AddException(exception, exception.GetType());
                }

            }
            catch (Exception exception)
            {
                ErrorDatabaseManager.AddException(exception, exception.GetType());
            }
            return Redirect(Url.Content("~/boutchallenge/view/all?u=" + SiteMessagesEnum.sac));

        }