protected void TxtAdhaarNo_TextChanged(object sender, EventArgs e) { bool abc = Verhoeff.validateVerhoeff(TxtAdhaarNo.Text); if (abc == true) { } else { lblaadharerror.Text = "Aadhar card is not valid"; } }
protected void a3_TextChanged(object sender, EventArgs e) { string aadharid = a1.Text + a2.Text + a3.Text; string aid = Verhoeff.validateVerhoeff(aadharid).ToString(); if (aid == "True") { } else { objCommon.ShowAlertMessage("InValid Aadhaar ID -Please Check"); a1.Text = ""; a2.Text = ""; a3.Text = ""; return; } }
protected bool Validate_Save() { if (ddl_AnimalType.SelectedValue == "0") { objCommon.ShowAlertMessage("Select AnimalType"); ddl_AnimalType.Focus(); return(false); } if (ddlBreed.SelectedValue == "0") { objCommon.ShowAlertMessage("Select Breed"); ddlBreed.Focus(); return(false); } if ((!rbnFemale.Checked) && (!rbnMale.Checked)) { objCommon.ShowAlertMessage("Select Gender"); return(false); } if (txtAnimalAge.Text.Trim() == "") { objCommon.ShowAlertMessage("Enter Animal Age"); txtAnimalAge.Focus(); return(false); } if (txtAnimalOwner.Text == "") { objCommon.ShowAlertMessage("Enter Owner Name"); txtAnimalOwner.Focus(); return(false); } if (ddl_dist_code.SelectedValue == "0") { objCommon.ShowAlertMessage("Select District"); ddl_dist_code.Focus(); return(false); } if (ddl_mandal_code.SelectedValue == "0") { objCommon.ShowAlertMessage("Select Mandal"); ddl_mandal_code.Focus(); return(false); } if (txtvillage.Text == "") { objCommon.ShowAlertMessage("Enter City/Village"); txtvillage.Focus(); return(false); } if (txtmbno.Text == "") { objCommon.ShowAlertMessage("Please Enter Mobile Number"); return(false); } else { if (!objValidate.ISMobileNo(txtmbno.Text, 9, 9)) { objCommon.ShowAlertMessage("Please Enter Valid Mobile Number"); return(false); } } if (rdExempted.SelectedIndex < 0) { objCommon.ShowAlertMessage("Select an option for Exempted Category"); rdExempted.Focus(); return(false); } if (txtVdate.Text.Trim() != "") { if (!objValidate.IsDate(txtVdate.Text.Trim())) { objCommon.ShowAlertMessage("Enter Valid Visit Date"); txtVdate.Focus(); return(false); } } if (a1.Text == "" || a2.Text == "" || a3.Text == "") { objCommon.ShowAlertMessage("Please Enter Aadhaar Number"); return(false); } else if (a1.Text.Length != 4 || a2.Text.Length != 4 || a3.Text.Length != 4) { objCommon.ShowAlertMessage("Please Enter Valid Aadhaar Number"); return(false); } else { if (!objValidate.IsNumberOk(a1.Text + a2.Text + a3.Text)) { objCommon.ShowAlertMessage("Enter Valid Aadhar No"); txtVdate.Focus(); return(false); } string aid = Verhoeff.validateVerhoeff(a1.Text + a2.Text + a3.Text).ToString(); if (aid == "True") { } else { objCommon.ShowAlertMessage("InValid Aadhaar ID -Please Check"); a1.Text = ""; a2.Text = ""; a3.Text = ""; return(false); } } if (ddlcategory.SelectedValue == "0") { objCommon.ShowAlertMessage("Select Category"); ddl_mandal_code.Focus(); return(false); } string purposelist = ""; foreach (System.Web.UI.WebControls.ListItem item in ddlpurpose.Items) { if (item.Selected) { if (purposelist == "") { purposelist += item.Value; } else { purposelist += "," + item.Value; } } } if (purposelist == "") { objCommon.ShowAlertMessage("Please Select Purpose"); return(false); } return(true); }
protected void btnSave_Click(object sender, EventArgs e) { lblErrMsg.Text = ""; var dateformat = DateTime.Parse(txtDOb.Text); string datea = dateformat.ToString("yyyy-MM-dd"); DateTime d1 = new DateTime(2017, 12, 31); DateTime d2 = Convert.ToDateTime(datea); dateclass date = new dateclass(); date = date.DateDifference(d1, d2); Int32 year = date.Pyear; Int32 month = date.Pmonth; Int32 day = date.Pday; double Age = year + month / 12 + day / 30.5; bool abc = Verhoeff.validateVerhoeff(TxtAdhaarNo.Text); if (abc == true) { con.Open(); SqlCommand cmd = new SqlCommand("Select Start_Date,End_Date FROM tblpost where Id ='" + ddlpost.SelectedValue + "'", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet dsAge = new DataSet(); da.Fill(dsAge); lblaadharerror.Text = ""; if (Age >= Convert.ToInt32(dsAge.Tables[0].Rows[0]["Start_Date"]) && rbtnGover.SelectedValue == "No" && Age <= Convert.ToInt32(dsAge.Tables[0].Rows[0]["End_Date"])) { entryobj.PostCode = ddlpost.SelectedValue; entryobj.CandidateName = txtName.Text.Trim(); entryobj.FatherHusbandName = txtFname.Text.Trim(); entryobj.MotherName = txtMname.Text.Trim(); entryobj.Aadharnumber = TxtAdhaarNo.Text.Trim(); entryobj.Retiredemployee = rbtnGover.SelectedValue; IFormatProvider provider = new System.Globalization.CultureInfo("en-CA", true); String datetime = txtDOb.Text.Trim(); Session["PostCode"] = ddlpost.SelectedValue; Session["PostName"] = ddlpost.SelectedItem.Text; Session["CandidateName"] = txtName.Text.Trim(); Session["FatherHusbandName"] = txtFname.Text.Trim(); Session["MotherName"] = txtMname.Text.Trim(); Session["DOB"] = txtDOb.Text.Trim(); CheckIfExist(); } else if (Age >= Convert.ToInt32(dsAge.Tables[0].Rows[0]["Start_Date"]) && Age <= 62 && rbtnGover.SelectedValue == "Yes") { entryobj.PostCode = ddlpost.SelectedValue; entryobj.CandidateName = txtName.Text.Trim(); entryobj.FatherHusbandName = txtFname.Text.Trim(); entryobj.MotherName = txtMname.Text.Trim(); IFormatProvider provider = new System.Globalization.CultureInfo("en-CA", true); String datetime = txtDOb.Text.Trim(); Session["PostCode"] = ddlpost.SelectedValue; Session["PostName"] = ddlpost.SelectedItem.Text; Session["CandidateName"] = txtName.Text.Trim(); Session["FatherHusbandName"] = txtFname.Text.Trim(); Session["MotherName"] = txtMname.Text.Trim(); Session["DOB"] = txtDOb.Text.Trim(); Session["Aadharnumber"] = txtDOb.Text.Trim(); CheckIfExist(); } else { if (rbtnGover.SelectedValue == "Yes" && Age >= Convert.ToInt32(dsAge.Tables[0].Rows[0]["Start_Date"]) && Age >= 62) { lblErrMsg.Text = "You are Over Age"; lblErrMsg.Visible = true; } else { if (Age <= Convert.ToInt32(dsAge.Tables[0].Rows[0]["Start_Date"]) && Age <= Convert.ToInt32(dsAge.Tables[0].Rows[0]["End_Date"])) { lblErrMsg.Text = "You are Under Age"; lblErrMsg.Visible = true; } else { lblErrMsg.Text = "You are Over Age"; lblErrMsg.Visible = true; } } } } else { lblaadharerror.Text = "Aadhar card is not valid"; } }