private void btnSingIn_Click(object sender, EventArgs e) { if (txtUsername.Text == "Enter Username!") { MessageBox.Show("Vui Lòng Kiểm Tra Lại Username!", "Quản Lý Thư Viện", MessageBoxButtons.OK, MessageBoxIcon.Error); txtUsername.Focus(); return; } if (txtPassword.Text == "Enter Password!") { MessageBox.Show("Vui Lòng Kiểm Tra Lại Password!", "Quản Lý Thư Viện", MessageBoxButtons.OK, MessageBoxIcon.Error); txtPassword.Focus(); return; } Account account = new Account() { Username = txtUsername.Text, Password = txtPassword.Text }; Account info = CheckLogin(account); if (info != null) { this.Hide(); Main main = new Main(); main.SendInforAccept(info); main.ShowDialog(); } else { Utils.MSG("Tài khoản hoặc mật khẩu sai??"); txtUsername.Focus(); } }
private void ViewSpellCasting_Click(object sender, RoutedEventArgs e) { App.ServiceProvider.GetService <SpellsViewDialogViewModel>().Class = (sender as Button).DataContext as CharacterClass; Main.ShowDialog(new SpellsViewDialog()); }
private void SetClass_Click(object sender, RoutedEventArgs e) { var level = ((sender as FrameworkElement).DataContext as CharacterLevel).Level; Main.ShowDialog(new ClassSelectorDialog(level)); }