Exemple #1
0
        // Edited by Antima[24/11/2014]

        public ActionResult SendVideoMail(string EmailId)
        {
            Api.User.User ApiobjUser = new Api.User.User();
            Domain.Socioboard.Domain.User objuser = new Domain.Socioboard.Domain.User();
            try
            {
                objuser = (Domain.Socioboard.Domain.User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUserInfoByEmail(EmailId), typeof(Domain.Socioboard.Domain.User)));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }

            Api.MailSender.MailSender ApiobjMailSender = new Api.MailSender.MailSender();
            string mailsender = "";

            try
            {
                var    mailBody = Helper.SBUtils.RenderViewToString(this.ControllerContext, "_VideoMailPartial", objuser);
                string Subject  = "Enjoy Video Mailing through Socioboard";

                mailsender = ApiobjMailSender.SendChangePasswordMail(EmailId, mailBody, Subject);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
            return(Content(mailsender));
        }
        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 PluginSignUp()
        {
            string name     = Request.Form["name"].ToString();
            string email    = Request.Form["email"].ToString();
            string password = Request.Form["password"].ToString();

            Api.User.User objApiUser = new Api.User.User();
            string        res        = objApiUser.Register(email, password, "free", name, "0");

            if (res == "Email Already Exists")
            {
                return(Content("email exist"));
            }
            else
            {
                Domain.Socioboard.Domain.User _User = (Domain.Socioboard.Domain.User) new JavaScriptSerializer().Deserialize(res, typeof(Domain.Socioboard.Domain.User));

                Api.MailSender.MailSender ApiobjMailSender = new Api.MailSender.MailSender();
                string mailsender = "";
                try
                {
                    var    mailBody = Helper.SBUtils.RenderViewToString(this.ControllerContext, "_RegistrationMailPartial", _User);
                    string Subject  = "Thanks for creating your " + ConfigurationManager.AppSettings["DefaultGroupName"].ToString() + " Account";

                    mailsender = ApiobjMailSender.SendChangePasswordMail(email, mailBody, Subject);
                }
                catch { }
            }
            return(Content("user"));
        }
        public ActionResult SendResetPasswordMail(string emailId, string Password)
        {
            string IsPasswordReset = string.Empty;

            Api.User.User ApiobjUser = new Api.User.User();

            Domain.Socioboard.Domain.User objuser = new Domain.Socioboard.Domain.User();

            string mailsender = "";

            try
            {
                objuser = (Domain.Socioboard.Domain.User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUserInfoByEmail(emailId), typeof(Domain.Socioboard.Domain.User)));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }

            string changedpassword = Helper.SBUtils.MD5Hash(Password);

            IsPasswordReset = (string)new JavaScriptSerializer().Deserialize(ApiobjUser.ResetPassword(objuser.Id, changedpassword), typeof(string));
            mailsender      = "Password Changed Successfully";
            if (IsPasswordReset == "1")
            {
                objuser = (Domain.Socioboard.Domain.User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUserInfoByEmail(emailId), typeof(Domain.Socioboard.Domain.User)));
                try
                {
                    Api.MailSender.MailSender ApiobjMailSender = new Api.MailSender.MailSender();

                    try
                    {
                        objuser.Password = Password;
                        var    mailBody = Helper.SBUtils.RenderViewToString(this.ControllerContext, "_ResetPasswordMailBodyPartial", objuser);
                        string Subject  = "New password for your Socioboard Account";

                        mailsender = ApiobjMailSender.SendChangePasswordMail(emailId, mailBody, Subject);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }
            }
            return(Content(mailsender));
        }
        public ActionResult SendFogotPassMail(string emailId)
        {
            Api.User.User ApiobjUser = new Api.User.User();
            Domain.Socioboard.Domain.User objuser = new Domain.Socioboard.Domain.User();
            try
            {
                objuser = (Domain.Socioboard.Domain.User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUserInfoByEmail(emailId), typeof(Domain.Socioboard.Domain.User)));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
            Api.MailSender.MailSender ApiobjMailSender = new Api.MailSender.MailSender();
            string mailsender = "";

            try
            {
                if (objuser == null)
                {
                    mailsender = "IdNOtExist";
                }
                //Generate a random unique string
                string strRandomUnique = SBUtils.GenerateRandomUniqueString();

                //Update random unique string in User
                string res_UpdateChangePasswordKey = ApiobjUser.UpdateForgetPasswordKey(objuser.Id.ToString(), strRandomUnique);

                if (res_UpdateChangePasswordKey == "1")
                {
                    ViewBag.ForgetPasswordKey = strRandomUnique;
                    objuser.ChangePasswordKey = strRandomUnique;
                }

                objuser.ChangePasswordKey = strRandomUnique;

                var    mailBody = Helper.SBUtils.RenderViewToString(this.ControllerContext, "_ForgotPasswordMailBodyPartial", objuser);
                string Subject  = "You requested a password reset for your " + ConfigurationManager.AppSettings["DefaultGroupName"].ToString() + " Account";//"Forget password Socioboard Account";

                mailsender = ApiobjMailSender.SendChangePasswordMail(emailId, mailBody, Subject);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
            return(Content(mailsender));
        }
        public ActionResult SendFogotPassMail(string emailId)
        {
            Api.User.User ApiobjUser = new Api.User.User();
            Domain.Socioboard.Domain.User objuser = new Domain.Socioboard.Domain.User();
            try
            {
                objuser = (Domain.Socioboard.Domain.User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUserInfoByEmail(emailId), typeof(Domain.Socioboard.Domain.User)));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
            Api.MailSender.MailSender ApiobjMailSender = new Api.MailSender.MailSender();
            string mailsender = "";
            try
            {
                if (objuser == null) 
                {
                    mailsender = "IdNOtExist";
                }
                //Generate a random unique string
                string strRandomUnique = SBUtils.GenerateRandomUniqueString();

                //Update random unique string in User
                string res_UpdateChangePasswordKey = ApiobjUser.UpdateForgetPasswordKey(objuser.Id.ToString(), strRandomUnique);

                if (res_UpdateChangePasswordKey=="1")
                {
                    ViewBag.ForgetPasswordKey = strRandomUnique;
                    objuser.ChangePasswordKey = strRandomUnique;
                }

                objuser.ChangePasswordKey = strRandomUnique;

                var mailBody = Helper.SBUtils.RenderViewToString(this.ControllerContext, "_ForgotPasswordMailBodyPartial", objuser);
                string Subject = "You requested a password reset for your " + ConfigurationManager.AppSettings["DefaultGroupName"].ToString() + " Account";//"Forget password Socioboard Account";

                mailsender = ApiobjMailSender.SendChangePasswordMail(emailId, mailBody, Subject);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
            return Content(mailsender);
        }
Exemple #7
0
        public ActionResult SendRegistrationMail(string emailId)
        {
            Api.User.User ApiobjUser = new Api.User.User();
            Domain.Socioboard.Domain.User objuser = new Domain.Socioboard.Domain.User();
            try
            {
                objuser = (Domain.Socioboard.Domain.User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUserInfoByEmail(emailId), typeof(Domain.Socioboard.Domain.User)));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
            Api.MailSender.MailSender ApiobjMailSender = new Api.MailSender.MailSender();
            string mailsender = "";

            try
            {
                var    mailBody = Helper.SBUtils.RenderViewToString(this.ControllerContext, "_RegistrationMailPartial", objuser);
                string Subject  = "Thanks for creating your Socioboard Account";

                mailsender = ApiobjMailSender.SendChangePasswordMail(emailId, mailBody, Subject);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }

            User _user = (User)Session["User"];

            if (_user != null && _user.ActivationStatus == "1")
            {
                mailsender += ">> Facebook Registration";
            }

            return(Content(mailsender));
        }
Exemple #8
0
        // Edited by Antima[24/11/2014]

        public ActionResult SendVideoMail(string EmailId)
        {
            Api.User.User ApiobjUser = new Api.User.User();
            Domain.Socioboard.Domain.User objuser = new Domain.Socioboard.Domain.User();
            try
            {
                objuser = (Domain.Socioboard.Domain.User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUserInfoByEmail(EmailId), typeof(Domain.Socioboard.Domain.User)));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
           
            Api.MailSender.MailSender ApiobjMailSender = new Api.MailSender.MailSender();
            string mailsender = "";
            try
            {
                var mailBody = Helper.SBUtils.RenderViewToString(this.ControllerContext, "_VideoMailPartial", objuser);
                string Subject = "Enjoy Video Mailing through Socioboard";

                mailsender = ApiobjMailSender.SendChangePasswordMail(EmailId, mailBody, Subject);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
            return Content(mailsender);
        }
Exemple #9
0
        public ActionResult SendRegistrationMail(string emailId)
        {
            Api.User.User ApiobjUser = new Api.User.User();
            Domain.Socioboard.Domain.User objuser = new Domain.Socioboard.Domain.User();
            try
            {
                objuser = (Domain.Socioboard.Domain.User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUserInfoByEmail(emailId), typeof(Domain.Socioboard.Domain.User)));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
            Api.MailSender.MailSender ApiobjMailSender = new Api.MailSender.MailSender();
            string mailsender = "";
            try
            {
                var mailBody = Helper.SBUtils.RenderViewToString(this.ControllerContext, "_RegistrationMailPartial", objuser);
                string Subject = "Thanks for creating your Socioboard Account";

                mailsender = ApiobjMailSender.SendChangePasswordMail(emailId, mailBody, Subject);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }

            User _user = (User)Session["User"];
            if (_user != null && _user.ActivationStatus == "1")
            {
                mailsender += ">> Facebook Registration";
            }

            return Content(mailsender);
        }
        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 PluginSignUp()
        {
            string name = Request.Form["name"].ToString();
            string email = Request.Form["email"].ToString();
            string password = Request.Form["password"].ToString();
            Api.User.User objApiUser = new Api.User.User();
            string res = objApiUser.Register(email, password, "free", name, "0");
            if (res == "Email Already Exists")
            {
                return Content("email exist");
            }
            else
            {
                Domain.Socioboard.Domain.User _User = (Domain.Socioboard.Domain.User)new JavaScriptSerializer().Deserialize(res, typeof(Domain.Socioboard.Domain.User));

                Api.MailSender.MailSender ApiobjMailSender = new Api.MailSender.MailSender();
                string mailsender = "";
                try
                {
                    var mailBody = Helper.SBUtils.RenderViewToString(this.ControllerContext, "_RegistrationMailPartial", _User);
                    string Subject = "Thanks for creating your " + ConfigurationManager.AppSettings["DefaultGroupName"].ToString() + " Account";

                    mailsender = ApiobjMailSender.SendChangePasswordMail(email, mailBody, Subject);
                }
                catch { }
            }
            return Content("user");
        }