protected void btnVerifyAadhaarOTP_Click(object sender, EventArgs e) { ADSER.AadhaarApplicantOTP = txtOTP.Text.Trim(); string ipaddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (ipaddress == "" || ipaddress == null) { ipaddress = Request.ServerVariables["REMOTE_ADDR"]; } string errorLogFilename = "ErrorLog_" + DateTime.Now.ToString("dd-MM-yyyy") + ".txt"; if (ADAR.VerifyAadhaarOTP(ipaddress, Path.GetFileName(Request.Path), Server.MapPath("~/LogFiles/AadhaarErrorLog/" + errorLogFilename))) { lblAadhaarPopupDOB.Text = ADSER.DOB; lblAadhaarPopupGender.Text = ADSER.Gender; lblAadhaarPopupName.Text = ADSER.Name; lblAadhaarPopupState.Text = ADSER.State; ImgAadhaarPopupPhoto.ImageUrl = "data:image/jpg;base64," + Convert.ToBase64String(ADSER.Photo, 0, (ADSER.Photo).Length); lblAadhaarPopupPincode.Text = ADSER.Pincode; lblAadhaarPopupDistrict.Text = ADSER.District; AadhaarPopup.Show(); } else { AadhaarError AE = new AadhaarError(); DisplayAlert(AE.GetAadhaarErrorMessage(ADSER.OTPErrorCode), this); lblAllError.Text = ADSER.OTPErrorCode + "<br />" + AE.GetAadhaarErrorMessage(ADSER.OTPErrorCode); } }
protected void btnAadhaarGetOTP_Click(object sender, EventArgs e) { if (txtAadhaarNumber.Text.Trim().Length == 12) { if (Regex.IsMatch(txtAadhaarNumber.Text.Trim(), @"^\d+$")) { ADSER.AadhaarNumber = txtAadhaarNumber.Text.Trim(); if (ADAR.SendOTP(txtAadhaarNumber.Text.Trim())) { divMobileOTP.Visible = true; } else { AadhaarError AE = new AadhaarError(); DisplayAlert(AE.GetAadhaarErrorMessage(ADSER.SendOTPErrorCode), this); lblAllError.Text = ADSER.SendOTPErrorMessage + "<br />" + AE.GetAadhaarErrorMessage(ADSER.SendOTPErrorCode); } } else { DisplayAlert("Invalid Aadhaar Number", this); } } else { DisplayAlert("Invalid Aadhaar Number", this); } }