Пример #1
0
        public IActionResult CreateMovies(MoviesCreateRequest moviesRequest)
        {
            Movies movies = new Movies()
            {
                MoviesID    = 0,
                Name        = moviesRequest.Name,
                Director    = moviesRequest.Director,
                Genre       = moviesRequest.Genre,
                MovieLength = moviesRequest.MovieLength,
                Rating      = moviesRequest.Rating,
                ReleaseYear = moviesRequest.ReleaseYear,
                Title       = moviesRequest.Title
            };

            _unitOfWorkEntityFramework.MoviesCommand.Add(movies);
            var result = _unitOfWorkEntityFramework.Commit();

            if (result)
            {
                return(Ok(new OkResponse("Movies Added Successfully !")));
            }
            else
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, "Something Went Wrong"));
            }
        }
Пример #2
0
        public IActionResult Create(CreateMenuCategoryViewModel menuCategory)
        {
            menuCategory.ListofRoles = _roleQueries.ListofRoles();

            if (ModelState.IsValid)
            {
                if (_menuCategoryQueries.CheckCategoryNameExists(menuCategory.MenuCategoryName, menuCategory.RoleId))
                {
                    ModelState.AddModelError("", "Menu Category Already Exists!");
                    return(View(menuCategory));
                }
                else
                {
                    var mappedobject = _mapper.Map <MenuCategory>(menuCategory);
                    mappedobject.CreatedOn = DateTime.Now;
                    mappedobject.CreatedBy = Convert.ToInt32(HttpContext.Session.GetString(AllSessionKeys.UserId));
                    _unitOfWorkEntityFramework.MenuCategoryCommand.Add(mappedobject);
                    var result = _unitOfWorkEntityFramework.Commit();

                    if (result)
                    {
                        _notificationService.SuccessNotification("Message",
                                                                 "The Menu Category was added Successfully!");
                        return(RedirectToAction("Index", "MenuCategory"));
                    }
                }
            }

            return(View(menuCategory));
        }
        public IActionResult Create(RoleMasterViewModel roleMasterVm)
        {
            if (ModelState.IsValid)
            {
                RoleMaster roleMaster = new RoleMaster()
                {
                    RoleName  = roleMasterVm.RoleName,
                    Status    = roleMasterVm.Status,
                    CreatedOn = DateTime.Now,
                    RoleId    = 0,
                    CreatedBy = Convert.ToInt32(HttpContext.Session.GetString(AllSessionKeys.UserId))
                };

                _unitOfWorkEntityFramework.RoleCommand.Add(roleMaster);
                var result = _unitOfWorkEntityFramework.Commit();

                if (result)
                {
                    _notificationService.SuccessNotification("Message", "The Role was added successfully!");
                    return(RedirectToAction("Index", "RoleMaster"));
                }
            }

            return(View(roleMasterVm));
        }
        public IActionResult MyProfile(EditUserProfileViewModel editUser)
        {
            if (ModelState.IsValid)
            {
                var userprofile =
                    _userMasterQueries.GetProfileForEditByUserId(
                        Convert.ToInt64(HttpContext.Session.GetString(AllSessionKeys.UserId)));

                if (!string.Equals(userprofile.EmailId, editUser.EmailId, StringComparison.OrdinalIgnoreCase))
                {
                    if (_userMasterQueries.CheckEmailExists(editUser.EmailId))
                    {
                        ModelState.AddModelError("", "Entered EmailId Already Exists");
                        return(View(editUser));
                    }
                }

                if (!string.Equals(userprofile.MobileNo, editUser.MobileNo, StringComparison.OrdinalIgnoreCase))
                {
                    if (_userMasterQueries.CheckMobileNoExists(editUser.MobileNo))
                    {
                        ModelState.AddModelError("", "Entered MobileNo Already Exists");
                        return(View(editUser));
                    }
                }

                var userMaster = _userMasterQueries.GetUserDetailsbyUserId(editUser.UserId);
                userMaster.ModifiedOn = DateTime.Now;
                userMaster.ModifiedBy = Convert.ToInt32(HttpContext.Session.GetString(AllSessionKeys.UserId));
                userMaster.LastName   = editUser.LastName;
                userMaster.FirstName  = editUser.FirstName;
                userMaster.MobileNo   = editUser.MobileNo;
                userMaster.EmailId    = editUser.EmailId;
                userMaster.Gender     = editUser.Gender;

                _unitOfWorkEntityFramework.UserMasterCommand.Update(userMaster);
                var result = _unitOfWorkEntityFramework.Commit();

                if (result)
                {
                    _notificationService.SuccessNotification("Message", "User Details Updated Successfully !");
                    return(RedirectToAction("MyProfile"));
                }
                else
                {
                    _notificationService.DangerNotification("Message", "Something went wrong Please Try Once Again !");
                    return(View(editUser));
                }
            }

            return(View(editUser));
        }
