Пример #1
0
 /// <summary>
 ///     Called when [search button_ click].
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
 protected void OnSearchButton_Click(object sender, EventArgs e)
 {
     var userId = this.Users.UserIdSelected;
     Type = RapBattleType.Written;
     switch (this.BattleTypeField.Text)
     {
         case "Audio":
             Type = RapBattleType.Audio;
             break;
         case "Written":
             Type = RapBattleType.Written;
             break;
         case "Video":
             Type = RapBattleType.Video;
             break;
     }
     var userData = new UserData(userId);
     if (Type == RapBattleType.Written && userId != 0 && userId != 1)
     {
         BindUsersBattles(userData.GetUsersWrittenBattles().Cast<RapBattle>().ToList());
     }
     if (Type == RapBattleType.Audio && userId != 0 && userId != 1)
     {
         BindUsersBattles(userData.GetUsersAudioBattles().Cast<RapBattle>().ToList());
     }
 }
 /// <summary>
 ///     Handles the Load event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
 protected void Page_Load([NotNull] object sender, [NotNull] EventArgs e)
 {
     var userData = new UserData(UserId);
     this.AudioBattlesPager.PerPage = 10;
     this.AudioBattlesPager.GridView = this.MyAudioBattles;
     var audioBattles = userData.GetUsersAudioBattles().Cast<object>().ToList();
     this.AudioBattlesPager.ListDs = audioBattles;
     this.AudioBattlesCount = audioBattles.Count;
     if (this.AudioBattlesCount <= 0)
     {
         var noData = this.GetCore<CalloutBox>()
             .Create(BootstrapElementType.Info, this.Text("BATTLES", "NO_AUDIO"));
         this.NoAudioBattles.Controls.Add(noData);
     }
 }