private void btnSubmit_Click(object sender, RoutedEventArgs e) { Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait; try { var Dto = Mapper.Map <LoginDto>(new LoginModel { USERNAME = txtUsername.Text, USER_ID = txtUsername.Text, PASSWORD = txtPassword.Password }); var GetData = _loginServices.VerificationLogin(Dto); if (GetData != null) { BaseController.CurrentUser = new Login(); BaseController.CurrentUser.FIRST_NAME = GetData.FIRST_NAME; BaseController.CurrentUser.LAST_NAME = GetData.LAST_NAME; BaseController.CurrentUser.PASSWORD = GetData.PASSWORD; BaseController.CurrentUser.STATUS = GetData.STATUS; BaseController.CurrentUser.USERNAME = GetData.USERNAME; BaseController.CurrentUser.USER_ID = GetData.USER_ID; BaseController.CurrentUser.EMAIL = GetData.EMAIL; BaseController.CurrentUser.LAST_ONLINE = GetData.LAST_ONLINE; BaseController.CurrentUser.POSITION = GetData.POSITION; if (GetData.ROLE_ID != null) { BaseController.CurrentUser.ROLE_ID = (int)GetData.ROLE_ID; } _loginServices.SetLastOnline(BaseController.CurrentUser.USER_ID); DialogResult = true; Close(); } lblError.Content = "Username atau password salah"; Mouse.OverrideCursor = null; } catch (Exception exp) { MessageBox.Show(Constans.SubmitMessage.Error, Constans.SubmitMessage.Error, MessageBoxButton.OK, MessageBoxImage.Error); LogError.WriteError(exp); Mouse.OverrideCursor = null; } }