Пример #5
0
        public IActionResult ForgotPassword(ForgotPasswordViewModel forgotPasswordViewModel)
        {
            if (!_userMasterQueries.CheckUserExists(forgotPasswordViewModel.UserName))
            {
                ModelState.AddModelError("", "Entered Username or Password is Invalid");
            }
            else
            {
                var userdetails = _userMasterQueries.GetUserbyUserName(forgotPasswordViewModel.UserName);
                var token       = HashHelper.CreateHashSHA256((GenerateRandomNumbers.GenerateRandomDigitCode(6)));
                var body        = _emailSender.CreateVerificationEmail(userdetails, token);
                _unitOfWorkEntityFramework.VerificationCommand.SendResetVerificationToken(userdetails.UserId, token);
                _unitOfWorkEntityFramework.Commit();
                MessageTemplate messageTemplate = new MessageTemplate()
                {
                    ToAddress = userdetails.EmailId,
                    Subject   = "Welcome to Frapper",
                    Body      = body
                };

                _emailSender.SendMailusingSmtp(messageTemplate);

                TempData["ForgotPasswordMessage"] = "An email has been sent to the address you have registered." +
                                                    "Please follow the link in the email to complete your password reset request";

                return(RedirectToAction("ForgotPassword", "Portal"));
            }

            return(View());
        }
Пример #6
0
        public IActionResult Create(CreateSubMenuMasterViewModel subMenu)
        {
            subMenu.ListofMenus = new List <SelectListItem>()
            {
                new SelectListItem()
                {
                    Value = "", Text = "-----Select-----"
                }
            };
            subMenu.ListofMenuCategory = new List <SelectListItem>()
            {
                new SelectListItem()
                {
                    Value = "", Text = "-----Select-----"
                }
            };
            subMenu.ListofRoles = _roleQueries.ListofRoles();

            if (ModelState.IsValid)
            {
                if (_subMenuMasterQueries.CheckSubMenuNameExists(subMenu.SubMenuName, subMenu.MenuId, subMenu.RoleId,
                                                                 subMenu.MenuCategoryId))
                {
                    ModelState.AddModelError("", "SubMenu Name Already Exists");
                    return(View(subMenu));
                }

                var mappedobject = _mapper.Map <SubMenuMaster>(subMenu);
                mappedobject.CreatedOn = DateTime.Now;
                mappedobject.CreatedBy = Convert.ToInt64(HttpContext.Session.Get <string>(AllSessionKeys.UserId));
                _unitOfWorkEntityFramework.SubMenuMasterCommand.Add(mappedobject);
                var result = _unitOfWorkEntityFramework.Commit();

                if (result)
                {
                    _notificationService.SuccessNotification("Message", "SubMenu was added Successfully!");
                    return(RedirectToAction("Index", "SubMenuMaster"));
                }
            }

            return(View(subMenu));
        }
