Exemple #1
0
        public ActionResult ChangeGoogleStatus(string userId, bool value)//need  Google Enable ------2
        {
            // var userid = User.Identity.GetUserId();

            if (value == true)
            {
                //bool value = true;
                try
                {
                    bool res = obj.ChangeGoogleStatus(userId, value);
                    if (res == true)
                    {
                        //Write code for insert activity log in db
                        sample EmailStatus = Session["EmailStatus"] as sample;
                        if (EmailStatus.TwoFactor == true)
                        {
                            bool result = obj.ChangeEmailStatus(userId, false);
                            //EmailFalse(userId, false);
                            //await ChangeEmailStatus("", "");
                        }
                        LogOut();
                        ViewBag.Message = "Your Google Authentication enable...Please";
                        return(View("GoogleInfo"));
                    }
                }
                catch (Exception ex)
                {
                    TempData["SendAction"] = "Internal Servar Error.";
                }
            }
            else if (value == false)
            {
                try
                {
                    //bool value = false;
                    bool res = obj.ChangeGoogleStatus(userId, value);
                    if (res == true)
                    {
                        //ViewBag.Message = "Your Google Authentication Disable...Please";
                        // return View("Info");
                        return(RedirectToAction("Security", "SecurityCenter"));
                    }
                }
                catch (Exception ex)
                {
                    TempData["SendAction"] = "Internal Servar Error.";
                }
            }
            return(null);
        }