/// <summary> /// Handles the edit coins click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void editcoins_Click(object sender, RoutedEventArgs e) { var accid = await this.ShowInputAsync("Database edit coins", "Please type the account name to edit coins"); if (!String.IsNullOrWhiteSpace(accid)) { if (!DekaronCRUD.AccountExists(accid)) { await this.ShowMessageAsync("Account name is wrong or does not exist", "Please make sure you are finding for a valid acount"); } else { if (DekaronCRUD.GetCash(DekaronCRUD.PlayerNameByID(accid)) < 0) { await this.ShowMessageAsync("Account coins is less than 0", "Your account haven't visited the d-shop yet"); } else { DatabaseControl.Cash x = new DatabaseControl.Cash(); x.LoadCash(accid); x.ShowDialog(); } } } }
/// <summary> /// Handles the ban account click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void banacc_Click(object sender, RoutedEventArgs e) { var charname = await this.ShowInputAsync("Database account ban", "Please type the account name to ban"); if (!String.IsNullOrWhiteSpace(charname)) { if (!DekaronCRUD.AccountExists(charname)) { await this.ShowMessageAsync("Account name is wrong or does not exist", "Please make sure you are finding for a valid acount"); } else { var confirm = await this.ShowMessageAsync($"Click OK to ban {charname}", "Please click OK to make sure you want to ban this account", MessageDialogStyle.AffirmativeAndNegative); if (confirm == MessageDialogResult.Affirmative) { DekaronCRUD.BanPlayer(charname); await this.ShowMessageAsync("Account banned", $"Your account: {charname} was been sucessfully banned!"); } else { await this.ShowMessageAsync("Account not banned", "Your account wasn't banned!"); } } } }