private void AddAdmin() { new System.Threading.Thread(() => { Classes.AdminManager adminManager = new Classes.AdminManager(); if (adminManager.CanAddAdmin(GetUsername())) { SetLoadingState(true); if (adminManager.AddAdmin(GetUsername(), GetPassword())) { DisplayNotifyBox("Admin Added", GetUsername() + " has been successfully added", 2); } else { DisplayNotifyBox("ERROR", "Could not add " + GetUsername(), 2); } ClearForm(); } else { DisplayNotifyBox("Username Exists Already", "Cannot add " + GetUsername() + ", the username exits already", 2); } SetLoadingState(false); }).Start(); }
private void AddAdmin() { new System.Threading.Thread(() => { Classes.AdminManager adminManager = new Classes.AdminManager(); if( adminManager.CanAddAdmin(GetUsername()) ) { SetLoadingState(true); if (adminManager.AddAdmin(GetUsername(), GetPassword())) { DisplayNotifyBox("Admin Added", GetUsername() + " has been successfully added",2); } else { DisplayNotifyBox("ERROR", "Could not add " + GetUsername(),2); } ClearForm(); } else { DisplayNotifyBox("Username Exists Already", "Cannot add " + GetUsername() + ", the username exits already", 2); } SetLoadingState(false); }).Start(); }
private void AddAdmin() { new System.Threading.Thread(() => { Classes.AdminManager adminManager = new Classes.AdminManager(); if (adminManager.CanAddAdmin(GetUsername())) { Classes.Validation valid = new Classes.Validation(); SetLoadingState(true); if (valid.TextIsShorterThan(GetUsername(), 32)) { if (adminManager.AddAdmin(GetUsername(), GetPassword())) { DisplayNotifyBox("Admin Added", GetUsername() + " has been successfully added", 5); ClearForm(); } else { DisplayNotifyBox("ERROR", "Could not add " + GetUsername(), 5); } } else { DisplayNotifyBox("ERROR", "Please use a username with length shorter than 32 characters", 10); } } else { DisplayNotifyBox("Username Exists Already", "Cannot add " + GetUsername() + ", the username exits already", 5); } SetLoadingState(false); }).Start(); }
private void AddAdmin() { new System.Threading.Thread(() => { Classes.AdminManager adminManager = new Classes.AdminManager(); if( adminManager.CanAddAdmin(GetUsername()) ) { Classes.Validation valid = new Classes.Validation(); SetLoadingState(true); if (valid.TextIsShorterThan(GetUsername(), 32)) { if (adminManager.AddAdmin(GetUsername(), GetPassword())) { DisplayNotifyBox("Admin Added", GetUsername() + " has been successfully added", 5); ClearForm(); } else { DisplayNotifyBox("ERROR", "Could not add " + GetUsername(), 5); } } else { DisplayNotifyBox("ERROR", "Please use a username with length shorter than 32 characters", 10); } } else { DisplayNotifyBox("Username Exists Already", "Cannot add " + GetUsername() + ", the username exits already", 5); } SetLoadingState(false); }).Start(); }
private void DeleteAdmin() { new System.Threading.Thread(() => { Classes.AdminManager adminManager = new Classes.AdminManager(); if (adminManager.DeleteAdmin(GetSelectedAdmin())) { DisplayNotifyBox("Deleted", GetSelectedAdmin() + " has been deleted", 3); } else { DisplayNotifyBox("Not Deleted", GetSelectedAdmin() + " has not been deleted", 3); } }).Start(); }
private void EditPassword() { new System.Threading.Thread(() => { if (adminToEdit != "") { Classes.AdminManager adminManger = new Classes.AdminManager(); SetLoadingState(true); if (adminManger.EditPassword(adminToEdit, GetPassword())) { DisplayNotifybox(adminToEdit + " Modified", adminToEdit + " password changed"); } else { DisplayNotifybox("Could not edit " + adminToEdit, adminToEdit + " password was not changed"); } SetLoadingState(false); } }).Start(); }
private void DeleteAdmin() { new System.Threading.Thread(() => { Classes.AdminManager adminManager = new Classes.AdminManager(); if( adminManager.DeleteAdmin(GetSelectedAdmin()) ) { DisplayNotifyBox("Deleted", GetSelectedAdmin() + " has been deleted",3); } else { DisplayNotifyBox("Not Deleted", GetSelectedAdmin() + " has not been deleted",3); } }).Start(); }
private void EditUsername() { new System.Threading.Thread(() => { if( adminToEdit != "") { Classes.AdminManager adminManager = new Classes.AdminManager(); SetLoadingState(true); if (adminManager.EditUsername(adminToEdit, GetUsername())) { DisplayNotifybox(adminToEdit + "Modified", adminToEdit + " username changed to " + GetUsername()); } else { DisplayNotifybox("Could not edit " + adminToEdit, adminToEdit + " username was not changed"); } SetLoadingState(false); } }).Start(); }