Example #1
0
 /// <summary>
 ///Send a verification email
 /// </summary>
 /// <author>Mukti</author>
 /// <Date>june 2, 2015</Date>
 #region SendVerifyEmail
 void SendVerifyEmail(string email, string type, Int64 id)
 {
     string Desctr = Encryption.EncryptURL(id.ToString() + "," + type);
     Desctr = Desctr.Replace("/", "_").Replace("+", "-");
     var sanitized = HttpUtility.UrlEncode(Desctr);
     string body = CommonMethod.ReadEmailformats("signup.html");
     string path = Constants.SiteUrl + "/Account/verifyEmail/" + sanitized;
     body = body.Replace("$$UserEmailId$$", email).Replace("$$url$$", Constants.SiteUrl);
     body = body.Replace("$$SignUpLink$$", "<a href='" + path + "'> Click here to verify your email </a>");
     SendMail objSendMail = new SendMail();
     objSendMail.SendEmail(email, Constants.AdminEmail, Constants.AdminName, "Account Created", body);
 }
Example #2
0
        //public string UpdateBankDetails(BankDetail objReq)
        //{
        //    string rst = "";

        //    try
        //    {
        //        using (var db = new WizzDataContext())
        //        {
        //            var user = db.tblTutorBankDetails.Where(d => d.fkUserId == Convert.ToInt64(objReq.userId)).FirstOrDefault();
        //            if (user != null)
        //            {
        //                user.ifscCode = objReq.ifscCode;
        //                user.accountHolderName = objReq.accountHolderName;
        //                user.accountNumber = objReq.accountNumber;
        //                user.bankName = objReq.bankName;
        //                user.branchAddress = objReq.branchAddress;
        //                user.createdDate = DateTime.UtcNow;
        //                user.ifscCode = objReq.ifscCode;
        //                user.micrCode = objReq.micrCode;

        //                db.SubmitChanges();
        //            }
        //            else 
        //            {
        //                user = new tblTutorBankDetail();

        //                user.ifscCode = objReq.ifscCode;
        //                user.accountHolderName = objReq.accountHolderName;
        //                user.accountNumber = objReq.accountNumber;
        //                user.bankName = objReq.bankName;
        //                user.branchAddress = objReq.branchAddress;
        //                user.createdDate = DateTime.UtcNow;
        //                user.ifscCode = objReq.ifscCode;
        //                user.micrCode = objReq.micrCode;
        //                db.tblTutorBankDetails.InsertOnSubmit(user);
        //                db.SubmitChanges();

        //            }
        //            rst = "1";
        //        }


        //    }
        //    catch
        //    {
        //        rst = "";
        //    }
        //    return rst;
        //}
        #region Rishabh
        //db method for forgotpassword
        internal int ForgetPassword(ReqEmail objReq)
        {
            try
            {
                using (var db = new WizzDataContext())
                {
                    tblUser userData = new tblUser();
                    userData = db.tblUsers.Where(u => u.userEmail == objReq.userEmail.Trim().ToLower()).FirstOrDefault();
                    if (userData != null)
                    {
                        string body = CommonMethod.ReadEmailformats("forgetPassword.html");
                        string path = Constants.SiteUrl + "/Account/ResetPassword/" + userData.guid.ToString();
                        body = body.Replace("$$UserName$$", userData.userName == null ? "User" : userData.userName.ToUpper().Trim());
                        body = body.Replace("$$ResetLink$$", "<a href='" + path + "'> Click to reset your password </a>");
                        SendMail objSendMail = new SendMail();
                        objSendMail.SendEmail(userData.userEmail.Trim(), Constants.AdminEmail, Constants.AdminName, "Reset Password", body);

                        //change in db accrodingly
                        //userData.isVarified = false;
                        userData.isPasswordChanged = true;
                        db.SubmitChanges();
                        return 1;
                    }
                    else
                    {
                        return 0;
                    }
                }
            }
            catch
            {
                return 0;
            }
        }