コード例 #1
0
        private void SmartCard_OnSmartCardFailed(string errMsg, string notification)
        {
            // increase counter
            _smartCardFailed++;

            // exceeded max failed
            LayerWeb.ShowMessage("Authentication Failed", errMsg);
            if (_smartCardFailed > 3)
            {
                // Send Notification to duty officer
                LayerWeb.ShowMessage("Authentication Failed", "Unable to read your smart card.<br/>Please report to the Duty Officer.");
                Trinity.SignalR.Client.Instance.SendToAppDutyOfficers(null, notification, notification, EnumNotificationTypes.Error);

                // show message box to user
                //MessageBox.Show(message, "Authentication failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //_popupModel.Title = "Authorization Failed";
                //_popupModel.Message = message;
                //_popupModel.IsShowLoading = false;
                //_popupModel.IsShowOK = true;

                //LayerWeb.InvokeScript("showPopupModal", JsonConvert.SerializeObject(_popupModel));

                // reset counter
                _smartCardFailed = 0;

                // display failed on UI
                LayerWeb.RunScript("$('.status-text').css('color','#000').text('Please place your smart card on the reader.');");
                LayerWeb.RunScript("$('[status-authentication]').text('');");
                return;
            }

            // display failed on UI
            LayerWeb.RunScript("$('.status-text').css('color','#000').text('Please place your smart card on the reader.');");
            LayerWeb.RunScript("$('[status-authentication]').text('SmartCard Verification Failed : " + _smartCardFailed + "');");
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: tuga1975/SSK
 private void NRIC_OnNRICSucceeded()
 {
     // navigate to Supervisee page
     Trinity.BE.User currentUser = (Trinity.BE.User)Session.Instance[CommonConstants.USER_LOGIN];
     Trinity.BE.User supervisee  = currentUser;
     if (currentUser.Role == EnumUserRoles.DutyOfficer)
     {
         supervisee = (Trinity.BE.User)Session.Instance[CommonConstants.SUPERVISEE];
     }
     if (supervisee != null)
     {
         if (supervisee.Status == EnumUserStatuses.Blocked)
         {
             LayerWeb.ShowMessage("This supervisee was blocked");
         }
         else
         {
             Trinity.SignalR.Client.Instance.UserLoggedIn(supervisee.UserId);
             NavigateTo(NavigatorEnums.Supervisee);
         }
     }
 }
コード例 #3
0
ファイル: Main.cs プロジェクト: tuga1975/SSK
 private void EventCenter_OnNewEvent(object sender, EventInfo e)
 {
     if (e.Name == EventNames.ALERT_MESSAGE)
     {
         LayerWeb.InvokeScript("alertBookAppointment", e.Message);
     }
     else if (e.Name == EventNames.ABSENCE_LESS_THAN_3)
     {
         LayerWeb.InvokeScript("alertBookAppointment", e.Message);
     }
     else if (e.Name == EventNames.ABSENCE_MORE_THAN_3)
     {
         LayerWeb.InvokeScript("alertBookAppointment", e.Message);
     }
     else if (e.Name == EventNames.LOGIN_SUCCEEDED)
     {
         NavigateTo(NavigatorEnums.Authentication_NRIC);
     }
     else if (e.Name.Equals(EventNames.LOGIN_FAILED))
     {
         LayerWeb.ShowMessage("Login Failed", e.Message);
     }
 }
コード例 #4
0
ファイル: Main.cs プロジェクト: tuga1975/SSK
 private void SmartCard_OnSmartCardFailed(string errMsg, string notification)
 {
     // increase counter
     _smartCardFailed++;
     LayerWeb.ShowMessage("Authentication Failed", errMsg);
     // exceeded max failed
     if (_smartCardFailed > 3)
     {
         // Send Notification to duty officer
         LayerWeb.ShowMessage("Authentication Failed", "Unable to read your smart card.<br/>Please report to the Duty Officer.");
         Trinity.SignalR.Client.Instance.SendToAppDutyOfficers(null, notification, notification, EnumNotificationTypes.Error);
         _smartCardFailed = 0;
         // display failed on UI
         LayerWeb.RunScript("$('.status-text').css('color','#000').text('Please place your smart card on the reader.');");
         LayerWeb.RunScript("$('[status-authentication]').text('');");
         return;
     }
     else
     {
         // display failed on UI
         LayerWeb.RunScript("$('.status-text').css('color','#000').text('Please place your smart card on the reader.');");
         LayerWeb.RunScript("$('[status-authentication]').text('SmartCard Verification Failed : " + _smartCardFailed + "');");
     }
 }