Exemplo n.º 1
0
        private void HandleEvents(Core.Model.Member.User pendingUser, Button partyPendingRefuseButton, Button partyPendingAcceptButton)
        {
            partyPendingRefuseButton.Click += (s, e) =>
            {
                var alert = new AlertDialog.Builder(_context.Activity);

                alert.SetTitle("Refuse request");
                alert.SetMessage("Do you really want to delete this request?");

                alert.SetPositiveButton("Yes", async(sx, ex) =>
                {
                    var result = await _partyRepository.RefuseRequest(_party, pendingUser);
                    if (result)
                    {
                        await _context.NotifyDataChanged();
                    }
                });

                alert.SetNegativeButton("No", (sx, ex) => { });

                alert.Show();
            };

            partyPendingAcceptButton.Click += async(s, e) =>
            {
                var result = await _partyRepository.AcceptRequest(_party, pendingUser);

                if (result)
                {
                    await _context.NotifyDataChanged();
                }
            };
        }
 public Task <bool> RefuseRequest(Party party, Model.Member.User user)
 {
     return(_partyRepository.RefuseRequest(party, user));
 }