Beispiel #1
0
        protected void btnForgotPwd_Click(object sender, EventArgs e)
        {
            DataSet ds = objreg.GetStudentbyEmail(txtFPEmailMobile.Text);

            if (ds.Tables[0].Rows.Count < 1)
            {
                Response.Redirect("~/Home.aspx");
            }

            string FullName = ds.Tables[0].Rows[0]["FullName"].ToString();
            string Pwd      = ds.Tables[0].Rows[0]["Password"].ToString();

            SendMails.SendAnEmail(txtFPEmailMobile.Text, SendMails.FORGOTPASSWORD_SUB,
                                  string.Format(SendMails.FORGOTPASSWORD_BODY, FullName, txtFPEmailMobile.Text, Pwd));

            Response.Redirect("~/Home.aspx");
        }
        public string SendOTP(string emailMobile, string isEmail, string existOTP)
        {
            if (string.IsNullOrEmpty(existOTP))
            {
                DataSet ds = _regDal.GetStudentbyEmail(emailMobile);
                if (ds.Tables[0].Rows.Count < 1)
                {
                    return(string.Empty);
                }
            }

            string OTP = string.IsNullOrEmpty(existOTP)? RandomOTP(): existOTP;

            if (string.IsNullOrEmpty(isEmail))
            {
                SendMails.SendAnEmail(emailMobile, SendMails.FORGOTPASSWORD_SUB_OTP,
                                      string.Format(SendMails.FORGOTPASSWORD_BODY_OTP, OTP));
            }

            return(OTP);
        }
        protected void btnRedirect_Click(object sender, EventArgs e)
        {
            if (btnSubmit.Text.ToLower() == "update")
            {
                Response.Redirect("~/DashBoard/Pages/TM/TmProfile.aspx");
                return;
            }


            string    applicantBody = string.Format(SendMails.REGISTRATION_BODY_APPLICANT, txtFirstNAme.Text, txtLastName.Text);
            Institute ins           = _comDal.GetInstituteDetails(Convert.ToInt32(ddlInstitute.SelectedValue));
            string    icBody        = string.Format(SendMails.REGISTRATION_BODY_IC, ins.ICName, txtFirstNAme.Text, txtLastName.Text);

            SendMails.SendAnEmail(txtEmailId.Text, SendMails.REGISTRATION_SUB_APPLICANT, applicantBody);
            SendMails.SendAnEmail(ins.Email, SendMails.REGISTRATION_SUB_IC, icBody);

            if (Session["UserId"] != null)
            {
                Response.Redirect("~/DashBoard/Pages/TC/TcDashBoard.aspx");
            }
            Response.Redirect("~/Home.aspx");
        }