public ActionResult ResetEmailId(string code, string newEmailId)
        {
            try
            {
                User          objUser    = (User)Session["User"];
                Api.User.User ApiobjUser = new Api.User.User();
                string        groupid    = Session["group"].ToString();
                string        ret        = string.Empty;
                string        IskeyUsed  = string.Empty;
                if (objUser.IsKeyUsed == 0 || objUser.IsKeyUsed == null)
                {
                    ret = ApiobjUser.UpdateEmailId(objUser.Id.ToString(), groupid, newEmailId);
                    if (ret == "Updated Successfully")
                    {
                        IskeyUsed         = ApiobjUser.UpdateIsEmailKeyUsed(objUser.Id.ToString(), code);
                        objUser.IsKeyUsed = int.Parse(IskeyUsed);
                        objUser.EmailId   = newEmailId;
                        Session["User"]   = objUser;
                    }
                }

                return(Content(ret));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return(Content("SomethingWentWrong"));
            }
        }
 public ActionResult ResetEmailId(string code,string newEmailId) 
 {
     try
     {
         User objUser = (User)Session["User"];
         Api.User.User ApiobjUser = new Api.User.User();
         string groupid = Session["group"].ToString();
         string ret = string.Empty;
         string IskeyUsed = string.Empty;
         if (objUser.IsKeyUsed == 0 || objUser.IsKeyUsed == null)
         {
             ret = ApiobjUser.UpdateEmailId(objUser.Id.ToString(), groupid, newEmailId, Session["access_token"].ToString());
             if (ret == "Updated Successfully")
             {
                 IskeyUsed = ApiobjUser.UpdateIsEmailKeyUsed(objUser.Id.ToString(), code);
                 objUser.IsKeyUsed = int.Parse(IskeyUsed);
                 objUser.EmailId = newEmailId;
                 Session["User"] = objUser;
             }
         }
         
         return Content(ret);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         return Content("SomethingWentWrong");
     }
 }