protected void Button1_Click(object sender, EventArgs e) { string msg = file_upload(FileUpload1); if (msg.Equals("-1")) { Response.Write("<script>alert('Some error in uploading image.......');</script>"); } else { Applicants ap = new Applicants(); ap.ap_cninc = txtcnic.Text; ap.ap_password = txtpassword.Text; ap.ap_name = username.Text; ap.ap_phone1 = contact1.Text; ap.ap_phone2 = contact2.Text; ap.ap_image = msg; ap.ap_dob = Convert.ToDateTime(Calendar1.SelectedDate.ToShortDateString()); ap.ap_email = txtemail.Text; if (Male.Checked == true) { ap.ap_gender = 1; } else { ap.ap_gender = 0; } ApplicantLogicLayer obj = new ApplicantLogicLayer(); string msg2 = obj.insert(ap); if (msg2.Equals("1")) { Response.Write("<script>alert('Data Successfully Uploaded.......');</script>"); } } }//btn event end,,,,,,
protected void Button1_Click(object sender, EventArgs e) { if (Page.IsValid) { if (txtpassword.Text == txtcpassword.Text) { string msg = file_upload(ImageUploadUser); if (msg.Equals("-1")) { Response.Write("<script>alert('some error with the mage!'); </script>"); } else { Applicant ap = new Applicant(); ap.ap_aadhar = txtAadhar.Text; ap.ap_password = txtpassword.Text; ap.ap_name = txtusername.Text; ap.ap_phone1 = txtcontact.Text; ap.ap_phone2 = txtcontact2.Text; ap.ap_email = txtemailid.Text; ap.ap_image = msg; ap.ap_dob = new DateTime(); ap.ap_dob = Convert.ToDateTime(DropDownList1.SelectedItem.ToString() + "-" + DropDownList2.SelectedItem.ToString() + "-" + DropDownList3.SelectedItem.ToString()); if (Male.Checked == true) { ap.ap_gender = 1; } else { ap.ap_gender = 0; } ApplicantLogicLayer apl = new ApplicantLogicLayer(); string msg2 = apl.insert(ap); if (msg2.Equals("1")) { Response.Write("<script>alert('Data successfully added!'); </script>"); Response.Redirect("~/Views/Applicant/Login.aspx"); } else { Response.Write("<script>alert('data could not successfully uploaded...plz try again '); </script> "); } } } else { Response.Write("<script>alert('Password Mismatch');</script>"); } } } // Event end here