Пример #7
0
        public IActionResult Reset(ResetPasswordViewModel resetPasswordViewModel)
        {
            if (ModelState.IsValid)
            {
                var userid         = Convert.ToString(HttpContext.Session.GetString("VerificationUserId"));
                var getuserdetails = _userMasterQueries.GetUserDetailsbyUserId(Convert.ToInt64(userid));

                if (!string.Equals(resetPasswordViewModel.Password, resetPasswordViewModel.ConfirmPassword, StringComparison.Ordinal))
                {
                    TempData["Reset_Error_Message"] = "Password Does not Match";
                    return(View(resetPasswordViewModel));
                }
                else
                {
                    var salt           = GenerateRandomNumbers.GenerateRandomDigitCode(20);
                    var saltedpassword = HashHelper.CreateHashSHA512(resetPasswordViewModel.Password, salt);
                    _unitOfWorkEntityFramework.UserMasterCommand.UpdatePasswordandHistory(getuserdetails.UserId, saltedpassword, salt, "R");
                    var result = _unitOfWorkEntityFramework.Commit();
                    if (result)
                    {
                        var resetPasswordVerificationobj = _verificationQueries.GetResetGeneratedToken(getuserdetails.UserId);
                        _unitOfWorkEntityFramework.VerificationCommand.UpdateResetVerification(resetPasswordVerificationobj);
                        var updateresult = _unitOfWorkEntityFramework.Commit();

                        if (updateresult)
                        {
                            TempData["Reset_Success_Message"] = "Password Reset Successfully!";
                        }

                        return(RedirectToAction("Login", "Portal"));
                    }
                    else
                    {
                        TempData["Reset_Error_Message"] = "Something Went Wrong Please try again!";
                        return(View(resetPasswordViewModel));
                    }
                }
            }

            return(View(resetPasswordViewModel));
        }
        public IActionResult Changepassword(ChangePasswordViewModel changePasswordViewModel)
        {
            if (ModelState.IsValid)
            {
                var userid         = Convert.ToString(HttpContext.Session.GetString(AllSessionKeys.UserId));
                var getuserdetails = _userMasterQueries.GetUserDetailsbyUserId(Convert.ToInt64(userid));
                var usersalt       = _userTokensQueries.GetUserSaltbyUserid(getuserdetails.UserId);
                var generatehash   = HashHelper.CreateHashSHA512(changePasswordViewModel.CurrentPassword, usersalt.PasswordSalt);

                if (changePasswordViewModel.CurrentPassword == changePasswordViewModel.Password)
                {
                    ModelState.AddModelError("", @"New Password Cannot be same as Old Password");
                    return(View(changePasswordViewModel));
                }

                if (!string.Equals(getuserdetails.PasswordHash, generatehash, StringComparison.Ordinal))
                {
                    ModelState.AddModelError("", "Current Password Entered is InValid");
                    return(View(changePasswordViewModel));
                }

                if (!string.Equals(changePasswordViewModel.Password, changePasswordViewModel.ConfirmPassword, StringComparison.Ordinal))
                {
                    _notificationService.DangerNotification("Message", "Password Does not Match!");
                    return(View(changePasswordViewModel));
                }
                else
                {
                    var salt           = GenerateRandomNumbers.GenerateRandomDigitCode(20);
                    var saltedpassword = HashHelper.CreateHashSHA512(changePasswordViewModel.Password, salt);
                    _unitOfWorkEntityFramework.UserMasterCommand.UpdatePasswordandHistory(getuserdetails.UserId, saltedpassword, salt, "C");
                    var result = _unitOfWorkEntityFramework.Commit();

                    if (result)
                    {
                        _notificationService.SuccessNotification("Message", "Your Password Changed Successfully!");
                        var registerVerificationobj = _verificationQueries.GetRegistrationGeneratedToken(getuserdetails.UserId);
                        _unitOfWorkEntityFramework.VerificationCommand.UpdateRegisterVerification(registerVerificationobj);
                        return(RedirectToAction("Changepassword", "UserDashboard"));
                    }
                    else
                    {
                        _notificationService.DangerNotification("Message", "Something Went Wrong Please try again!");
                        return(View(changePasswordViewModel));
                    }
                }
            }

            return(View(changePasswordViewModel));
        }
Пример #9
0
        public IActionResult Create(CreateNoticeViewModel noticeViewModel)
        {
            if (ModelState.IsValid)
            {
                if (_noticeQueries.ShowNotice(noticeViewModel.NoticeStart, noticeViewModel.NoticeEnd))
                {
                    ModelState.AddModelError("", "Notice Already Exits Between Selected Dates");
                    return(View(noticeViewModel));
                }

                var noticeMappedobject = _mapper.Map <Notice>(noticeViewModel);
                noticeMappedobject.Status    = true;
                noticeMappedobject.CreatedOn = DateTime.Now;
                noticeMappedobject.CreatedBy = Convert.ToInt32(HttpContext.Session.GetString(AllSessionKeys.UserId));

                _unitOfWorkEntityFramework.NoticeCommand.AddNotice(noticeMappedobject);

                var noticeDetails = new NoticeDetails()
                {
                    Notice          = noticeMappedobject,
                    NoticeBody      = HttpUtility.HtmlDecode(noticeViewModel.NoticeBody),
                    NoticeDetailsId = 0,
                    NoticeId        = noticeMappedobject.NoticeId
                };

                _unitOfWorkEntityFramework.NoticeDetailsCommand.AddNoticeDetails(noticeDetails);
                var result = _unitOfWorkEntityFramework.Commit();

                if (result)
                {
                    _notificationService.SuccessNotification("Message", "The Notice was added Successfully!");
                }
            }

            return(RedirectToAction("Create"));
        }
