/// <summary> /// Hủy thách đấu club /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDelete(object sender, EventArgs e) { var btn = sender as Button; var parent = btn.BindingContext as ChallengeInfo; if (parent != null) { ChallengeAction.AcceptOrCancelChall(parent.ChallengeID, 0); model.Notifi.ListChallengesClub.Remove(parent); model.Notifi.count--; model.Notifi.notify = model.Notifi.count.ToString(); ChallengeAction.ListSendClub.Remove(parent.SenderID); NotifiDialog.Initiance().DialogChallengeDelete(); } }
public void GetClub(Club club) { clubTotal += 1; if (clubTotal == countClub) { // Hủy delegate Helper.Instance().GetClubAck -= GetClub; } if (Helper.Instance().MyAccount != null) { if (club.AdminID == Helper.Instance().MyAccount.Number_Id) { ChallengeAction.SetGetChallenge(Helper.Instance().MyAccount.Number_Id, club.ClubID); } } }
/// <summary> /// Chấp nhận thách đấu Club /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAccept(object sender, EventArgs e) { var btn = sender as Button; var parent = btn.BindingContext as ChallengeInfo; if (parent != null) { ChallengeAction.AcceptOrCancelChall(parent.ChallengeID, 1); model.Notifi.ListChallengesClub.Remove(parent); model.Notifi.count--; model.Notifi.notify = model.Notifi.count.ToString(); ChallengeAction.ListSendClub.Remove(parent.SenderID); UserDialogs.Instance.Toast("Đã chấp nhận thách đấu thành công"); //btn.IsVisible = false; } }
/// <summary> /// ấn hủy thách đấu /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Clicked_1(object sender, EventArgs e) { var btn = sender as Button; var parent = btn.BindingContext as ChallengeInfo; if (parent != null) { ChallengeAction.AcceptOrCancelChall(parent.ChallengeID, 0); model.Notifi.ListChallengesPer.Remove(parent); ChallengeAction.ListSendAcc.Remove(parent.SenderID); model.Notifi.count--; model.Notifi.notify = model.Notifi.count.ToString(); parent.IsVisibleAccept = false; parent.IsvisibleDelete = false; NotifiDialog.Initiance().DialogChallengeDelete(); } }
/// <summary> /// chấp nhận thách đấu cá nhân /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Clicked_1(object sender, EventArgs e) { var btn = sender as Button; //var parent = btn.BindingContext as ChallengeInfo; if (model != null) { ChallengeAction.AcceptOrCancelChall(model.Chall.ChallengeID, 1); if (model.IsPerson) { model.OnBackAccept(); } else { model.OnBackAcceptClub(); } } }
/// <summary> /// hủy thách đấu cá nhân /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Clicked(object sender, EventArgs e) { var btn = sender as Button; var parent = btn.BindingContext as ChallengeInfo; if (model != null && parent != null) { ChallengeAction.AcceptOrCancelChall(parent.ChallengeID, 0); if (model.IsPerson) { model.OnBackDelete(); } else { model.OnBackDeleteClub(); } } }
protected override void OnAppearing() { if (Application.Current.MainPage is MasterDetailPage masterDetailPage) { masterDetailPage.IsGestureEnabled = true; } else if (Application.Current.MainPage is NavigationPage navigationPage && navigationPage.CurrentPage is MasterDetailPage nestedMasterDetail) { nestedMasterDetail.IsGestureEnabled = true; } base.OnAppearing(); UpdateUnReadCount(AppChat.Helpers.Helper.Instiance().UnReadMsg); // Update lại số lượng tin nhắn chưa đọc AppChat.Helpers.Helper.Instiance().NotifyAcceptOrCancelAddFrd += ResponseAccept; isUpadate = true; if (model == null) { model = BindingContext as PersonalPageViewModel; } model.personalPage = this; if (!isFirst) { AppChat.Services.Service.Instiance().inPage = 1; Helper.Instance().objMyClub = this; Helper.Instance().GetMyClub(Helper.Instance().MyAccount.Number_Id); // Gửi yêu cầu lấy số lượng thách đấu ChallengeAction.SetGetChallenge(Helper.Instance().MyAccount.Number_Id, 0); // Đăng ký delegate để lấy danh sách ClubId // Helper.Instance().GetClubIdAck += GetClubId; // Helper.Instance().GetClubAck += GetClub; // Helper.Instance().CheckExistClubMyClubId(Helper.Instance().MyAccount.Number_Id); isFirst = true; } Device.StartTimer(TimeSpan.FromMilliseconds(1000), () => { UpdateNotify(); return(false); }); }