public EmployeeLoginResponse Login(string userName, string password, string language) { EmployeeLoginResponse result = new EmployeeLoginResponse(); var personnel = _personnelService.GetByUserNameAndPassword(userName, password); if (personnel != null) { result.Personnel = personnel; result.IsValid = true; result.ErrorMessage = ""; } else { result.IsValid = false; result.ErrorMessage = "Kullanıcı veritabanında bulunamadı."; } return(result); }
public EmployeeLoginResponse Login(string userName, string password, string language) { EmployeeLoginResponse result = new EmployeeLoginResponse(); var employee = _employeeService.GetByUserNameAndPassword(userName, password); if (employee != null) { result.EmployeeWithDetail = employee; result.IsValid = true; result.ErrorMessage = ""; } else { result.IsValid = false; result.ErrorMessage = "Kullanıcı veritabanında bulunamadı."; } return(result); }
public EmployeeLoginResponse Login(string userName, string password) { EmployeeLoginResponse result = new EmployeeLoginResponse(); var personnel = _personnelService.GetByUserNameAndPassword(userName, password); if (personnel != null) { result.Personnel = personnel; result.IsValid = true; result.ErrorMessage = ""; } else { result.IsValid = false; result.ErrorMessage = "Personnel Not Found."; } return(result); }
private async void Button_Click(object sender, RoutedEventArgs e) { string username = usernameBox.Text.Trim(); string password = passwordBox.Password.Trim(); errorBlock.Visibility = Visibility.Hidden; if (username.Length > 0 && password.Length > 0) { this.Cursor = Cursors.Wait; Button button = (Button)sender; button.Cursor = Cursors.Wait; EmployeeLoginResponse response = await client.EmployeeLoginAsync(username, password); this.Cursor = Cursors.Arrow; button.Cursor = Cursors.Hand; if (response.Body.EmployeeLoginResult != 1) { errorBlock.Visibility = Visibility.Visible; errorBlock.Text = "Invalid login attempt"; } else { Application.Current.Resources["username"] = username; Application.Current.Resources["password"] = password; SubmitRequest submitRequest = new SubmitRequest(); submitRequest.Show(); this.Close(); } } else { errorBlock.Visibility = Visibility.Visible; errorBlock.Text = "Please enter credentials"; } }