public void LoginUser() { if (ValidateFields()) { try { using (var client = new LismanService.LoginManagerClient()) { try { bool inSession = client.UserInSession(textField_user.Text); if (!inSession) { LismanService.Account account = client.LoginAccount(textField_user.Text, Encrypter.EncodePassword(passwordBox_password.Password)); AccessManagement(account); } else { MessageBox.Show("Hay una sesion iniciada, por favor cerrarla"); } } catch (Exception ex) { Console.WriteLine(ex.Message); Logger.log.Error("Function LoginUser, " + ex.Message); } } } catch (CommunicationException ex) { MessageBox.Show(Properties.Resources.server_connection_error); Logger.log.Error("Function LoginUser, " + ex.Message); } } }
public bool UserNameExists(String username) { try { using (var client = new LismanService.LoginManagerClient()) { return(client.UserNameExists(username)); } } catch (Exception ex) { Logger.log.Error("Function UserNameExists, " + ex); return(false); } }
public bool ExistsEmail(String emailAdress) { try { using (var client = new LismanService.LoginManagerClient()) { return(client.EmailExists(emailAdress)); } } catch (Exception ex) { Logger.log.Error("Function ExistEmail," + ex); return(false); } }