Exemplo n.º 1
0
        public Message DoLogin(string employeeId, string password)
        {
            Message message;

            try
            {
                _dbContext.Open();
                var logininfo = _iLoginRepository.Get(employeeId);

                if (logininfo != null)
                {
                    string strDecPass = STLPasswordEncryptDecrypt.GetInstance().GetDecryptedUserPwd(logininfo.Password);
                    message = !String.Equals(password, strDecPass)
                        ? SetMessages.SetErrorMessage("Invalid user PIN or password")
                        : SetMessages.SetSuccessMessage("success");
                    if (!logininfo.IsActive)
                    {
                        message = SetMessages.SetErrorMessage("Either your account is in-active or locked");
                    }
                }
                else
                {
                    message = SetMessages.SetErrorMessage("Invalid Username or Password!!! Please Check...");
                }
            }
            catch (Exception ex)
            {
                message = SetMessages.SetErrorMessage("Exception Occurred!!!!!! Ex Message : " + ex.Message);
            }
            finally
            {
                _dbContext.Close();
            }

            return(message);
        }
Exemplo n.º 2
0
 public void AddMessage(String message)
 {
     SetMessages.Add(message);
 }