/// <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 ud = new UserData(UserId, this.PageContext.PageUserID); this.ProfileCommentsPager.Repeater = this.CommentsFeed; this.ProfileCommentsPager.Dt = ud.GetUsersProfileComments(); this.ProfileCommentsPager.PerPage = 20; this.PostEdit.PostBtn.Click += PostComment_Click; }
/// <summary> /// Gets the buddies. /// </summary> /// <returns></returns> public List<UserFriend> GetBuddies(int userId) { this._buddiesForUserId = userId; this._usersData = new UserData(userId); //validate if working changed the where implementation var buddiesList = LegacyDb.buddy_list(this._buddiesForUserId); return (from DataRow r in buddiesList.Rows select new UserFriend { UserId = Convert.ToInt32(r["UserID"]), UserName = r["Name"].ToString(), }).Where(x => this.IsBuddy(buddiesList, x.UserId)).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); } }