public ActionResult CheckEmailIdExist(string newEmailId)
        {
            User objUser = (User)Session["User"];

            Api.User.User             ApiobjUser       = new Api.User.User();
            Api.MailSender.MailSender ApiobjMailSender = new Api.MailSender.MailSender();
            string ret        = string.Empty;
            string mailsender = "";

            ret = ApiobjUser.CheckEmailId(newEmailId);
            if (ret == "NotExist")
            {
                string strRandomUnique = SBUtils.GenerateRandomUniqueString();

                string res_UpdateChangePasswordKey = ApiobjUser.UpdateResetEmailKey(objUser.Id.ToString(), strRandomUnique);
                if (res_UpdateChangePasswordKey == "1")
                {
                    TempData["NewEmailId"] = newEmailId;
                    TempData.Keep("NewEmailId");
                    ViewBag.NewEmailId     = newEmailId;
                    objUser.ChangeEmailKey = strRandomUnique;
                }
                Session["User"] = objUser;
                var    mailBody = Helper.SBUtils.RenderViewToString1(this.ControllerContext, this.TempData, "_EmailChangeMailBodyPartial", objUser);
                string Subject  = "Socioboard";

                mailsender = ApiobjMailSender.SendChangePasswordMail(newEmailId, mailBody, Subject);
                return(Content("Mail Send Successfully"));
            }
            else
            {
                return(Content("EmailId already Exist"));
            }
        }
Beispiel #2
0
        public ActionResult InviteFriendByEmail(string EmailId)
        {
            string ret   = string.Empty;
            User   _User = (User)Session["User"];

            Api.User.User             ApiUser       = new Api.User.User();
            Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
            if (ApiUser.CheckEmailId(EmailId) == "NotExist")
            {
                //if (!ApiInvitation.IsFriendAlreadydInvited(_User.Id.ToString(), EmailId))
                //{
                ret = ApiInvitation.SendInvitationMail(_User.EmailId, _User.UserName, EmailId);
                //}
                //else
                //{
                //    ret = EmailId + " is already Invited";
                //}
            }
            else
            {
                ret = EmailId + " is already registered";
            }
            return(Content(ret));
        }
        public ActionResult CheckEmailIdExist(string newEmailId)
        {
             User objUser = (User)Session["User"];
             Api.User.User ApiobjUser = new Api.User.User();
             Api.MailSender.MailSender ApiobjMailSender = new Api.MailSender.MailSender();
             string ret = string.Empty;
             string mailsender = "";
             ret = ApiobjUser.CheckEmailId(newEmailId); 
            if (ret == "NotExist")
	         {
		      string strRandomUnique = SBUtils.GenerateRandomUniqueString();

              string res_UpdateChangePasswordKey = ApiobjUser.UpdateResetEmailKey(objUser.Id.ToString(), strRandomUnique);
              if (res_UpdateChangePasswordKey == "1")
              {
                  TempData["NewEmailId"] = newEmailId;
                  TempData.Keep("NewEmailId");
                  ViewBag.NewEmailId = newEmailId;
                  objUser.ChangeEmailKey = strRandomUnique;
              }
              Session["User"] = objUser;
              var mailBody = Helper.SBUtils.RenderViewToString1(this.ControllerContext, this.TempData, "_EmailChangeMailBodyPartial", objUser);
              string Subject = "Socioboard";

              mailsender = ApiobjMailSender.SendChangePasswordMail(newEmailId, mailBody, Subject);
              return Content("Mail Send Successfully");
	         }
            else
	         {
                return Content("EmailId already Exist");
	         }
        }
 public ActionResult InviteFriendByEmail(string EmailId)
 {
     string ret = string.Empty;
     User _User = (User)Session["User"];
     Api.User.User ApiUser = new Api.User.User();
     Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
     if (ApiUser.CheckEmailId(EmailId) == "NotExist")
     {
         //if (!ApiInvitation.IsFriendAlreadydInvited(_User.Id.ToString(), EmailId))
         //{
         ret = ApiInvitation.SendInvitationMail(_User.EmailId, _User.UserName, EmailId);
         //}
         //else
         //{
         //    ret = EmailId + " is already Invited";
         //}
     }
     else
     {
         ret = EmailId + " is already registered";
     }
     return Content(ret);
 }