Пример #10
0
        public IActionResult UploadtoDatabase(IFormFile files)
        {
            if (files != null)
            {
                if (files.Length > 0)
                {
                    //Getting FileName
                    var fileName = Path.GetFileName(files.FileName);
                    //Getting file Extension
                    var fileExtension = Path.GetExtension(fileName);
                    // concatenating  FileName + FileExtension
                    var newFileName = String.Concat(Convert.ToString(Guid.NewGuid()), fileExtension);
                    var userId      = Convert.ToInt32(HttpContext.Session.GetString(AllSessionKeys.UserId));

                    var objfiles = new DocumentUploadedFiles()
                    {
                        DocumentId = 0,
                        Name       = newFileName,
                        FileType   = files.ContentType,
                        CreatedOn  = DateTime.Now,
                        CreatedBy  = userId
                    };

                    using (var target = new MemoryStream())
                    {
                        files.CopyTo(target);
                        objfiles.DataFiles = target.ToArray();
                    }

                    _unitOfWorkEntityFramework.DocumentCommand.Add(objfiles);
                    _unitOfWorkEntityFramework.Commit();
                    _notificationService.SuccessNotification("Message", "Document uploaded Successfully!");
                }
            }

            return(RedirectToAction("Index"));
        }
Пример #11
0
        public IActionResult Create(CreateUserViewModel createModel)
        {
            createModel.ListRole = _roleQueries.ListofRoles();

            if (!ModelState.IsValid)
            {
                return(View(createModel));
            }

            if (_userMasterQueries.CheckUserExists(createModel.UserName))
            {
                ModelState.AddModelError("", "Entered Username Already Exists");
                return(View(createModel));
            }

            if (_userMasterQueries.CheckEmailExists(createModel.EmailId))
            {
                ModelState.AddModelError("", "Entered EmailId Already Exists");
                return(View(createModel));
            }

            if (_userMasterQueries.CheckMobileNoExists(createModel.MobileNo))
            {
                ModelState.AddModelError("", "Entered MobileNo Already Exists");
                return(View(createModel));
            }

            if (!string.Equals(createModel.Password, createModel.ConfirmPassword,
                               StringComparison.Ordinal))
            {
                TempData["Registered_Error_Message"] = "Password Does not Match";
                return(View(createModel));
            }

            var salt           = GenerateRandomNumbers.GenerateRandomDigitCode(20);
            var saltedpassword = HashHelper.CreateHashSHA512(createModel.Password, salt);

            var userMappedobject = _mapper.Map <UserMaster>(createModel);

            userMappedobject.Status       = true;
            userMappedobject.CreatedOn    = DateTime.Now;
            userMappedobject.CreatedBy    = Convert.ToInt32(HttpContext.Session.GetString(AllSessionKeys.UserId));
            userMappedobject.PasswordHash = saltedpassword;

            AssignedRoles assignedRoles = new AssignedRoles()
            {
                AssignedRoleId = 0,
                CreateDate     = DateTime.Now,
                Status         = true,
                RoleId         = createModel.RoleId,
                UserMaster     = userMappedobject
            };

            UserTokens userTokens = new UserTokens()
            {
                UserMaster   = userMappedobject,
                CreatedOn    = DateTime.Now,
                HashId       = 0,
                PasswordSalt = salt
            };

            _unitOfWorkEntityFramework.UserMasterCommand.Add(userMappedobject);
            _unitOfWorkEntityFramework.AssignedRolesCommand.Add(assignedRoles);
            _unitOfWorkEntityFramework.UserTokensCommand.Add(userTokens);
            var result = _unitOfWorkEntityFramework.Commit();

            if (result)
            {
                _notificationService.SuccessNotification("Message", "User Registered Successfully !");
                return(RedirectToAction("Index"));
            }
            else
            {
                _notificationService.DangerNotification("Message", "Something went wrong Please Try Once Again !");
                return(View(createModel));
            }
        }
