public ActionResult ForgetPassword(int pageId, string email)
        {
            System.Threading.Thread.Sleep(1500);

            helperForgetPassword helperPage = new helperForgetPassword();

            pageShared ps = new pageShared(db);
            userShared us = new userShared(db);

            email = email.ToLower(System.Globalization.CultureInfo.CreateSpecificCulture("en-US"));

            var pageItem = ps.getPageById(pageId);
            var pageLoginRegister = ps.getPageByType(pageType.registerLogin, langId);

            if (pageItem == null | pageLoginRegister == null)
            {
                return null;
            }

            helperPage.loginLink = langCode + "/" + pageLoginRegister.url + ".html";
            ps.pageTitleBind(pageItem, helperPage, langId);
            helperPage.setTitle(pageItem.name);
            helperPage.breadCrumbItem = getBreadCrumbStaticPage(pageItem.name);

            if (string.IsNullOrWhiteSpace(email))
            {
                helperPage.isMessageExist = true;
                helperPage.message = getErrorMessage(App_GlobalResources.lang.formValidEmail);
                return View(helperPage);
            }

            var userRegisterStatuItem = us.getUserRegisterStatuByEmail(email);
            string message = "";

            switch (userRegisterStatuItem)
            {
                case registerStatu.registered:

                    try
                    {
                        mailShared ms = new mailShared(db, langId);

                        var userItem = db.tbl_user.Where(a => a.email == email).FirstOrDefault();

                        // Add Forget Table
                        var forgetCodeItem = us.addForgetPasswordWithItem(userItem.userId);

                        // Send Mail
                        var mailItem = ms.getResetPasswordMailContent(userItem.name, userItem.surname, forgetCodeItem.code, getSiteName(Request), langCode);
                        mailSend(userItem.email, mailItem.Item1, mailItem.Item2);

                        message = getSuccesMessage(App_GlobalResources.lang.forgetPasswordSuccess).Replace("[email]", email);
                        helperPage.email = "";
                    }
                    catch (Exception ex)
                    {

                        errorSend(ex, "Şifre sıfırlama", true);
                    }

                    break;
                case registerStatu.waitingActivation:

                    var pageMailResent = ps.getPageByType(pageType.activationResent, langId);

                    message = App_GlobalResources.lang.activationNoApprove;
                    message = message.Replace("[email]", email);
                    if (pageMailResent != null)
                    {
                        message = message.Replace("[activationResent]", (Url.Content("~/") + langCode + "/" + pageMailResent.url + ".html"));
                    }

                    message = getErrorMessage(message);

                    break;
                case registerStatu.ban:

                    message = getErrorMessage(App_GlobalResources.lang.forgetPasswordError);

                    break;
                case registerStatu.unregistered:

                    message = getErrorMessage(App_GlobalResources.lang.forgetPasswordError);

                    break;

            }

            helperPage.isMessageExist = true;
            helperPage.message = message;
            return View(helperPage);
        }
        public ActionResult ForgetPassword(int pageId)
        {
            helperForgetPassword helperPage = new helperForgetPassword();
            pageShared ps = new pageShared(db);

            var pageItem = ps.getPageById(pageId);

            if (pageItem == null)
            {
                return null;
            }

            ps.pageTitleBind(pageItem, helperPage, langId);
            helperPage.setTitle(pageItem.name);
            helperPage.breadCrumbItem = getBreadCrumbStaticPage(pageItem.name);

            var loginPage = ps.getPageByType(pageType.registerLogin, langId);

            if (loginPage != null)
            {
                helperPage.loginLink = langCode + "/" + loginPage.url + ".html";
            }

            return View(helperPage);
        }