private void SubmitButtonClicked(jQueryEvent e) { // return if anything is checking if (MySqlSettingChecking || SevenZipSettingChecking) { return; } if (!AllRequiredComponentLoaded) { ErrorModal.ShowError(Strings.Get("MissingRequiredComponent")); return; } if (!CanEnableZip && !CanEnableRar && !CanEnablePdf) { ErrorModal.ShowError(Strings.Get("NeedFileSupport")); return; } string username = jQuery.Select("#install-admin-username").GetValue(); string password = jQuery.Select("#install-admin-password").GetValue(); string password2 = jQuery.Select("#install-admin-password2").GetValue(); RegularExpression regex = new RegularExpression("[^a-zA-Z0-9]"); if (username == "" || regex.Test(username) || password.Length < 8 || password != password2) { ErrorModal.ShowError(Strings.Get("AdminUserSettingFailed")); return; } InstallRequest request = new InstallRequest(); request.mysqlServer = jQuery.Select("#install-mysql-server").GetValue(); request.mysqlPort = int.Parse(jQuery.Select("#install-mysql-port").GetValue(), 10); request.mysqlUser = jQuery.Select("#install-mysql-username").GetValue(); request.mysqlPassword = jQuery.Select("#install-mysql-password").GetValue(); request.mysqlDatabase = jQuery.Select("#install-mysql-database").GetValue(); request.sevenZipPath = jQuery.Select("#install-sevenzip-dll").GetValue(); request.zip = jQuery.Select("#install-zip-checkbox").Is(":checked"); request.rar = jQuery.Select("#install-rar-checkbox").Is(":checked"); request.pdf = jQuery.Select("#install-pdf-checkbox").Is(":checked"); request.admin = username; request.password = password; request.password2 = password2; new InstallingModal().SendInstallRequest(request); }
public void SendInstallRequest(InstallRequest request) { Request.Send(request, InstallRequestSuccess, InstallRequestFailed); }