private void AddUser_BUTTON_Click(object sender, EventArgs e) { if ((NewUsername_TEXTBOX.Text != "") && (NewPassword_TEXTBOX.Text != "")) { string spreadsheet = "blank"; if (ListOfSpreadsheets_LISTBOX.Items[0].ToString() != null) { spreadsheet = ListOfSpreadsheets_LISTBOX.Items[0].ToString(); } controller.AddNewUser(NewUsername_TEXTBOX.Text, NewPassword_TEXTBOX.Text, spreadsheet); currentUsers.Add(NewUsername_TEXTBOX.Text); ListOfUsers_LISTBOX.Items.Add(NewUsername_TEXTBOX.Text); NewUsername_TEXTBOX.Text = ""; NewPassword_TEXTBOX.Text = ""; } }
public void MenuAdmin(Account account) { AdminController _adminController = new AdminController(); Console.WriteLine("_____ Ngân hàng Spring Hero Bank _____"); Console.WriteLine("Chào mừng Admin " + account.Fullname + " quay trở lại. Vui lòng chọn thao tác."); Console.WriteLine("1. Danh sách người dùng."); Console.WriteLine("2. Danh sách lịch sử giao dịch."); Console.WriteLine("3. Tìm kiếm người dùng theo tên."); Console.WriteLine("4. Tìm kiếm người dùng theo số tài khoản."); Console.WriteLine("5. Tìm kiếm người dùng theo số điện thoại."); Console.WriteLine("6. Thêm người dùng mới."); Console.WriteLine("7. Khoá và mở tài khoản người dùng."); Console.WriteLine("8. Tìm kiếm lịch sử giao dịch theo số tài khoản."); Console.WriteLine("9. Thay đổi thông tin tài khoản."); Console.WriteLine("10. Thay đổi thông tin mật khẩu."); Console.WriteLine("11. Thoát."); Console.WriteLine("----------------------------"); Console.WriteLine("Nhập lựa chọn của bạn (Từ 1 đến 11):"); var choice = int.Parse(Console.ReadLine()); switch (choice) { case 1: Console.WriteLine("Danh sách người dùng."); _adminController.UserList(0, account); break; case 2: Console.WriteLine("Danh sách lịch sử giao dịch"); _adminController.TransactionHistory(0, account); break; case 3: Console.WriteLine("Tìm kiếm tài khoản theo tên"); _adminController.GetUserByName(account); break; case 4: Console.WriteLine("Tìm kiếm tài khoản theo AccountNumber"); _adminController.GetUserByAccountNumber(account); break; case 5: Console.WriteLine("Tìm kiếm tài khoản theo số điện thoại"); _adminController.GetUserByPhoneNumber(account); break; case 6: Console.WriteLine("Thêm tài khoản mơi"); _adminController.AddNewUser(account); break; case 7: Console.WriteLine("Khóa , Mở tài khoản"); _adminController.LockOpenAccount(account); break; case 8: Console.WriteLine("Search transaction history by account number"); _adminController.TransactionSearch(0, account); break; case 9: Console.WriteLine("Change the account information"); _adminController.ChangegInform(account); break; case 10: Console.WriteLine("Change password information"); _adminController.ChangePass(account); break; case 11: break; } }