private async void RemoveRole_Click(object sender, RoutedEventArgs e)
 {
     ProgressSpin.IsActive = true;
     if (RoleBox.SelectedIndex >= 0 && ConferencesBox.SelectedIndex >= 0 && LoginBox.Text.Length > 0)
     {
         if (await CheckAccountExistsAsync())
         {
             if (await authCore.DeleteRoleForConferenceAndAccountAsync(((ConferenceDTO)ConferencesBox.SelectedItem).ConferenceId, LoginBox.Text,
                                                                       ((RoleDTO)RoleBox.SelectedItem).RoleId))
             {
                 MessageBox.Show("Success");
             }
             else
             {
                 MessageBox.Show("Failure");
             }
         }
         else
         {
             MessageBox.Show("Account doesn't exists");
         }
     }
     else
     {
         MessageBox.Show("Not enough data");
     }
     ProgressSpin.IsActive = false;
 }
Exemple #2
0
        private async void RemoveRole_Click(object sender, RoutedEventArgs e)
        {
            ProgressSpin.IsActive = true;
            if (AccountRoleBox.SelectedIndex >= 0 && LoginBox.Text.Length > 0)
            {
                if (await CheckAccountExistsAsync())
                {
                    if (await authCore.DeleteRoleForConferenceAndAccountAsync(UserCredentials.Conference.ConferenceId, LoginBox.Text,
                                                                              int.Parse(AccountRoleBox.SelectedValue.ToString())))
                    {
                        await FillAccountRoleBox();

                        MessageBox.Show("Success");
                    }
                    else
                    {
                        MessageBox.Show("Failure");
                    }
                }
                else
                {
                    MessageBox.Show("Account doesn't exists");
                }
            }
            else
            {
                MessageBox.Show("Not enough data");
            }
            ProgressSpin.IsActive = false;
        }