private async void ExecuteNewUserCommand(object obj) { this.DemandeurIdentite.Id = Guid.NewGuid().ToString(); var loader = await MaterialDialog.Instance.LoadingDialogAsync("Veuillez patienter svp ..."); try { if (PwdConfirm.Trim() != Pwd.Trim()) { throw new Exception("Mot de passe saisi ne correspond pas"); } if (IsError) { throw new Exception("Verifiez vos données"); } this.DemandeurIdentite.Password = Pwd.HashPassword(); await RestService.For <IBackendService>(Configurations.ServerConfig.Host).Inscription(JsonConvert.SerializeObject(this.DemandeurIdentite)); await loader.DismissAsync(); await MaterialDialog.Instance.AlertAsync($"Un e-mail de verification a été envoyé à {this.DemandeurIdentite.Email}"); } catch (Exception e) { await loader.DismissAsync(); await MaterialDialog.Instance.SnackbarAsync("Error: " + e.Message, 3000, Configurations.MaterialConfig.MaterialSnackbarConfiguration); } }
private void DbConnectForm_FormClosing(object sender, FormClosingEventArgs e) { if (this.DialogResult == DialogResult.OK) { bool rinf; rinf = this.DbOpen();// OKならINIファイルを更新して抜ける if (rinf != true) { //NGだからダイアログを閉じない e.Cancel = true; } else { //OKだからINIファイル更新 aIniFile.WriteString("DataBase", "DSN", Dsn.Trim()); aIniFile.WriteString("DataBase", "UID", Uid.Trim()); aIniFile.WriteString("DataBase", "PWD", Pwd.Trim()); } } }