protected override void OnAction(ActionResult <UserLogin> result)
 {
     try
     {
         var userLoginActions = new UserLoginAction();
         result.Data = userLoginActions.AuthenticateUserLogin(this.DBConnectionString, this.Entity);
         if (result.Data != null)
         {
             this.ParentViewModel.UpdateUserLogin(result.Data);
             result.Result = ActionResultType.DataFetched;
             this.CloseChild();
         }
         else
         {
             StatusMessage             = "Login Failed";
             this.Entity.LoginPassword = string.Empty;
             result.Result             = ActionResultType.DataNotFound;
         }
     }
     catch (Exception exception)
     {
         NLogLogger.LogError(exception, TitleResources.Error, ExceptionResources.ExceptionOccured,
                             ExceptionResources.ExceptionOccuredLogDetail);
     }
 }
示例#2
0
 private void GetRefreshUserLoginCollection()
 {
     Task.Factory.StartNew(() =>
     {
         this.Entity = UserLoginAction.GetUserLoginList(this.DBConnectionString);
     });
 }
示例#3
0
 private void DeleteUserLogin(DialogResult dialogResult)
 {
     if (dialogResult == DialogResult.Ok)
     {
         Task.Factory.StartNew(() =>
         {
             UserLoginAction.DeleteUserLogins(this.DBConnectionString, this.Entity.InternalList.Where(x => x.IsSelected));
             GetRefreshUserLoginCollection();
             this.ParentViewModel.ShowProgressBar = false;
         });
     }
     else
     {
         this.ParentViewModel.ShowProgressBar = false;
     }
 }
        private void OnSaveCallLog()
        {
            var returnStatus = false;

            returnStatus = !IsInEditMode?UserLoginAction.AddUserLogin(this.DBConnectionString, this.Entity) : UserLoginAction.UpdateUserLogin(this.DBConnectionString, this.Entity);

            if (returnStatus)
            {
                this.Entity.ClearValues();

                if (RefreshUserLogin != null)
                {
                    this.RefreshUserLogin();
                }

                var messageDailog = new MessageDailog()
                {
                    Caption      = Resources.MessageResources.DataSavedSuccessfully,
                    DialogButton = DialogButton.Ok,
                    Title        = Resources.TitleResources.Information
                };

                MessengerInstance.Send(messageDailog);

                if (this.CloseWindow != null)
                {
                    this.CloseWindow();
                }
            }
            else
            {
                var messageDailog = new MessageDailog()
                {
                    Caption = Resources.MessageResources.DataSavedFailed, DialogButton = DialogButton.Ok, Title = Resources.TitleResources.Error
                };
                MessengerInstance.Send(messageDailog);
            }
        }
示例#5
0
 private void UserLogin(object _)
 {
     UserLoginAction?.Invoke();
 }