Ejemplo n.º 1
0
        public ActionResult ResetPassword(string Email)
        {
            string pass, passencrypt, msg;
            var    message = "";
            var    subject = "";
            var    _client = (_clientService.GetClientByClientName(Email));

            if (_client != null)
            {
                if (_client.EmailID == Email)
                {
                    pass = _encryptionService.GenratePassword(7);

                    passencrypt = _encryptionService.HashPassword(pass);

                    _clientService.ResetClientPassword(_client.ClientID, passencrypt);

                    subject = "Reset Password";
                    msg     = @"   <p>Hi " + _client.FirstName + " " + _client.LastName + @",</p>
                            <p>A password reset request has been recieved.Your new password is: " + pass + @"</p>
                            <p>Thanks</p>";
                    _mailService.SendEmail(msg, Email, subject);
                    message = "Yes";
                }
                else
                {
                    message = "InvalidRegisteredEmail";
                }
            }
            else
            {
                message = "No";
            }
            return(Json(message, GlobalConst.Message.text_html));
        }
Ejemplo n.º 2
0
        public ActionResult ResetClientPassword(int ClientId)
        {
            string subject;
            string msg;
            Client _client = new Client();
            var    Client  = Mapper.Map <Client>(_clientService.GetClientByID(ClientId));

            _client.TempPassword = _encryptionService.GenratePassword(7);
            Client.Password      = _encryptionService.HashPassword(_client.TempPassword);
            subject = "Client Registration & New Password";
            msg     = @" <p>Hi " + Client.FirstName + " " + Client.LastName + @",</p>
                            <p>Your password is this : " + _client.TempPassword + @"</p>
                            <p>Thanks!</p>";
            _mailService.SendRandomPasswordEmail(msg, Client.EmailID, subject);
            _clientService.ResetClientPassword(ClientId, Client.Password);
            return(Json(GlobalConst.Message.ResetPassword));
        }