Пример #12
0
        public IActionResult Create([FromBody] CreateUserRequest createUserRequest)
        {
            if (_userMasterQueries.CheckUserExists(createUserRequest.UserName))
            {
                return(BadRequest(new BadRequestResponse("Entered Username Already Exists")));
            }

            if (_userMasterQueries.CheckEmailExists(createUserRequest.EmailId))
            {
                return(BadRequest(new BadRequestResponse("Entered EmailId Already Exists")));
            }

            if (_userMasterQueries.CheckMobileNoExists(createUserRequest.MobileNo))
            {
                return(BadRequest(new BadRequestResponse("Entered MobileNo Already Exists")));
            }

            if (!string.Equals(createUserRequest.Password, createUserRequest.ConfirmPassword,
                               StringComparison.Ordinal))
            {
                return(BadRequest(new BadRequestResponse("Password Does not Match")));
            }

            var generatepasswordhash = HashHelper.CreateHashSHA512(createUserRequest.Password).ToLower();

            var salt           = GenerateRandomNumbers.GenerateRandomDigitCode(20);
            var saltedpassword = HashHelper.CreateHashSHA512(generatepasswordhash, salt);

            var userMappedobject = new UserMaster()
            {
                UserId       = 0,
                Status       = true,
                CreatedOn    = DateTime.Now,
                CreatedBy    = Convert.ToInt32(1),
                PasswordHash = saltedpassword,
                FirstName    = createUserRequest.FirstName,
                EmailId      = createUserRequest.EmailId,
                Gender       = createUserRequest.Gender,
                MobileNo     = createUserRequest.MobileNo,
                IsFirstLogin = false,
                LastName     = createUserRequest.LastName,
                UserName     = createUserRequest.UserName
            };


            AssignedRoles assignedRoles = new AssignedRoles()
            {
                AssignedRoleId = 0,
                CreateDate     = DateTime.Now,
                Status         = true,
                RoleId         = Convert.ToInt32(RolesHelper.Roles.User),
                UserMaster     = userMappedobject
            };

            UserTokens userTokens = new UserTokens()
            {
                UserMaster   = userMappedobject,
                CreatedOn    = DateTime.Now,
                HashId       = 0,
                PasswordSalt = salt
            };

            _unitOfWorkEntityFramework.UserMasterCommand.Add(userMappedobject);
            _unitOfWorkEntityFramework.AssignedRolesCommand.Add(assignedRoles);
            _unitOfWorkEntityFramework.UserTokensCommand.Add(userTokens);
            var result = _unitOfWorkEntityFramework.Commit();

            if (result)
            {
                return(Ok(new OkResponse("User Registered Successfully !")));
            }
            else
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, "Something Went Wrong"));
            }
        }
        public IActionResult Form(RegistrationViewModel registerViewModel)
        {
            if (ModelState.IsValid)
            {
                if (_userMasterQueries.CheckUserExists(registerViewModel.UserName))
                {
                    ModelState.AddModelError("", "Entered Username Already Exists");
                    return(View(registerViewModel));
                }

                if (_userMasterQueries.CheckUserExists(registerViewModel.EmailId))
                {
                    ModelState.AddModelError("", "Entered EmailId Already Exists");
                    return(View(registerViewModel));
                }

                if (_userMasterQueries.CheckUserExists(registerViewModel.MobileNo))
                {
                    ModelState.AddModelError("", "Entered Phoneno Already Exists");
                    return(View(registerViewModel));
                }

                if (!string.Equals(registerViewModel.Password, registerViewModel.ConfirmPassword,
                                   StringComparison.Ordinal))
                {
                    TempData["Registered_Error_Message"] = "Password Does not Match";
                    return(View(registerViewModel));
                }

                var salt           = GenerateRandomNumbers.GenerateRandomDigitCode(20);
                var saltedpassword = HashHelper.CreateHashSHA512(registerViewModel.Password, salt);


                var userMappedobject = _mapper.Map <UserMaster>(registerViewModel);
                userMappedobject.Status       = true;
                userMappedobject.CreatedOn    = DateTime.Now;
                userMappedobject.CreatedBy    = Convert.ToInt32(HttpContext.Session.GetString(AllSessionKeys.UserId));
                userMappedobject.PasswordHash = saltedpassword;

                AssignedRoles assignedRoles = new AssignedRoles()
                {
                    AssignedRoleId = 0,
                    CreateDate     = DateTime.Now,
                    Status         = true,
                    RoleId         = Convert.ToInt32(RolesHelper.Roles.User),
                    UserMaster     = userMappedobject
                };

                UserTokens userTokens = new UserTokens()
                {
                    UserMaster   = userMappedobject,
                    CreatedOn    = DateTime.Now,
                    HashId       = 0,
                    PasswordSalt = salt
                };

                _unitOfWorkEntityFramework.UserMasterCommand.Add(userMappedobject);
                _unitOfWorkEntityFramework.AssignedRolesCommand.Add(assignedRoles);
                _unitOfWorkEntityFramework.UserTokensCommand.Add(userTokens);
                var result = _unitOfWorkEntityFramework.Commit();

                if (result)
                {
                    var userdetails = _userMasterQueries.GetUserbyUserName(registerViewModel.UserName);
                    var token       = HashHelper.CreateHashSHA256((GenerateRandomNumbers.GenerateRandomDigitCode(6)));
                    var body        = _emailSender.CreateRegistrationVerificationEmail(userdetails, token);

                    _unitOfWorkEntityFramework.VerificationCommand.SendRegistrationVerificationToken(userdetails.UserId, token);
                    _unitOfWorkEntityFramework.Commit();
                    MessageTemplate messageTemplate = new MessageTemplate()
                    {
                        ToAddress = userdetails.EmailId,
                        Subject   = "Welcome to Frapper",
                        Body      = body
                    };

                    _emailSender.SendMailusingSmtp(messageTemplate);

                    TempData["Registered_Success_Message"] = "User Registered Successfully";
                }
                else
                {
                    TempData["Registered_Error_Message"] = "Error While Registrating User Successfully";
                }
            }

            return(RedirectToAction("Form", "Registration"));
        }
        public IActionResult Verify(string key, string hashtoken)
        {
            try
            {
                if (!string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(hashtoken))
                {
                    var arrayVakue = SecurityTokenHelper.SplitToken(key);
                    if (arrayVakue != null)
                    {
                        // arrayVakue[1] "UserId"
                        var userId  = Convert.ToInt64(arrayVakue[1]);
                        var rvModel = _verificationQueries.GetRegistrationGeneratedToken(userId);
                        if (rvModel != null)
                        {
                            var result = SecurityTokenHelper.IsTokenValid(arrayVakue, hashtoken, rvModel.GeneratedToken);

                            if (result == 1)
                            {
                                TempData["TokenErrorMessage"] = "Sorry Verification Link Expired Please request a new Verification link!";
                                return(RedirectToAction("Login", "Portal"));
                            }

                            if (result == 2)
                            {
                                TempData["TokenErrorMessage"] = "Sorry Verification Link Expired Please request a new Verification link!";
                                return(RedirectToAction("Login", "Portal"));
                            }

                            if (result == 0)
                            {
                                if (_verificationQueries.CheckIsAlreadyVerifiedRegistration(Convert.ToInt64(arrayVakue[1])))
                                {
                                    TempData["TokenErrorMessage"] = "Sorry Link Expired";
                                    return(RedirectToAction("Login", "Portal"));
                                }

                                HttpContext.Session.SetString("VerificationUserId", arrayVakue[1]);

                                var resetPasswordVerificationobj = _verificationQueries.GetRegistrationGeneratedToken(userId);
                                _unitOfWorkEntityFramework.VerificationCommand.UpdateRegisterVerification(resetPasswordVerificationobj);
                                var updateresult = _unitOfWorkEntityFramework.Commit();

                                if (updateresult)
                                {
                                    TempData["Verify"] = "Done";
                                    return(RedirectToAction("Completed", "VerifyRegistration"));
                                }
                                else
                                {
                                    TempData["TokenErrorMessage"] = "Sorry Verification Failed Please request a new Verification link!";
                                    return(RedirectToAction("Login", "Portal"));
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
                TempData["TokenMessage"] = "Sorry Verification Failed Please request a new Verification link!";
                return(RedirectToAction("Login", "Portal"));
            }

            TempData["TokenMessage"] = "Sorry Verification Failed Please request a new Verification link!";
            return(RedirectToAction("Login", "Portal"));
        }