Пример #1
0
 protected void btnSubmitData_Click(object sender, EventArgs e)
 {
     #region VALidation
     if (txtApplicantName.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Please enter your name!');</script>");
         txtApplicantName.Focus();
         return;
     }
     else if (txtFathersName.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Please enter father name!');</script>");
         txtApplicantName.Focus();
         return;
     }
     else if (txtMothersName.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Please enter mothers name!');</script>");
         txtMothersName.Focus();
         return;
     }
     else if (txtDOB.Value == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Please select Date of birth!');</script>");
         txtDOB.Focus();
         return;
     }
     else if (txtUIDNumber.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Please enter UID Number!');</script>");
         txtUIDNumber.Focus();
         return;
     }
     else if (txt10Schoolname.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Please enter 10 School name!');</script>");
         txt10Schoolname.Focus();
         return;
     }
     else if (txt10thBoard.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Please enter 10 Board ie. U.p Board/CBSE!');</script>");
         txt10thBoard.Focus();
         return;
     }
     else if (txt10RollNo.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Please Enter Roll No');</script>");
         txt10thBoard.Focus();
         return;
     }
     else if (txt10YoP.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Please enter year of passing for 10!');</script>");
         txt10YoP.Focus();
         return;
     }
     else if (txt10TotalMarks.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Enter Total marks fro 10!');</script>");
         txt10TotalMarks.Focus();
         return;
     }
     else if (txt10MarksObtained.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Enter marks obtained for 10!');</script>");
         txt10MarksObtained.Focus();
         return;
     }
     else if (txt10Percentage.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Enter percentage for 10!');</script>");
         txt10Percentage.Focus();
         return;
     }
     else if (txt12Schoolname.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Please enter 12 School name!');</script>");
         txt10Schoolname.Focus();
         return;
     }
     else if (txt12thBoard.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Please enter 12 Board ie. U.p Board/CBSE!');</script>");
         txt10thBoard.Focus();
         return;
     }
     else if (txt12RollNo.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Please Enter Roll No');</script>");
         txt10thBoard.Focus();
         return;
     }
     else if (txt12YoP.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Enter 12 Year of Passing!');</script>");
         txt12YoP.Focus();
         return;
     }
     else if (txt12TotalMarks.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Enter 12 total marks!');</script>");
         txt12TotalMarks.Focus();
         return;
     }
     else if (txt12MarksObtained.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Enter 12 marks obtained!');</script>");
         txt12MarksObtained.Focus();
         return;
     }
     else if (txt12Percentage.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Enter 12 percentage!');</script>");
         txt12Percentage.Focus();
         return;
     }
     else if (txtAddressCorr.Text.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Enter Correspondence Address!');</script>");
         txtAddressCorr.Focus();
         return;
     }
     else if (txtPinCorr.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Enter pin code!');</script>");
         txtPinCorr.Focus();
         return;
     }
     else if (ddlDIsrictCorr.SelectedValue == "0")
     {
         Response.Write("<script type='text/javascript'>alert('select District Name!');</script>");
         ddlDIsrictCorr.Focus();
         return;
     }
     else if (txtAddress_per.Text.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Enter Permanent Address!');</script>");
         txtAddress_per.Focus();
         return;
     }
     else if (txtPin_Per.Value.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Enter Pin Code for permanent address!');</script>");
         txtPin_Per.Focus();
         return;
     }
     else if (ddlDIsrictCorr.SelectedValue == "0")
     {
         Response.Write("<script type='text/javascript'>alert('select District!');</script>");
         ddlDIsrictCorr.Focus();
         return;
     }
     else if (txtCategory.Text.Trim() == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Enter Category!');</script>");
         txtCategory.Focus();
         return;
     }
     else if (Session["photoFileName"] == null)
     {
         Response.Write("<script type='text/javascript'>alert('Upload Photograph!');</script>");
         FileUpload1.Focus();
         return;
     }
     else if (Session["SignFileName"] == null)
     {
         Response.Write("<script type='text/javascript'>alert('Upload Signature!');</script>");
         FileUpload2.Focus();
         return;
     }
     else if (email.Text == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Enter Email ID!');</script>");
         email.Focus();
         return;
     }
     else if (phone.Text == string.Empty)
     {
         Response.Write("<script type='text/javascript'>alert('Enter Phone Number!');</script>");
         phone.Focus();
         return;
     }
     else if (!chkAccepttheAgreement.Checked)
     {
         Response.Write("<script type='text/javascript'>alert('Please Select the Declaration Agreement!');</script>");
         chkAccepttheAgreement.Focus();
         return;
     }
     #endregion
     UserRegistration user = new UserRegistration();
     user.Name                    = txtApplicantName.Value;
     user.FatherName              = txtFathersName.Value;
     user.MothersName             = txtMothersName.Value;
     user.DOB                     = txtDOB.Value;
     user.UID_No                  = txtUIDNumber.Value;
     user.school_Name_HSS         = txt10Schoolname.Value;
     user.Board_Name_HSS          = txt10thBoard.Value;
     user.Roll_No_HSS             = txt10RollNo.Value;
     user.YOP_HSS                 = txt10YoP.Value;
     user.Total_Marks_HSS         = txt10TotalMarks.Value;
     user.Marks_Obtained_HSS      = txt10MarksObtained.Value;
     user.Marks_Perc_HSS          = txt10Percentage.Value;
     user.school_Name_SSC         = txt12Schoolname.Value;
     user.Board_Name_SSC          = txt12thBoard.Value;
     user.Roll_No_SSC             = txt12RollNo.Value;
     user.YOP_SSC                 = txt12YoP.Value;
     user.Total_Marks_SSC         = txt12TotalMarks.Value;
     user.Marks_Obtained_SSC      = txt12MarksObtained.Value;
     user.Marks_Per_SSC           = txt12Percentage.Value;
     user.AddressPermanent        = txtAddress_per.Text;
     user.PinCodePermanent        = txtPin_Per.Value;
     user.DistrictPermanent       = ddlDistrict.SelectedValue;
     user.StatePermanent          = ddlState.SelectedValue;
     user.AddressCorrespondence   = txtAddressCorr.Text;
     user.PinCodeCorrespondence   = txtPinCorr.Value;
     user.DistrictCorrespondence  = ddlDIsrictCorr.SelectedValue;
     user.StateCorrespondence     = ddlState.SelectedValue;
     user.PictureName             = Session["photoFileName"].ToString();
     user.Signature               = Session["SignFileName"].ToString();
     user.RegistrationMode        = "Education";
     user.Candidate_Category      = txtCategory.Text;
     user.isEconomicalDisabledGen = ChkEcDisabledGen.Checked == true ? true : false;
     int CandidateId = 0;
     if (new Utilities().submitUserData(user, ref CandidateId))
     {
         doPayment(user);
         string RegistrationNumber = DateTime.Now.Year + "/" + DateTime.Now.Month + "/" + DateTime.Now.Day + "/" + CandidateId;
         // Response.Write("<script type='text/javascript'>alert('Candidate Registered With Registration Number " + RegistrationNumber + "');</script>");
     }
 }