/// <summary> /// Lọc ack cho từ ứng dụng /// </summary> /// <param name="msg"></param> public void AcceptAck(QHMessage msg) { App app = Application.Current as App; if (myAccept == 1) { if (myAccJoinClub != null) { Services.Service.Instiance().ClubModel.MyClub.Numbers.Add(myAccJoinClub.IdNumberID); Services.Service.Instiance().ClubModel.MyClub.Requests.Remove(myAccJoinClub.IdNumberID); Services.Service.Instiance().ClubModel.MyClub.ReloadReative(); app.ListAccInClub.Remove(myAccJoinClub); ListRequest.Remove(myAccJoinClub); myAccJoinClub = null; NotifiDialog.Initiance().DialogAccept(); } } else { if (myAccJoinClub != null) { Services.Service.Instiance().ClubModel.MyClub.Requests.Remove(myAccJoinClub.IdNumberID); //Services.Service.Instiance().ClubModel.MyClub.ReloadReative(); app.ListAccInClub.Remove(myAccJoinClub); ListRequest.Remove(myAccJoinClub); myAccJoinClub = null; } } }
public async void GetAccountAccept() { if (MyClub != null) { if (MyClub.Requests != null && MyClub.Requests.Count > 0) { var app = Application.Current as App; foreach (var item in MyClub.Requests) { var acc = await Helper.Instance().CheckExistAccount(item); if (acc.Number_Id > 0) { var accJoinClub = new AccJoinClub(); accJoinClub.Avatar = acc.Avatar_Uri; accJoinClub.FullName = acc.fullname; accJoinClub.IdNumberID = acc.Number_Id; accJoinClub.Level = "Hạng C"; accJoinClub.Facebat = "Mặt A - Hãng A"; accJoinClub.Blade = "Cốt A - Hãng A"; accJoinClub.Challenge = "pingpong.png"; accJoinClub.ClubID = MyClub.ClubID; accJoinClub.ClubCover = MyClub.ClubAvatarUri; ListRequest.Add(accJoinClub); } else { var accJoinClub = new AccJoinClub(); accJoinClub.IdNumberID = item; accJoinClub.Level = "Hạng C"; accJoinClub.Facebat = "Mặt A - Hãng A"; accJoinClub.Blade = "Cốt A - Hãng A"; accJoinClub.Challenge = "pingpong.png"; accJoinClub.ClubID = MyClub.ClubID; accJoinClub.ClubCover = MyClub.ClubAvatarUri; ListAccAwait.Add(accJoinClub); } } } } }
public void SendAccept(AccJoinClub accJoinClub, int accept) { QHMessage msg = new QHMessage((ushort)PingPongMsg.MSG_CLUB_JOIN_ACCEPT_REQ); if (accJoinClub != null) { //id của người được chấp nhận if (accJoinClub.IdNumberID > 0) { msg.SetAt((byte)MsgClubJoinAcceptReqArg.NumberID, new QHNumber(accJoinClub.IdNumberID)); } else { return; } //tên của người được chấp nhận if (!accJoinClub.FullName.Equals("")) { msg.SetAt((byte)MsgClubJoinAcceptReqArg.FullName, new QHString(accJoinClub.FullName)); } else { return; } //avatar của người được chấp nhận if (!accJoinClub.Avatar.Equals("")) { msg.SetAt((byte)MsgClubJoinAcceptReqArg.Avatar, new QHString(accJoinClub.Avatar)); } else { return; } //id của club chấp nhận if (accJoinClub.ClubID > 0) { msg.SetAt((byte)MsgClubJoinAcceptReqArg.ClubID, new QHNumber(accJoinClub.ClubID)); } else { return; } //cover của club chấp nhận yêu cầu if (!accJoinClub.ClubCover.Equals("")) { msg.SetAt((byte)MsgClubJoinAcceptReqArg.ClubCover, new QHString(accJoinClub.ClubCover)); } else { return; } msg.SetAt((byte)MsgClubJoinAcceptReqArg.AcceptTime, new QHString(DateTime.Now.ToLongDateString())); msg.SetAt((byte)MsgClubJoinAcceptReqArg.Accept, new QHNumber(accept)); if (!Services.Service.Instiance().SendMessage(msg)) { NotifiDialog.Initiance().DialogErrorInternter(); } else { myAccJoinClub = accJoinClub; myAccept = accept; } } }