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()) ) { 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(); }