using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Sapphire.Ohu.BaseFramework.Utilities;
using System.Data;
using Sapphire.Ohu.BusinessLogic.Framework.BaseFrameworkBL.Security;
using Sapphire.Vidyalaya.BusinessLogic.Business.StudentManagement.StudentBL;
using System.Text.RegularExpressions;
using Sapphire.Ohu.BusinessEntity.Framework.BaseFrameworkBE;
using Sapphire.Ohu.Web.SessionHelper;
using Sapphire.Ohu.Web.Helper;
using Sapphire.Ohu.BaseFramework.Exceptions;
using System.IO;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using Sapphire.Vidyalaya.BusinessEntity.Business.StudentManagementBE;
using Sapphire.Ohu.BusinessEntity.Application.MasterBE;
using Sapphire.Ohu.BusinessEntity.Component.AlertBE;
using Sapphire.Vidyalaya.Components.Alert.AlertNotification;
using Sapphire.Ohu.BusinessLogic.Component.AlertBL;
//using System.Windows.Forms;
//using Sapphire.Ohu.Web.PageController;

public partial class Pages_StudentManagement_StudentOnlineRegistrationForm : System.Web.UI.Page
{
    private string IsDefaultGenderId;
    private int OrgGroupId = 0, BatchId = 0;
    private Int64 StudentId = 0;
    private bool IsAddStudentFullDetail = false;
    Boolean AdmissionDateDefault = false;
    ControllHelper ControllHelperObject = new ControllHelper();
    public static int ContactNoDigitValidation = 0;
    public static int StudentUIDNumberDigitValidation = 0;
    private string GenderType = "";     // MantisId : 0034447
    private StudentService StudentServiceClient
    {
        get
        {
            return new StudentService();
        }
    }
    private SecurityService GetSecurityServiceClient()
    {
        return new SecurityService();
    }

    private CommunicationService CommunicationServiceClient
    {
        get
        {
            return new CommunicationService();
        }
    }
    private CommonFunctions CommonFunctionsServiceClient
    {
        get
        {
            return new CommonFunctions();
        }

    }

    private CommonFunctions CommonFunctionServiceClient
    {
        get
        {
            return new CommonFunctions();
        }
    }
    private SMSConfigurationService SMSConfigurationServiceClient
    {
        get
        {
            return new SMSConfigurationService();
        }
    }

    private AlertService AlertServiceClient
    {
        get
        {
            return new AlertService();
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        //Session["OnlineStudentAdmissionBatchId"] = Request.QueryString["BatchId"];
        if (Request.QueryString["OrgGroupId"] != null)
            Session["OnlineOrgGroupId"] = Request.QueryString["OrgGroupId"];
        //else
        //    Session["OnlineStudentAdmissionOrgGroupId"] = Session["OnlineStudentOrgGroupId"];
        string orgQuery = "Select Isnull(Title,'') AS Title from sSetup.tOrgGroupMaster where Id=" + Int64.Parse(Session["OnlineOrgGroupId"].ToString()) + "";
        CommonFunctions CFschool = new CommonFunctions();
        DataSet SchoolName = CFschool.GetDataset(orgQuery);
        schoolnameLabel.Text = SchoolName.Tables[0].Rows[0][0].ToString();
        //BatchId = Int32.Parse(Session["OnlineStudentAdmissionBatchId"].ToString());
        if (OrgGroupId == 0)
            OrgGroupId = Int32.Parse(Session["OnlineOrgGroupId"].ToString());
        //if (BatchId == 0)
        //    BatchId = SecuritySession.UserProfile.BatchId;
        StudentId = Convert.ToInt64(Session["OnlineStdentId"]);
        //if (Session["FeeManagement_FeeReceipt"] != null)
        //    IsAddStudentFullDetail = true;

        //if (IsAddStudentFullDetail == true)
        //    BackButton.Enabled = false;
        //else
        //    BackButton.Enabled = true;
        CommonFunctions Configcf = new CommonFunctions();
        string GetImageOptimizeConfigValue = "IF EXISTS (SELECT 1 FROM sConfig.tConfigurationSetup WHERE ConfigurationId = 433 AND SourceTypeId = 2010 AND SourceId = " + OrgGroupId + ") BEGIN (SELECT ItemValue FROM sConfig.tConfigurationSetup WHERE ConfigurationId = 433 AND SourceTypeId = 2010 AND SourceId = " + OrgGroupId + ") END ELSE BEGIN SELECT 'False' AS ItemValue END";
        DataSet GetImageOptimizeDS = Configcf.GetDataset(GetImageOptimizeConfigValue);
        if (GetImageOptimizeDS != null && GetImageOptimizeDS.Tables.Count > 0 && GetImageOptimizeDS.Tables[0].Rows.Count > 0)
        {
            AttachmentSizeHiddenField.Value = GetImageOptimizeDS.Tables[0].Rows[0]["ItemValue"].ToString();
        }
        //by megha for this 0026961 
        StudentUIDNumberDigitValidation = Convert.ToInt32(ConfigurationHelper.GetUserConfigurationValueDirect(OrgGroupId, 0, 0, "Student.StudentUIDNumberDigitValidation"));  // Changes for Mantis Id:0031523
        //by megha for this 0027172
        ContactNoDigitValidation = Convert.ToInt32(ConfigurationHelper.GetUserConfigurationValueDirect(OrgGroupId, 0, 0, "sStudent.StudentContactNoDigitValidation")); // Changes for Mantis Id:0031523
        if (OrgDropDownList.SelectedIndex > 0)      // MantisId : 0034447
            GenderType = ConfigurationHelper.GetUserConfigurationValueDirect(OrgGroupId, Convert.ToInt32(OrgDropDownList.SelectedValue), 0, "Common.OrganizationGenderType");

        if (!IsPostBack)
        {
            //base.SetScreenTitle(StudentManagementScreenId.Student.StudentAll);
            //AdmissionYearLabel.Visible = false;
            //AdmissionYearTextBox.Visible = false;
            TransferFromTextBox.Enabled = false;
            CertificateNameTextBox.Enabled = false;
            // Function To Handle Page Load Activities
            PageLoadActivities();
            if (AdmissionDateDefault == true)
                AdmissionDateDatePickerControl.Text = DateTime.Now.ToString();
            else
                AdmissionDateDatePickerControl.Text = "";
            //getmandatoryFeield();
            //GetStudentDetail();
            //GetSiblingDataList();
            //GetDisplayField();
            AddOptionSubjectLinkButton.Checked = false;
            AddOptionSubjectLinkButton_CheckedChanged(null, null);
            Session["otp"] = null;
            if (Session["OnlineStdentId"] != null)
            {
                //DataSet oldds = (DataSet)Session["AdmissionFormDetails"];

                string SQL_String = string.Empty;
                List<DataParameter> dp = new List<DataParameter>();
                DataParameter d;

                d = new DataParameter { Name = "@rStudentId", Value = Session["OnlineStdentId"], DataType = System.Data.DbType.Int64 };
                dp.Add(d);
                d = new DataParameter { Name = "@rCode", Value = null, DataType = System.Data.DbType.String };
                dp.Add(d);
                d = new DataParameter { Name = "@rOrgId", Value = Session["OnlineOrgId"], DataType = System.Data.DbType.Int32 };
                dp.Add(d);
                d = new DataParameter { Name = "@rBatchId", Value = BatchId, DataType = System.Data.DbType.Int64 };
                dp.Add(d);

                CommonFunctions cf = new CommonFunctions();
                DataSet OnlineStudentSearchGetds = cf.GetDatasetFromSp("sStudent.pOnlineStudentSearchGet", dp);
                //LoadDropdownList();

                //if (Session["AdmissionFormId"] != null)
                //{
                //    ViewState["IsEditMode"] = "Y";
                //    //ViewState["AdhaarNumber"] = oldds.Tables[0].Rows[0]["FatherAdhaarNumber"].ToString();
                //}
                //else
                //    ViewState["IsEditMode"] = "N";



                //if (ds.Tables[0].Rows[0]["DataEntryStatusId"] != DBNull.Value && (int.Parse(ds.Tables[0].Rows[0]["DataEntryStatusId"].ToString()) == 572 || int.Parse(ds.Tables[0].Rows[0]["DataEntryStatusId"].ToString()) == 707))
                //{
                //    Response.Redirect("FormConfirmation.aspx", false);
                //    Context.ApplicationInstance.CompleteRequest();
                //}
                //else
                //{
                ListItem li1 = new ListItem("- Select -", "-1");
                BatchDropDownList.Items.Clear();
                BatchDropDownList.Items.Insert(0, li1);
                ClassIdDropDownList.Items.Clear();
                ClassIdDropDownList.Items.Insert(0, li1);
                FillOrgDropDownList();
                //LoadDropDownList();
                if (OrgDropDownList.Items.Count > 1)
                    OrgDropDownList.SelectedIndex = 1;
                else
                    OrgDropDownList.SelectedIndex = 0;
                OrgDropDownList.SelectedValue = OnlineStudentSearchGetds.Tables[0].Rows[0]["OrgId"].ToString();
                OrgDropDownList_OnSelectedIndexChanged(null, null);
                BatchDropDownList.SelectedValue = OnlineStudentSearchGetds.Tables[0].Rows[0]["BatchId"].ToString();
                BatchDropDownList_OnSelectedIndexChanged(null, null);
                ClassIdDropDownList.SelectedValue = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["ClassId"]);
                ClassIdDropDownList.Enabled = false;
                ClassIdDropDownList_SelectedIndexChanged(null, null);
                IdNoTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["Code"]);
                IdNoTextBox.Enabled = false;
                FirstNameTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["FirstName"]);
                FirstNameTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["FirstName"]);
                MiddleNameTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["MiddleName"]);
                SurnameTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["LastName"]);
                DivisionIdDropDownList.SelectedValue = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["DivisionId"]);
                GenderDropDownList.Visible = true;
                GenderDropDownListLabel.Visible = true;
                GenderTextBox.Visible = false;
                GenderTextBoxLabel.Visible = false;
                if (GenderType.ToUpper().Trim() == "MALE")
                {
                    if (Byte.Parse(OnlineStudentSearchGetds.Tables[0].Rows[0]["GenderId"].ToString()) == 1)
                        GenderDropDownList.SelectedValue = OnlineStudentSearchGetds.Tables[0].Rows[0]["GenderId"].ToString();
                    else
                    {
                        GenderDropDownList.Visible = false;
                        GenderDropDownListLabel.Visible = false;
                        GenderTextBox.Visible = true;
                        GenderTextBoxLabel.Visible = true;
                        GenderTextBox.Text = "Female";
                    }
                }
                else if (GenderType.ToUpper().Trim() == "FEMALE")
                {
                    if (Byte.Parse(OnlineStudentSearchGetds.Tables[0].Rows[0]["GenderId"].ToString()) == 2)
                        GenderDropDownList.SelectedValue = OnlineStudentSearchGetds.Tables[0].Rows[0]["GenderId"].ToString();
                    else
                    {
                        GenderDropDownList.Visible = false;
                        GenderDropDownListLabel.Visible = false;
                        GenderTextBox.Visible = true;
                        GenderTextBoxLabel.Visible = true;
                        GenderTextBox.Text = "Male";
                    }
                }
                else
                    GenderDropDownList.SelectedValue = OnlineStudentSearchGetds.Tables[0].Rows[0]["GenderId"].ToString();
                DateofBirthDatePickerControl.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["DateOfBirth"].ToString().Replace("01/01/0001 00:00:00", "").Replace("00:00:00", ""));
                //OrgDropDownList.SelectedValue = ((OnlineStudentSearchGetds.Tables[0].Rows[0]["OrgId"]).ToString());
                //OrgDropDownList.Enabled = false;
                //OrgDropDownList_OnSelectedIndexChanged(sender, new EventArgs());
                BatchDropDownList.SelectedValue = ((OnlineStudentSearchGetds.Tables[0].Rows[0]["BatchId"]).ToString());
                BatchDropDownList.Enabled = false;
                //ClassIdDropDownList.SelectedValue = ((OnlineStudentSearchGetds.Tables[0].Rows[0]["ClassId"]).ToString());
                //ClassIdDropDownList_SelectedIndexChanged(null, null);
                //ClassIdDropDownList.Enabled = false;
                PreviousSchoolTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["PreviousSchool"]);
                MobileNoTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["StudentContactNo"]);
                StudentEmailTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["StudentEmail"]);
                Session["StudentStatusId"] = OnlineStudentSearchGetds.Tables[0].Rows[0]["StudentStatusId"].ToString();
                LocalAddressAddress1TextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["PresentStreetOne"]);
                LocalAddressAddress2TextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["PresentStreetTwo"]);
                LocalAddressAddress3TextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["PresentStreetThree"]);
                LocalAddressCityTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["PresentCity"]);
                LocalAddressStateTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["PresentState"]);
                LocalAddressCountryTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["PresentCountry"]);
                LocalAddressPINCodeTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["PresentZipCode"]);
                LocalAddressContactNoTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["PresentContactNo"]);
                PermanentAddressAddress1TextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["PermanentStreetOne"]);
                PermanentAddressAddress2TextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["PermanentStreetTwo"]);
                PermanentAddressAddress3TextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["PermanentStreetThree"]);
                PermanentAddressCityTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["PermanentCity"]);
                PermanentAddressStateTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["PermanentState"]);
                PermanentAddressCountryTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["PermanentCountry"]);
                PermanentAddressPINCodeTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["PermanentZipCode"]);
                PermanentAddressContactNoTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["PermanentContactNo"]);

                EmergencyAddressAddress1TextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["EmergencyStreetOne"]);
                EmergencyAddressAddress2TextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["EmergencyStreetTwo"]);
                EmergencyAddressAddress3TextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["EmergencyStreetThree"]);
                EmergencyAddressCityTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["EmergencyCity"]);
                EmergencyAddressStateTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["EmergencyState"]);
                EmergencyAddressCountryTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["EmergencyCountry"]);
                EmergencyAddressPINCodeTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["EmergencyZipCode"]);
                EmergencyAddressContactNoTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["EmergencyContactNo"]);
                WhatsAppContactNoTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["WhatsAppContactNo"]);
                DistanceFromSchoolTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["PresentDistanceFromSchool"]);
                StudentCustomAlertTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["StudentCustomAlert"]);

                ReligionDropDownList.SelectedValue = ((OnlineStudentSearchGetds.Tables[0].Rows[0]["ReligionId"]).ToString());
                FamilyCasteTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["FamilyCast"]);
                CasteCategoryDropDownList.SelectedValue = ((OnlineStudentSearchGetds.Tables[0].Rows[0]["CastCategoryId"]).ToString());
                FamilySubCasteTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["FamilySubCast"].ToString();
                NationalityDropDownList.SelectedValue = OnlineStudentSearchGetds.Tables[0].Rows[0]["NationalityId"].ToString();
                MotherTongueDropDownList.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["MotherTongue"].ToString();
                BloodGroupDropDownList.SelectedValue = OnlineStudentSearchGetds.Tables[0].Rows[0]["BloodGroupId"].ToString();
                HobbyTextBox.Text = Convert.ToString(OnlineStudentSearchGetds.Tables[0].Rows[0]["Hobby"]);
                //MeritGradeTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["MeritGrade"].ToString();
                BirthPlaceTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["BirthPlace"].ToString();
                BirthTalukaTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["BirthTaluka"].ToString();
                BirthDistrictTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["BirthDistrict"].ToString();
                BirthStateTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["BirthState"].ToString();
                BirthCountryTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["BirthCountry"].ToString();
                AadhaarNumberTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["AdhaarNumber"].ToString();

                TransportDropDownList.SelectedValue = int.Parse(OnlineStudentSearchGetds.Tables[0].Rows[0]["TransportModeId"].ToString()).ToString();
                QuotaDropDownList.SelectedValue = int.Parse(OnlineStudentSearchGetds.Tables[0].Rows[0]["QuotaId"].ToString()).ToString();


                MobileNoDiv.Visible = false;
                OTPDiv1.Visible = false;
                OTPDiv2.Visible = false;
                OTPDiv3.Visible = false;

                //IdNoDiv.Visible = true;
                //DivisionDiv.Visible = true;
                //StatusDiv.Visible = true;
                //SurnameDiv.Visible = true;
                RegisterButton.Visible = true;
                CancelButton.Visible = true;
                StudentDetailDiv.Visible = true;
                GetDisplayField();
                OnlineRegistrationCriteriaFormGridViewDisplay();
                //if (CustomField1AnswerTextBox.Visible == true)
                //    CustomField1AnswerTextBox.Text = ds.Tables[0].Rows[0]["CustomField1Answer"].ToString();
                //if (CustomField1DropDownList.Visible == true)
                //    CustomField1DropDownList.SelectedIndex = CustomField1DropDownList.Items.IndexOf(CustomField1DropDownList.Items.FindByText(ds.Tables[0].Rows[0]["CustomField1Answer"].ToString()));

                //if (CustomField2AnswerTextBox.Visible == true)
                //    CustomField2AnswerTextBox.Text = ds.Tables[0].Rows[0]["CustomField2Answer"].ToString();
                //if (CustomField2DropDownList.Visible == true)
                //    CustomField2DropDownList.SelectedIndex = CustomField2DropDownList.Items.IndexOf(CustomField2DropDownList.Items.FindByText(ds.Tables[0].Rows[0]["CustomField2Answer"].ToString()));

                //if (CustomField3AnswerTextBox.Visible == true)
                //    CustomField3AnswerTextBox.Text = ds.Tables[0].Rows[0]["CustomField3Answer"].ToString();
                //if (CustomField3DropDownList.Visible == true)
                //    CustomField3DropDownList.SelectedIndex = CustomField3DropDownList.Items.IndexOf(CustomField3DropDownList.Items.FindByText(ds.Tables[0].Rows[0]["CustomField3Answer"].ToString()));

                //string liveWith = "Select * from sAdmission.tAdmissionFormFamilyDetail where AdmissionFormId=" + Int64.Parse(oldds.Tables[0].Rows[0]["Id"].ToString()) + "";
                //DataSet liveWithDS = new DataSet();
                //CommonFunctions liveWithCF = new CommonFunctions();
                //liveWithDS = liveWithCF.GetDataset(liveWith);
                //if (liveWithDS != null && liveWithDS.Tables.Count > 0 && liveWithDS.Tables[0].Rows.Count > 0)
                LiveWithDropDownList.SelectedValue = OnlineStudentSearchGetds.Tables[0].Rows[0]["LiveWithId"].ToString();

                if (OnlineStudentSearchGetds.Tables[0].Rows[0]["StudentPhoto"] != DBNull.Value)
                {
                    byte[] imgBytes = (byte[])OnlineStudentSearchGetds.Tables[0].Rows[0]["StudentPhoto"];
                    Session["StudentPhoto"] = imgBytes;

                    string imgString = Convert.ToBase64String(imgBytes);
                    //System.Drawing.Image convertToImage = System.Drawing.Image.FromStream(new MemoryStream(Convert.FromBase64String(imgString)));
                    ////Set the source with data:image/bmp
                    StudentImage.Src = String.Format("data:image/Bmp;base64,{0}\"", imgString);
                }

                if (OnlineStudentSearchGetds.Tables[0].Rows[0]["FatherPhoto"] != DBNull.Value)
                {
                    byte[] imgBytes = (byte[])OnlineStudentSearchGetds.Tables[0].Rows[0]["FatherPhoto"];
                    Session["FatherPhoto"] = imgBytes;

                    string imgString = Convert.ToBase64String(imgBytes);
                    //System.Drawing.Image convertToImage = System.Drawing.Image.FromStream(new MemoryStream(Convert.FromBase64String(imgString)));
                    ////Set the source with data:image/bmp
                    FatherImage.Src = String.Format("data:image/Bmp;base64,{0}\"", imgString);
                }
                if (OnlineStudentSearchGetds.Tables[0].Rows[0]["MotherPhoto"] != DBNull.Value)
                {
                    byte[] imgBytes = (byte[])OnlineStudentSearchGetds.Tables[0].Rows[0]["MotherPhoto"];
                    Session["MotherPhoto"] = imgBytes;

                    string imgString = Convert.ToBase64String(imgBytes);

                    MotherImage.Src = String.Format("data:image/Bmp;base64,{0}\"", imgString);
                }
                if (OnlineStudentSearchGetds.Tables[0].Rows[0]["RelativePhoto"] != DBNull.Value)
                {
                    byte[] imgBytes = (byte[])OnlineStudentSearchGetds.Tables[0].Rows[0]["RelativePhoto"];
                    Session["RelativePhoto"] = imgBytes;


                    string imgString = Convert.ToBase64String(imgBytes);
                    //System.Drawing.Image convertToImage = System.Drawing.Image.FromStream(new MemoryStream(Convert.FromBase64String(imgString)));
                    ////Set the source with data:image/bmp
                    RelativeImage.Src = String.Format("data:image/Bmp;base64,{0}\"", imgString);
                }
                FamilyDetailFatherNameTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["FatherName"].ToString();
                FatherDateofBirthDatePickerControl.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["FatherDateOfBirth"].ToString().Replace("01/01/0001 00:00:00", "").Replace("00:00:00", "");
                FatherQualificationTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["FatherQualification"].ToString();
                FatherContactNoTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["FatherContactNo"].ToString();
                FatherMailTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["FatherMail"].ToString();
                FatherOfficeAddressTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["FatherOfficeAddress"].ToString();
                FatherIncomeTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["FatherIncome"].ToString();
                ISFatherExStudentCheckBox.Checked = Boolean.Parse(OnlineStudentSearchGetds.Tables[0].Rows[0]["IsFatherExStudent"].ToString());
                FatherPassOutYearTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["FatherPassOutYear"].ToString();
                FatherAadharNoTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["FatherAdhaarNumber"].ToString();
                FatherOfficeContactNoTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["FatherOfficeContactNo"].ToString();
                FatherOrganizationTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["FatherOrganization"].ToString();
                FatherDesignationTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["FatherDesignation"].ToString();

                MotherNameTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["MotherName"].ToString();
                MotherDateofBirthDatePickerControl.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["MotherDateOfBirth"].ToString().Replace("01/01/0001 00:00:00", "").Replace("00:00:00", "");
                MotherQualificationTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["MotherQualification"].ToString();
                MotherContactNoTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["MotherContactNo"].ToString();
                MotherMailTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["MotherMail"].ToString();
                MotherOfficeAddressTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["MotherOfficeAddress"].ToString();
                MotherIncomeTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["MotherIncome"].ToString();
                ISMotherExStudentCheckBox.Checked = Boolean.Parse(OnlineStudentSearchGetds.Tables[0].Rows[0]["IsMotherExStudent"].ToString());
                MotherPassOutYearTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["MotherPassOutYear"].ToString();
                MotherAadharNoTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["MotherAdhaarNumber"].ToString();
                MotherOfficeContactNoTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["MotherOfficeContactNo"].ToString();
                MotherOrganizationTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["MotherOrganization"].ToString();
                MotherDesignationTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["MotherDesignation"].ToString();

                RelativeNameTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["RelativeName"].ToString();
                RelativeDateofBirthDatePickerControl.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["RelativeDateOfBirth"].ToString().Replace("01/01/0001 00:00:00", "").Replace("00:00:00", "");
                RelativeQualificationTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["RelativeQualification"].ToString();
                RelativeContactNoTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["RelativeContactNo"].ToString();
                RelativeMailTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["RelativeMail"].ToString();
                RelativeOfficeAddressTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["RelativeOfficeAddress"].ToString();
                RelativeIncomeTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["RelativeIncome"].ToString();
                ISRelativeExStudentCheckBox.Checked = Boolean.Parse(OnlineStudentSearchGetds.Tables[0].Rows[0]["IsRelativeExStudent"].ToString());
                RelativePassOutYearTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["RelativePassOutYear"].ToString();
                RelationNameTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["RelationshipName"].ToString();
                RelativeOrganizationTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["RelativeOrganization"].ToString();
                RelativeDesignationTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["RelativeDesignation"].ToString();

                PreviousSchoolTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["PreviousSchool"].ToString();
                PreviousStudentIdTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["PreviousStudentId"].ToString();
                AdmissionFormNumberTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["AdmissionFormNumber"].ToString();
                AdmissionDateDatePickerControl.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["AdmissionDate"].ToString().Replace("01/01/0001 00:00:00", "").Replace("00:00:00", "");
                AdmissionYearTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["AdmissionYear"].ToString();
                LeftStandardIdDropDownList.SelectedValue = OnlineStudentSearchGetds.Tables[0].Rows[0]["LeftStandardId"].ToString();
                LeftDateDatePickerControl.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["LeftDate"].ToString().Replace("01/01/0001 00:00:00", "").Replace("00:00:00", "");
                LeftYearTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["LeftYear"].ToString();
                InActiveDateDatePickerControl.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["InactiveDate"].ToString().Replace("01/01/0001 00:00:00", "").Replace("00:00:00", "");
                InActiveReasonTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["InActiveReason"].ToString();
                LeftReasonTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["LeftReason"].ToString();
                LCProgressTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["LCProgress"].ToString();
                LCConductTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["LCConduct"].ToString();
                LCBookTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["LCBook"].ToString();
                LCNumberTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["LCNumber"].ToString();
                LCDateDatePickerControl.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["LCDate"].ToString().Replace("01/01/0001 00:00:00", "").Replace("00:00:00", "");
                LCRemarkTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["LCRemark"].ToString();
                LCCopyText.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["LCCopy"].ToString();
                LcIdTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["LcId"].ToString();
                ExamSeatNoTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["ExamSeatNo"].ToString();
                AdmissionNumberTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["AdmissionNumber"].ToString();
                IsTransferCheckBox.Checked = Boolean.Parse(OnlineStudentSearchGetds.Tables[0].Rows[0]["IsTransfer"].ToString());
                TransferFromTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["TransferFrom"].ToString();
                PassingYearTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["PassingYear"].ToString();
                IsTFWSCheckBox.Checked = Boolean.Parse(OnlineStudentSearchGetds.Tables[0].Rows[0]["IsTFWS"].ToString());
                IsCertificateHolderCheckBox.Checked = Boolean.Parse(OnlineStudentSearchGetds.Tables[0].Rows[0]["IsCertificateHolder"].ToString());
                CertificateNameTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["CertificateName"].ToString();
                AdmissionQuotaDropDownList.SelectedValue = OnlineStudentSearchGetds.Tables[0].Rows[0]["AdmissionQuotaId"].ToString();
                PreviousStandardTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["PreviousStandard"].ToString();
                PreviousLCNumberTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["PreviousLCNumber"].ToString();
                PreviousLCDateDatePickerControl.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["PreviousLCDate"].ToString().Replace("01/01/0001 00:00:00", "").Replace("00:00:00", "");
                PreviousResultTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["PreviousLCResult"].ToString();
                ProofOfDOBTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["ProofOfDOB"].ToString();
                SSCBoardTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["SSCBoard"].ToString();
                SSCSchoolTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["SSCSchool"].ToString();
                SSCPassingYearTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["SSCPassingYear"].ToString();
                SSCObtainMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["SSCObtainMarks"].ToString();
                SSCOutOfMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["SSCOutOfMarks"].ToString();
                SSCPercentageTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["SSCPercentage"].ToString();
                SSCMathMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["SSCMathMarks"].ToString();
                SSCMathOutOfMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["SSCMathOutOfMarks"].ToString();

                HSCBoardTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["HSCBoard"].ToString();
                HSCSchoolTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["HSCSchool"].ToString();
                HSCPassingYearTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["HSCPassingYear"].ToString();
                HSCObtainMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["HSCObtainMarks"].ToString();
                HSCOutOfMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["HSCOutOfMarks"].ToString();
                HSCPercentageTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["HSCPercentage"].ToString();
                HSCMathMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["HSCMathMarks"].ToString();
                HSCMathOutOfMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["HSCMathOutOfMarks"].ToString();
                HSCPhysicsMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["HSCPhysicsMarks"].ToString();
                HSCPhysicsOutOfMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["HSCPhysicsOutOfMarks"].ToString();
                HSCChemistryMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["HSCChemistryMarks"].ToString();
                HSCChemistryOutOfMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["HSCChemistryOutOfMarks"].ToString();
                HSCBiologyMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["HSCBiologyMarks"].ToString();
                HSCBiologyOutOfMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["HSCBiologyOutOfMarks"].ToString();
                PCMMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["PCMMarks"].ToString();
                PCBMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["PCBMarks"].ToString();

                JEERollNoTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["JEERollNo"].ToString();
                JEEMeritNoTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["JEEMeritNo"].ToString();
                JEEMeritMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["JEEMeritMarks"].ToString();
                DiplomaBoardTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["DiplomaBoard"].ToString();
                DiplomaCollegeTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["DiplomaCollege"].ToString();
                DiplomaPassingYearTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["DiplomaPassingYear"].ToString();
                DiplomaObtainMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["DiplomaObtainMarks"].ToString();
                DiplomaOutOfMarksTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["DiplomaOutOfMarks"].ToString();
                DiplomaPercentageTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["DiplomaPercentage"].ToString();
                ApplicationIdTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["ApplicationNo"].ToString();
                AdmissionRoundTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["AdmissionRound"].ToString();
                MaritalStatusDropDownList.SelectedValue = OnlineStudentSearchGetds.Tables[0].Rows[0]["MaritalStatusId"].ToString();
                SSCPercentileTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["SSCPercentile"].ToString();
                SSCGradeTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["SSCGrade"].ToString();


                BirthPlaceTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["BirthPlace"].ToString();
                BirthPlaceTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["BirthPlace"].ToString();
                //--Added by dhananjay for mantis start - 33982
                ISPhysicalDeformityChkbox.Checked = bool.Parse(OnlineStudentSearchGetds.Tables[0].Rows[0]["IsPysicalDeformity"].ToString());
                PhysicalDropDownList.SelectedValue = OnlineStudentSearchGetds.Tables[0].Rows[0]["PhysicalDisabilityCategoryId"].ToString();
                PhysicalDisabilityTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["PysicalDeformityRemark"].ToString();
                MajorIllnessCheckBox.Checked = bool.Parse(OnlineStudentSearchGetds.Tables[0].Rows[0]["IsMajorIllness"].ToString());
                MajorIllnessTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["MajorIllnessRemark"].ToString();
                PastHistoryCheckBox.Checked = bool.Parse(OnlineStudentSearchGetds.Tables[0].Rows[0]["IsPastHistory"].ToString());
                PastHistoryTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["PastHistoryRemark"].ToString();
                AllergyCheckBox.Checked = bool.Parse(OnlineStudentSearchGetds.Tables[0].Rows[0]["IsAllergy"].ToString());
                AllergyTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["AllergyRemark"].ToString();
                IdentificationMark1TextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["IdentificationMark1"].ToString();
                IdentificationMark2TextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["IdentificationMark2"].ToString();
                FamilyDoctorNameTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["FamilyDoctorName"].ToString();
                FamilyDoctorContactNoTextBox.Text = OnlineStudentSearchGetds.Tables[0].Rows[0]["FamilyDoctorContactNo"].ToString();
                //--Added by dhananjay for mantis End - 33982


                //string SQL_CriteriaGet = "Select * from sAdmission.tAdmissionCriteria where ClassId=" + StandardDropDownList.SelectedValue + " AND BatchId=" + BatchDropDownList.SelectedValue;
                //CommonFunctions CriteriaGetcf = new CommonFunctions();
                //DataSet CriteriaGetDS = new DataSet();
                //CriteriaGetDS = CriteriaGetcf.GetDataset(SQL_CriteriaGet);

                //Assign Optional Subject
                if (OptionalSubjectDiv.Visible)
                {
                    AssignOptionalSubjectCheckBoxList.Items.Clear();
                    string AssignOptionalSubject = "SELECT CS.Id,SM.Title FROM [sStudent].[tOnlineRegistrationCriteriaOptionalSubject] COS INNER JOIN sSetup.tClassSubject CS ON COS.ClassSubjectId = CS.Id " +
                        " INNER JOIN sSetup.tSubjectMaster SM ON SM.Id = CS.SubjectId WHERE COS.ClassId = " + ClassIdDropDownList.SelectedValue + " AND COS.BatchId = " + BatchDropDownList.SelectedValue;
                    DataSet OptionalSubjectDS = cf.GetDataset(AssignOptionalSubject);
                    if (OptionalSubjectDS != null && OptionalSubjectDS.Tables.Count > 0 && OptionalSubjectDS.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < OptionalSubjectDS.Tables[0].Rows.Count; i++)
                            AssignOptionalSubjectCheckBoxList.Items.Add(new ListItem(OptionalSubjectDS.Tables[0].Rows[i]["Title"].ToString(), OptionalSubjectDS.Tables[0].Rows[i]["Id"].ToString()));
                    }


                    string GetOptionalSubject = "SELECT APS.ClassSubjectId AS Id, SM.Title FROM sStudent.tOnlineRegistrationStudentOptionalSubject APS " +
                        " INNER JOIN sSetup.tClassSubject CS ON CS.Id = APS.ClassSubjectId " +
                        " INNER JOIN sSetup.tSubjectMaster SM ON SM.Id = CS.SubjectId WHERE APS.OnlineRegistrationStudentId = " + Session["OnlineStdentId"].ToString();
                    DataSet GetOptionalSubjectDS = cf.GetDataset(GetOptionalSubject);
                    if (GetOptionalSubjectDS != null && GetOptionalSubjectDS.Tables.Count > 0 && GetOptionalSubjectDS.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < GetOptionalSubjectDS.Tables[0].Rows.Count; i++)
                        {
                            for (int y = 0; y < AssignOptionalSubjectCheckBoxList.Items.Count; y++)
                            {
                                if (AssignOptionalSubjectCheckBoxList.Items[y].Value == GetOptionalSubjectDS.Tables[0].Rows[i]["Id"].ToString())
                                    AssignOptionalSubjectCheckBoxList.Items[y].Selected = true;
                            }
                        }
                    }
                }

                StandardDropDownList_SelectedIndexChanged(null, null);
                // OnlineRegistrationCriteriaFormGridViewDisplay()
                //}
            }

        }
        Session["FatherPhoto"] = null;
        Session["MotherPhoto"] = null;
        Session["GuardianPhoto"] = null;
        Session["StudentPhoto"] = null;
        Session["StudentImageBytes"] = null;
        Session["FatherImageBytes"] = null;
        Session["MotherImageBytes"] = null;
        Session["GuardianImageBytes"] = null;
    }


    protected void OrgDropDownList_OnSelectedIndexChanged(object sender, EventArgs e)
    {
        OrgDropDownList.Focus();
        DataSet ds;
        //ds = (DataSet)Session["AdmissionFormDetails"];
        try
        {
            if (OrgDropDownList.SelectedIndex > 0)
            {
                //FillBatchDropDownList();
                BatchDropDownList.SelectedIndex = -1;
                string Query = "Select Id AS BatchId,Title AS BatchName from sSetup.tBatchMaster Where OrgId = " + OrgDropDownList.SelectedValue;

                ControllHelperObject.LoadDropDownList(BatchDropDownList, Query, "BatchId", "BatchName", false);
                if (BatchDropDownList.Items.Count > 0)
                {
                    BatchDropDownList.SelectedIndex = 1;

                }

                BatchDropDownList_OnSelectedIndexChanged(null, null);
                ControllHelperObject.LoadDropDownListForGender(GenderDropDownList, Convert.ToInt32(Session["OnlineOrgGroupId"].ToString()), Convert.ToInt32(OrgDropDownList.SelectedValue), false);
            }

            else
            {
                ListItem li = new ListItem("- Select -", "-1");
                BatchDropDownList.Items.Clear();
                BatchDropDownList.Items.Insert(0, li);

            }
        }

        catch (Exception ex)
        {
            throw ex;
        }
    }
    protected void StandardDropDownList_SelectedIndexChanged(object sender, EventArgs e)
    {
        failurebdaymessage.Visible = false;
        GetDisplayField();
        //if (StandardDropDownList.SelectedIndex == 0)
        //{
        //    AgeTextBox.Text = string.Empty;
        //    ScriptManager.RegisterStartupScript(this, typeof(string), "Alert", "alert('Select Class');", true);
        //}
        //else if (!string.IsNullOrEmpty(BirthDateTextBox.Text))
        //{
        //    BirthDateTextBox_TextChanged(null, null);
        //}

        //else
        //{
        //    AgeTextBox.Text = string.Empty;
        //}

        //if (StandardDropDownList.SelectedIndex > 0)
        //{
        //    GetDisplayField();
        //    DataSet oldds = (DataSet)Session["AdmissionFormDetails"];
        //    List<DataParameter> dp = new List<DataParameter>();
        //    DataParameter d;
        //    d = new DataParameter { Name = "@rClassId", Value = StandardDropDownList.SelectedValue, DataType = System.Data.DbType.Int32 };
        //    dp.Add(d);
        //    d = new DataParameter { Name = "@rBatchId", Value = BatchDropDownList.SelectedValue, DataType = System.Data.DbType.Int32 };
        //    dp.Add(d);
        //    //string SQL_CriteriaGet = "Select * from sAdmission.tAdmissionCriteria where ClassId=" + StandardDropDownList.SelectedValue + " AND BatchId=" + BatchDropDownList.SelectedValue;
        //    CommonFunctions CriteriaGetcf = new CommonFunctions();
        //    DataSet AdmissionCriteriaDS = new DataSet();
        //    AdmissionCriteriaDS = CriteriaGetcf.GetDatasetFromSp("[sAdmission].[pAdmissionCriteriaOnlineGet]", dp);
        //    Session["AdmissionCriteria"] = AdmissionCriteriaDS;

        //    string IsSiblingDetailRequired = null;
        //    // string IsStudentAcademicRequired = null;
        //    string IsFixStudentAcademic = null;
        //    string IsFamilyDetailRequired = null;
        //    string IsReferenceDetailRequired = null;
        //    //string IsParentAcademicRequired = null;
        //    string IsFixParentAcademic = null;
        //    string IsHostelDetailRequired = null;
        //    string IsTransportDetailRequired = null;
        //    string IsHealthDetailRequired = null;
        //    string IsBirthPlaceDetailRequired = null;
        //    string IsAadhaarDetailRequired = null;
        //    string IsBloodGroupDetailRequired = null;
        //    string IsFatherDetailRequired = null;
        //    string IsFatherFullDetailRequired = null;
        //    string IsFatherAcademicRequired = null;
        //    string IsMotherDetailRequired = null;
        //    string IsMotherFullDetailRequired = null;
        //    string IsMotherAcademicRequired = null;
        //    string IsGuardianDetailRequired = null;
        //    string IsGuardianFullDetailRequired = null;
        //    string IsGuardianAcademicRequired = null;
        //    bool IsotherdeatilRequired = false;
        //    AdmissionRemarkLabel.Text = string.Empty;
        //    remarkdiv.Visible = false;
        //    if (AdmissionCriteriaDS.Tables[0].Rows.Count > 0 && AdmissionCriteriaDS != null)
        //    {
        //        if (AdmissionCriteriaDS.Tables[0].Rows[0]["AdmissionFormRemark"].ToString() != null && AdmissionCriteriaDS.Tables[0].Rows[0]["AdmissionFormRemark"].ToString() != "")
        //        {
        //            AdmissionRemarkLabel.Text = (AdmissionCriteriaDS.Tables[0].Rows[0]["AdmissionFormRemark"]).ToString();
        //            remarkdiv.Visible = true;
        //        }
        //        else
        //        {
        //            AdmissionRemarkLabel.Text = string.Empty;
        //            remarkdiv.Visible = false;
        //        }
        //        IsSiblingDetailRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsSiblingDetailRequired"]).ToString();
        //        //IsStudentAcademicRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsStudentAcademicRequired"]).ToString();
        //        IsFixStudentAcademic = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsFixStudentAcademic"]).ToString();
        //        IsFamilyDetailRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsFamilyDetailRequired"]).ToString();
        //        IsReferenceDetailRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsReferenceDetailRequired"]).ToString();
        //        // IsParentAcademicRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsParentAcademicRequired"]).ToString();
        //        IsFixParentAcademic = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsFixParentAcademic"]).ToString();
        //        IsHostelDetailRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsHostelDetailRequired"]).ToString();
        //        IsTransportDetailRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsTransportDetailRequired"]).ToString();
        //        IsHealthDetailRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsHealthDetailRequired"]).ToString();
        //        IsBirthPlaceDetailRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsBirthPlaceDetailRequired"]).ToString();
        //        IsAadhaarDetailRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsAadhaarDetailRequired"]).ToString();
        //        IsBloodGroupDetailRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsBloodGroupDetailRequired"]).ToString();
        //        IsFatherDetailRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsFatherDetail"]).ToString();
        //        IsFatherFullDetailRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsFatherFullDetail"]).ToString();
        //        IsFatherAcademicRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsFatherAcademic"]).ToString();
        //        IsMotherDetailRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsMotherDetail"]).ToString();
        //        IsMotherFullDetailRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsMotherFullDetail"]).ToString();
        //        IsMotherAcademicRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsMotherAcademic"]).ToString();
        //        IsGuardianDetailRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsGuardianDetail"]).ToString();
        //        IsGuardianFullDetailRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsGuardianFullDetail"]).ToString();
        //        IsGuardianAcademicRequired = (AdmissionCriteriaDS.Tables[0].Rows[0]["IsGuardianAcademic"]).ToString();
        //        IsotherdeatilRequired = Boolean.Parse(AdmissionCriteriaDS.Tables[0].Rows[0]["IsOtherInformationRequired"].ToString());
        //        StudentAcademicRemarkLabel.Text = (AdmissionCriteriaDS.Tables[0].Rows[0]["StudentAcademicRemark"]).ToString();

        //    }



        //if ((IsSiblingDetailRequired == "True"))
        //{
        //    // Sibling
        //    if (Session["AdmissionFormDetails"] != null)
        //    {
        //        string SQL_SiblingAcademics = "select AdmissionFormId as Id,SiblingName,SiblingRelation,SiblingStandard,SiblingSchool,Code from sAdmission.tAdmissionFormSibling where AdmissionFormId=" + oldds.Tables[0].Rows[0]["Id"].ToString();
        //        DataSet SiblingAcademicDS = new DataSet();
        //        CommonFunctions SiblingAcademiscf = new CommonFunctions();
        //        SiblingAcademicDS = SiblingAcademiscf.GetDataset(SQL_SiblingAcademics);
        //        if (SiblingAcademicDS != null && SiblingAcademicDS.Tables.Count > 0 && SiblingAcademicDS.Tables[0].Rows.Count > 0)
        //        {
        //            AdmissionSetupGridViewSibling.DataSource = SiblingAcademicDS;
        //            AdmissionSetupGridViewSibling.DataBind();

        //        }
        //        else
        //        {
        //            AdmissionSetupGridViewSibling.DataSource = null;
        //            AdmissionSetupGridViewSibling.DataBind();
        //            if (AdmissionCriteriaDS != null && AdmissionCriteriaDS.Tables.Count > 0 && AdmissionCriteriaDS.Tables[0].Rows.Count > 0)
        //            {
        //                for (int k = 0; k < 4; k++)
        //                {
        //                    AddRowsToSiblingGridView();
        //                }
        //            }
        //        }
        //    }
        //    else
        //    {
        //        AdmissionSetupGridViewSibling.DataSource = null;
        //        AdmissionSetupGridViewSibling.DataBind();
        //        if (AdmissionCriteriaDS != null && AdmissionCriteriaDS.Tables.Count > 0 && AdmissionCriteriaDS.Tables[0].Rows.Count > 0)
        //        {
        //            for (int k = 0; k < 4; k++)
        //            {
        //                AddRowsToSiblingGridView();
        //            }
        //        }
        //    }
        //    SiblingDetailsDiv.Visible = true;
        //}
        //else
        //{
        //    SiblingDetailsDiv.Visible = false;
        //}
        //if ((IsReferenceDetailRequired == "True"))
        //{
        //    //Reference
        //    if (Session["AdmissionFormDetails"] != null)
        //    {
        //        string SQL_ReferenceAcademics = "select AdmissionFormId as Id,ReferenceDetail,ReferenceName,ReferenceRelation,ReferenceContactNo from sAdmission.tAdmissionFormReference where AdmissionFormId=" + oldds.Tables[0].Rows[0]["Id"].ToString();
        //        DataSet ReferenceAcademicDS = new DataSet();
        //        CommonFunctions ReferenceAcademiscf = new CommonFunctions();
        //        ReferenceAcademicDS = ReferenceAcademiscf.GetDataset(SQL_ReferenceAcademics);
        //        if (ReferenceAcademicDS != null && ReferenceAcademicDS.Tables.Count > 0 && ReferenceAcademicDS.Tables[0].Rows.Count > 0)
        //        {
        //            AdmissionSetupGridViewReference.DataSource = ReferenceAcademicDS;
        //            AdmissionSetupGridViewReference.DataBind();
        //        }
        //        else
        //        {
        //            if (AdmissionCriteriaDS != null && AdmissionCriteriaDS.Tables.Count > 0 && AdmissionCriteriaDS.Tables[0].Rows.Count > 0)
        //            {
        //                AdmissionSetupGridViewReference.DataSource = null;
        //                AdmissionSetupGridViewReference.DataBind();
        //                for (int k = 0; k < 2; k++)
        //                {
        //                    AddRowsToReferenceGridView();
        //                }
        //            }
        //        }
        //    }
        //    else
        //    {
        //        if (AdmissionCriteriaDS != null && AdmissionCriteriaDS.Tables.Count > 0 && AdmissionCriteriaDS.Tables[0].Rows.Count > 0)
        //        {
        //            AdmissionSetupGridViewReference.DataSource = null;
        //            AdmissionSetupGridViewReference.DataBind();
        //            for (int k = 0; k < 2; k++)
        //            {
        //                AddRowsToReferenceGridView();
        //            }
        //        }
        //    }
        //    ReferenceDetailsDiv.Visible = true;
        //}
        //else
        //{
        //    AdmissionSetupGridViewReference.DataSource = null;
        //    AdmissionSetupGridViewReference.DataBind();
        //    ReferenceDetailsDiv.Visible = false;
        //}
        //if (AdmissionCriteriaDS != null && AdmissionCriteriaDS.Tables.Count > 0 && AdmissionCriteriaDS.Tables[0].Rows.Count > 0)
        //{

        //    if (AdmissionCriteriaDS != null && AdmissionCriteriaDS.Tables.Count > 0 && AdmissionCriteriaDS.Tables[0].Rows.Count > 0)
        //    {
        //        //if ((IsStudentAcademicRequired == "True"))
        //        //{

        //        if (IsFixStudentAcademic == "True")
        //        {

        //            if (Session["AdmissionFormDetails"] != null)
        //            {
        //                string SQL_studentAcademics = "select AdmissionFormId as Id,AcademicYear,AdmissionClass as ClassName,InstituteName,InstituteCity,InstituteAffiliaton,Result,Language from sAdmission.tAdmissionFormStudentAcademic where AdmissionFormId=" + oldds.Tables[0].Rows[0]["Id"].ToString();
        //                DataSet SQL_studentAcademicsDS = new DataSet();
        //                CommonFunctions SQL_studentAcademicscf = new CommonFunctions();
        //                SQL_studentAcademicsDS = SQL_studentAcademicscf.GetDataset(SQL_studentAcademics);
        //                if (SQL_studentAcademicsDS != null && SQL_studentAcademicsDS.Tables.Count > 0 && SQL_studentAcademicsDS.Tables[0].Rows.Count > 0)
        //                {
        //                    AdmissionSetupGridView.DataSource = SQL_studentAcademicsDS;
        //                    AdmissionSetupGridView.DataBind();
        //                }
        //                else
        //                {
        //                    DataTable dtnew = AdmissionCriteriaDS.Tables.Add("ModifiedDataTable");
        //                    // dtnew.Columns.Add("Id");
        //                    dtnew.Columns.Add("AcademicYear");
        //                    dtnew.Columns.Add("ClassName");
        //                    dtnew.Columns.Add("InstituteName");
        //                    dtnew.Columns.Add("InstituteCity");
        //                    dtnew.Columns.Add("InstituteAffiliaton");
        //                    dtnew.Columns.Add("Result");
        //                    dtnew.Columns.Add("Language");
        //                    AdmissionCriteriaDS.Tables.Remove("ModifiedDataTable");

        //                    foreach (DataRow dr in AdmissionCriteriaDS.Tables[0].Rows)
        //                    {
        //                        string StudentAcademicStandardnew = (AdmissionCriteriaDS.Tables[0].Rows[0]["StudentAcademicFor"]).ToString();
        //                        string[] StudentAcademicStandardArraynew = StudentAcademicStandardnew.Split(',');

        //                        DataRow newrow = null;

        //                        for (int k = 0; k < StudentAcademicStandardArraynew.Length; k++)
        //                        {
        //                            newrow = dtnew.NewRow();
        //                            //newrow["Id"] = oldds.Tables[0].Rows[0]["Id"];
        //                            newrow["ClassName"] = StudentAcademicStandardArraynew[k];
        //                            dtnew.Rows.Add(newrow);
        //                        }
        //                    }

        //                    AdmissionSetupGridView.DataSource = dtnew;
        //                    AdmissionSetupGridView.DataBind();
        //                }

        //            }
        //            else
        //            {
        //                DataTable dtnew = AdmissionCriteriaDS.Tables.Add("ModifiedDataTable");
        //                // dtnew.Columns.Add("Id");
        //                dtnew.Columns.Add("AcademicYear");
        //                dtnew.Columns.Add("ClassName");
        //                dtnew.Columns.Add("InstituteName");
        //                dtnew.Columns.Add("InstituteCity");
        //                dtnew.Columns.Add("InstituteAffiliaton");
        //                dtnew.Columns.Add("Result");
        //                dtnew.Columns.Add("Language");
        //                AdmissionCriteriaDS.Tables.Remove("ModifiedDataTable");

        //                foreach (DataRow dr in AdmissionCriteriaDS.Tables[0].Rows)
        //                {
        //                    string StudentAcademicStandardnew = (AdmissionCriteriaDS.Tables[0].Rows[0]["StudentAcademicFor"]).ToString();
        //                    string[] StudentAcademicStandardArraynew = StudentAcademicStandardnew.Split(',');

        //                    DataRow newrow = null;

        //                    for (int k = 0; k < StudentAcademicStandardArraynew.Length; k++)
        //                    {
        //                        newrow = dtnew.NewRow();
        //                        //newrow["Id"] = oldds.Tables[0].Rows[0]["Id"];
        //                        newrow["ClassName"] = StudentAcademicStandardArraynew[k];
        //                        dtnew.Rows.Add(newrow);
        //                    }
        //                }

        //                AdmissionSetupGridView.DataSource = dtnew;
        //                AdmissionSetupGridView.DataBind();
        //            }
        //            SchoolDetail.Visible = true;
        //            StudentAcademicRemarkLabel.Visible = true;
        //        }


        //        else
        //        {

        //            AdmissionSetupGridView.DataSource = null;
        //            AdmissionSetupGridView.DataBind();
        //            SchoolDetail.Visible = false;
        //        }
        //    }

        //}
        //else
        //{
        //    //Session["SessionExpired"] = "SessionExpired";
        //    // Response.Redirect("AdmissionFormLogin.aspx");
        //}

        //if (IsFatherDetailRequired == "True")
        //{
        //    FatherFamilyDetailsDiv.Visible = true;
        //    //FatherFullNameDiv.Visible = true;
        //    //FatherMobileNoDiv.Visible = true;
        //    if (Session["AdmissionFormDetails"] != null)
        //    {
        //        string SQL_FamilyDetail = "select * from sAdmission.tAdmissionFormFamilyDetail where AdmissionFormId=" + oldds.Tables[0].Rows[0]["Id"].ToString();
        //        DataSet FamilyDetailDS = new DataSet();
        //        CommonFunctions FamilyDetailcf = new CommonFunctions();
        //        FamilyDetailDS = FamilyDetailcf.GetDataset(SQL_FamilyDetail);
        //        if (FamilyDetailDS != null && FamilyDetailDS.Tables.Count > 0 && FamilyDetailDS.Tables[0].Rows.Count > 0)
        //        {

        //            FatherNameTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["FatherName"]);
        //            FatherMobileNoTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["FatherContactNo"]);
        //            FatherAdhaarNumberTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["FatherAdhaarNumber"]);
        //            if (FamilyDetailDS.Tables[0].Rows[0]["FatherPhoto"] != DBNull.Value)
        //            {
        //                byte[] imgBytes = (byte[])FamilyDetailDS.Tables[0].Rows[0]["FatherPhoto"];
        //                Session["FatherPhoto"] = imgBytes;
        //                if (convertFatherImage(imgBytes) == true)
        //                {

        //                }
        //                //TypeConverter tc = TypeDescriptor.GetConverter(typeof(Bitmap));
        //                //Bitmap MyBitmap = (Bitmap)tc.ConvertFrom(imgBytes);

        //                //string imgString = Convert.ToBase64String(imgBytes);
        //                //System.Drawing.Image convertToImage = System.Drawing.Image.FromStream(new MemoryStream(Convert.FromBase64String(imgString)));
        //                ////Set the source with data:image/bmp
        //                //FatherImage.Src = String.Format("data:image/Bmp;base64,{0}\"", imgString);
        //            }
        //        }
        //    }
        //}
        //else
        //{
        //    FatherFamilyDetailsDiv.Visible = false;
        //    //FatherFullNameDiv.Visible = true;
        //    //FatherMobileNoDiv.Visible = true;
        //}

        //if (IsFatherFullDetailRequired == "True")
        ////if (IsFatherDetailRequired == "True")
        //{
        //    FatherFullDetailsDivDiv.Visible = true;
        //    //Qualificationdiv.Visible = true;
        //    //Occupationdiv.Visible = true;
        //    //Emaildiv.Visible = true;
        //    //YearIncomeDiv.Visible = true;
        //    //OrgDiv.Visible = true;
        //    //Designation.Visible = true;
        //    //OfficePhone.Visible = true;
        //    //ExStudent.Visible = true;
        //    //OfficeAddressDiv.Visible = true;
        //    if (Session["AdmissionFormDetails"] != null)
        //    {
        //        string SQL_FamilyDetail = "select * from sAdmission.tAdmissionFormFamilyDetail where AdmissionFormId=" + oldds.Tables[0].Rows[0]["Id"].ToString();
        //        DataSet FamilyDetailDS = new DataSet();
        //        CommonFunctions FamilyDetailcf = new CommonFunctions();
        //        FamilyDetailDS = FamilyDetailcf.GetDataset(SQL_FamilyDetail);
        //        if (FamilyDetailDS != null && FamilyDetailDS.Tables.Count > 0 && FamilyDetailDS.Tables[0].Rows.Count > 0)
        //        {
        //            //Father
        //            CommonFunctions cf = new CommonFunctions();
        //            if (FamilyDetailDS.Tables[0].Rows[0]["LiveWithId"].ToString() != "")
        //            {
        //                string Query_With = "Select Id,Title From sCommon.tLiveWithMaster WHERE IsObsolete = 0 And Id=" + FamilyDetailDS.Tables[0].Rows[0]["LiveWithId"].ToString();
        //                DataSet Ds_with = new DataSet();
        //                Ds_with = cf.GetDataset(Query_With);
        //                if (Ds_with != null && Ds_with.Tables[0].Rows.Count > 0)
        //                    LiveWithDropDownList.SelectedValue = Ds_with.Tables[0].Rows[0][0].ToString();
        //            }
        //            if (FamilyDetailDS.Tables[0].Rows[0]["IsFatherExStudent"].ToString() == "True")
        //                FatherExStudentCheckBox.Checked = true;
        //            else
        //                FatherExStudentCheckBox.Checked = false;
        //            FatherPassOutYearTextBox.Text = FamilyDetailDS.Tables[0].Rows[0]["FatherPassOutYear"].ToString();

        //            //FatherNameTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["FatherName"]);
        //            FatherBirthDateTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["FatherDateOfBirth"].ToString().Replace(" 00:00:00", ""));
        //            FatherOccupationTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["FatherOccupation"]);
        //            FatherQualificationTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["FatherQualification"]);
        //            //FatherMobileNoTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["FatherContactNo"]);
        //            FatherEmailTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["FatherMail"]);
        //            FatherOfficeAddressTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["FatherOfficeAddress"]);
        //            FatherYearlyIncomeTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["FatherIncome"]);
        //            FatherOrganizationTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["FatherOrganization"]);
        //            DesignationTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["FatherDesignation"]);
        //            FatherOfficePhoneTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["FatherOfficePhone"]);


        //        }
        //    }
        //}
        //else
        //{
        //    FatherFullDetailsDivDiv.Visible = false; //extra
        //    //Qualificationdiv.Visible = false;
        //    //Occupationdiv.Visible = false;
        //    //Emaildiv.Visible = false;
        //    //YearIncomeDiv.Visible = false;
        //    //OrgDiv.Visible = false;
        //    //Designation.Visible = false;
        //    //OfficePhone.Visible = false;
        //    //ExStudent.Visible = false;
        //    //OfficeAddressDiv.Visible = false;
        //}
        //if (IsFatherAcademicRequired == "True")
        //{
        //    FatherAcdemicDeatil.Visible = true;
        //    if (Session["AdmissionFormDetails"] != null)
        //    {
        //        //Father
        //        string SQL_FatherAcademics = "select AdmissionFormId as Id,AcademicYear,AdmissionClass as ClassName,InstituteName,InstituteCity,InstituteAffiliaton,RelationshipId,Language from sAdmission.tAdmissionFormParentAcademic where  AdmissionFormId=" + oldds.Tables[0].Rows[0]["Id"].ToString() + " AND RelationshipId=" + 2;
        //        DataSet FatherAcademicDS = new DataSet();
        //        CommonFunctions FatherAcademiscf = new CommonFunctions();
        //        FatherAcademicDS = FatherAcademiscf.GetDataset(SQL_FatherAcademics);
        //        if (FatherAcademicDS != null && FatherAcademicDS.Tables.Count > 0 && FatherAcademicDS.Tables[0].Rows.Count > 0)
        //        {
        //            AdmissionSetupGridViewFather.DataSource = FatherAcademicDS;
        //            AdmissionSetupGridViewFather.DataBind();
        //        }
        //        //Mother


        //        //Guardian

        //    }
        //    else
        //    {
        //        DataTable dtnew = AdmissionCriteriaDS.Tables.Add("ModifiedDataTable");

        //        //dtnew.Columns.Add("Id");
        //        dtnew.Columns.Add("AcademicYear");
        //        dtnew.Columns.Add("ClassName");
        //        dtnew.Columns.Add("InstituteName");
        //        dtnew.Columns.Add("InstituteCity");
        //        dtnew.Columns.Add("InstituteAffiliaton");
        //        dtnew.Columns.Add("Result");
        //        dtnew.Columns.Add("Language");
        //        // dtnew = AdmissionCriteriaDS.Tables.Remove("ModifiedDataTable");
        //        AdmissionCriteriaDS.Tables.Remove("ModifiedDataTable");

        //        foreach (DataRow dr in AdmissionCriteriaDS.Tables[0].Rows)
        //        {
        //            string StudentAcademicStandardnew = (AdmissionCriteriaDS.Tables[0].Rows[0]["ParentAcademicFor"]).ToString();
        //            string[] StudentAcademicStandardArraynew = StudentAcademicStandardnew.Split(',');

        //            DataRow newrow = null;

        //            for (int k = 0; k < StudentAcademicStandardArraynew.Length; k++)
        //            {
        //                newrow = dtnew.NewRow();
        //                // newrow["Id"] = dsacedemic.Tables[0].Rows[0]["Id"];
        //                // newrow["AcademicYearTextBox"] = (AdmissionCriteriaDS.Tables[0].Rows[0]["BatchId"]).ToString();

        //                newrow["ClassName"] = StudentAcademicStandardArraynew[k];
        //                dtnew.Rows.Add(newrow);
        //            }
        //        }

        //        AdmissionSetupGridViewFather.DataSource = dtnew;
        //        AdmissionSetupGridViewFather.DataBind();


        //    }

        //}
        //else
        //{
        //    FatherAcdemicDeatil.Visible = false;
        //}




        //if (IsMotherDetailRequired == "True")
        //{
        //    MotherFamilyDetailsDiv.Visible = true;
        //    if (Session["AdmissionFormDetails"] != null)
        //    {

        //        string SQL_FamilyDetail = "select * from sAdmission.tAdmissionFormFamilyDetail where AdmissionFormId=" + oldds.Tables[0].Rows[0]["Id"].ToString();
        //        DataSet FamilyDetailDS = new DataSet();
        //        CommonFunctions FamilyDetailcf = new CommonFunctions();
        //        FamilyDetailDS = FamilyDetailcf.GetDataset(SQL_FamilyDetail);
        //        if (FamilyDetailDS != null && FamilyDetailDS.Tables.Count > 0 && FamilyDetailDS.Tables[0].Rows.Count > 0)
        //        {

        //            MotherNameTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["MotherName"]);
        //            MotherMobilNoTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["MotherContactNo"]);
        //            MotherAadhaarNoTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["MotherAadhaarNumber"]);
        //            if (FamilyDetailDS.Tables[0].Rows[0]["MotherPhoto"] != DBNull.Value)
        //            {
        //                byte[] imgBytes = (byte[])FamilyDetailDS.Tables[0].Rows[0]["MotherPhoto"];
        //                Session["MotherPhoto"] = imgBytes;
        //                if (convertMotherImage(imgBytes) == true)
        //                {

        //                }


        //                //string imgString = Convert.ToBase64String(imgBytes);
        //                ////Set the source with data:image/bmp
        //                //MotherImage.Src = String.Format("data:image/Bmp;base64,{0}\"", FamilyDetailDS.Tables[0].Rows[0]["MotherPhoto"]);
        //            }
        //        }
        //    }

        //}
        //else
        //{
        //    MotherFamilyDetailsDiv.Visible = false;
        //}
        //if (IsMotherFullDetailRequired == "True")
        //{
        //    MotherFullDetailsDivDiv.Visible = true;
        //    //    MQualificationDiv.Visible = true;

        //    //    MotherOccDiv.Visible = true;
        //    //    MotherEmailDiv.Visible = true;
        //    //    MotherYIncomeDIv.Visible = true;
        //    //    MotherOrgDiv.Visible = true;
        //    //    MohterDesignationDiv.Visible = true;
        //    //    MotherOfficePhDiv.Visible = true;
        //    //    MotherExDiv.Visible = true;
        //    //    MotherOfficeAddDiv.Visible = true;
        //    if (Session["AdmissionFormDetails"] != null)
        //    {
        //        string SQL_FamilyDetail = "select * from sAdmission.tAdmissionFormFamilyDetail where AdmissionFormId=" + oldds.Tables[0].Rows[0]["Id"].ToString();
        //        DataSet FamilyDetailDS = new DataSet();
        //        CommonFunctions FamilyDetailcf = new CommonFunctions();
        //        FamilyDetailDS = FamilyDetailcf.GetDataset(SQL_FamilyDetail);
        //        if (FamilyDetailDS != null && FamilyDetailDS.Tables.Count > 0 && FamilyDetailDS.Tables[0].Rows.Count > 0)
        //        {
        //            //Father

        //            if (FamilyDetailDS.Tables[0].Rows[0]["IsMotherExStudent"].ToString() == "True")
        //                MotherExStudentCheckBox.Checked = true;
        //            else
        //                MotherExStudentCheckBox.Checked = false;
        //            MotherPassOutyearTextBox.Text = FamilyDetailDS.Tables[0].Rows[0]["FatherPassOutYear"].ToString();


        //            MotherBirthDateTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["MotherDateOfBirth"].ToString().Replace(" 00:00:00", ""));
        //            MotherOccupationTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["MotherOccupation"]);
        //            MotherQualificationTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["MotherQualification"]);
        //            //FatherMobileNoTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["FatherContactNo"]);
        //            MotherEmailTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["MotherMail"]);
        //            MotherOfficeAddressTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["MotherOfficeAddress"]);
        //            MotherIncomeTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["MotherIncome"]);
        //            MotherOrganizationTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["MotherOrganization"]);
        //            MotherDesignationTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["MotherDesignation"]);
        //            MotherOfficePhoneTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["MotherOfficePhone"]);

        //        }
        //    }
        //}
        //else
        //{
        //    //MotherFamilyDetailsDiv.Visible = false;
        //    MotherFullDetailsDivDiv.Visible = false;
        //    //MQualificationDiv.Visible = false;
        //    //MotherOccDiv.Visible = false;
        //    //MotherEmailDiv.Visible = false;
        //    //MotherYIncomeDIv.Visible = false;
        //    //MotherOrgDiv.Visible = false;
        //    //MohterDesignationDiv.Visible = false;
        //    //MotherOfficePhDiv.Visible = false;
        //    //MotherExDiv.Visible = false;
        //    //MotherOfficeAddDiv.Visible = false;
        //}
        //if (IsMotherAcademicRequired == "True")
        //{
        //    MotherAcedamicDetailsDiv.Visible = true;
        //    if (Session["AdmissionFormDetails"] != null)
        //    {
        //        string SQL_MotherAcademics = "select AdmissionFormId as Id,AcademicYear,AdmissionClass as ClassName,InstituteName,InstituteCity,InstituteAffiliaton,RelationshipId,Language from sAdmission.tAdmissionFormParentAcademic where  AdmissionFormId=" + oldds.Tables[0].Rows[0]["Id"].ToString() + " AND RelationshipId=" + 3;
        //        DataSet MotherAcademicDS = new DataSet();
        //        CommonFunctions MotherAcademiscf = new CommonFunctions();
        //        MotherAcademicDS = MotherAcademiscf.GetDataset(SQL_MotherAcademics);
        //        if (MotherAcademicDS != null && MotherAcademicDS.Tables.Count > 0 && MotherAcademicDS.Tables[0].Rows.Count > 0)
        //        {
        //            AdmissionSetupGridViewMother.DataSource = MotherAcademicDS;
        //            AdmissionSetupGridViewMother.DataBind();
        //        }


        //    }
        //    else
        //    {
        //        DataTable dtnew = AdmissionCriteriaDS.Tables.Add("ModifiedDataTable");

        //        //dtnew.Columns.Add("Id");
        //        dtnew.Columns.Add("AcademicYear");
        //        dtnew.Columns.Add("ClassName");
        //        dtnew.Columns.Add("InstituteName");
        //        dtnew.Columns.Add("InstituteCity");
        //        dtnew.Columns.Add("InstituteAffiliaton");
        //        dtnew.Columns.Add("Result");
        //        dtnew.Columns.Add("Language");
        //        // dtnew = AdmissionCriteriaDS.Tables.Remove("ModifiedDataTable");
        //        AdmissionCriteriaDS.Tables.Remove("ModifiedDataTable");

        //        foreach (DataRow dr in AdmissionCriteriaDS.Tables[0].Rows)
        //        {
        //            string StudentAcademicStandardnew = (AdmissionCriteriaDS.Tables[0].Rows[0]["ParentAcademicFor"]).ToString();
        //            string[] StudentAcademicStandardArraynew = StudentAcademicStandardnew.Split(',');

        //            DataRow newrow = null;

        //            for (int k = 0; k < StudentAcademicStandardArraynew.Length; k++)
        //            {
        //                newrow = dtnew.NewRow();
        //                // newrow["Id"] = dsacedemic.Tables[0].Rows[0]["Id"];
        //                // newrow["AcademicYearTextBox"] = (AdmissionCriteriaDS.Tables[0].Rows[0]["BatchId"]).ToString();

        //                newrow["ClassName"] = StudentAcademicStandardArraynew[k];
        //                dtnew.Rows.Add(newrow);
        //            }
        //        }


        //        AdmissionSetupGridViewMother.DataSource = dtnew;
        //        AdmissionSetupGridViewMother.DataBind();

        //    }
        //}
        //else
        //{
        //    MotherAcedamicDetailsDiv.Visible = false;
        //}

        //if (IsGuardianDetailRequired == "True")
        //{
        //    GuardianDetailsDiv.Visible = true;
        //    if (Session["AdmissionFormDetails"] != null)
        //    {

        //        string SQL_FamilyDetail = "select * from sAdmission.tAdmissionFormFamilyDetail where AdmissionFormId=" + oldds.Tables[0].Rows[0]["Id"].ToString();
        //        DataSet FamilyDetailDS = new DataSet();
        //        CommonFunctions FamilyDetailcf = new CommonFunctions();
        //        FamilyDetailDS = FamilyDetailcf.GetDataset(SQL_FamilyDetail);
        //        if (FamilyDetailDS != null && FamilyDetailDS.Tables.Count > 0 && FamilyDetailDS.Tables[0].Rows.Count > 0)
        //        {

        //            GuardianNameTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["RelativeName"]);
        //            GuardianMobileNoTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["RelativeContactNo"]);
        //            GuardianAadhaarNoTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["RelativeAadhaarNumber"]);
        //            if (FamilyDetailDS.Tables[0].Rows[0]["RelativePhoto"] != DBNull.Value)
        //            {
        //                byte[] imgBytes = (byte[])FamilyDetailDS.Tables[0].Rows[0]["RelativePhoto"];
        //                Session["GuardianPhoto"] = imgBytes;
        //                if (convertGuardianImage(imgBytes) == true)
        //                {

        //                }
        //                //TypeConverter tc = TypeDescriptor.GetConverter(typeof(Bitmap));
        //                //Bitmap MyBitmap = (Bitmap)tc.ConvertFrom(imgBytes);

        //                //string imgString = Convert.ToBase64String(imgBytes);
        //                //System.Drawing.Image convertToImage = System.Drawing.Image.FromStream(new MemoryStream(Convert.FromBase64String(imgString)));
        //                ////Set the source with data:image/bmp
        //                //GuardianImage.Src = String.Format("data:image/Bmp;base64,{0}\"", imgString);
        //            }
        //        }


        //    }

        //}
        //else
        //{
        //    GuardianDetailsDiv.Visible = false;
        //    GuardianFullDetailsDiv.Visible = false;
        //    GuardianAcdemicDetailsDiv.Visible = false;
        //}
        //if (IsGuardianFullDetailRequired == "True")
        //{
        //    //GuardianDetailsDiv.Visible = true;
        //    GuardianFullDetailsDiv.Visible = true;
        //    //GuardQualDiv.Visible = true;

        //    //GuardOccDiv.Visible = true;
        //    //GuardEmailDiv.Visible = true;
        //    //GuardYIDiv.Visible = true;
        //    //GuardOrgDiv.Visible = true;
        //    //GuardDesiDiv.Visible = true;
        //    //GuardOfficeDiv.Visible = true;
        //    //GuardExDiv.Visible = true;
        //    //GuardOffAddDiv.Visible = true;
        //    //GuardRelWithDiv.Visible = true;
        //    if (Session["AdmissionFormDetails"] != null)
        //    {
        //        string SQL_FamilyDetail = "select * from sAdmission.tAdmissionFormFamilyDetail where AdmissionFormId=" + oldds.Tables[0].Rows[0]["Id"].ToString();
        //        DataSet FamilyDetailDS = new DataSet();
        //        CommonFunctions FamilyDetailcf = new CommonFunctions();
        //        FamilyDetailDS = FamilyDetailcf.GetDataset(SQL_FamilyDetail);
        //        if (FamilyDetailDS != null && FamilyDetailDS.Tables.Count > 0 && FamilyDetailDS.Tables[0].Rows.Count > 0)
        //        {
        //            //Guardian

        //            GuardianNameTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["RelativeName"]);
        //            GuardianBirthDateTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["RelativeDateOfBirth"].ToString().Replace(" 00:00:00", ""));
        //            GuardianOccupationTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["RelativeOccupation"]);
        //            GuardianQualificationTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["RelativeQualification"]);
        //            GuardianMobileNoTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["RelativeContactNo"]);
        //            GuardianEmailTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["RelativeMail"]);
        //            GuardianOfficeAddressTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["RelativeOfficeAddress"]);
        //            GuardianYearlyIncomeTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["RelativeIncome"]);
        //            RelationWithGuardianTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["RelationshipName"]);

        //            if (FamilyDetailDS.Tables[0].Rows[0]["IsRelativeExStudent"].ToString() == "True")
        //                RelativeExStudentCheckBox.Checked = true;
        //            else
        //                RelativeExStudentCheckBox.Checked = false;
        //            RelativePassOutYearTextBox.Text = FamilyDetailDS.Tables[0].Rows[0]["RelativePassOutYear"].ToString();
        //            GuuardianOrganizationTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["RelativeOrganization"]);

        //            GuuardianDesigantionTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["RelativeDesignation"]);

        //            GuardianOfficePhoneTextBox.Text = Convert.ToString(FamilyDetailDS.Tables[0].Rows[0]["RelativeOfficePhone"]);


        //        }
        //    }
        //}
        //else
        //{
        //    //GuardianDetailsDiv.Visible = false;
        //    GuardianFullDetailsDiv.Visible = false;
        //    //GuardQualDiv.Visible = false;
        //    //GuardOccDiv.Visible = false;
        //    //GuardEmailDiv.Visible = false;
        //    //GuardYIDiv.Visible = false;
        //    //GuardOrgDiv.Visible = false;
        //    //GuardDesiDiv.Visible = false;
        //    //GuardOfficeDiv.Visible = false;
        //    //GuardExDiv.Visible = false;
        //    //GuardOffAddDiv.Visible = false;
        //    //GuardRelWithDiv.Visible = false;
        //}
        //if (IsGuardianAcademicRequired == "True")
        //{
        //    GuardianAcdemicDetailsDiv.Visible = true;
        //    if (Session["AdmissionFormDetails"] != null)
        //    {
        //        string SQL_GuardianAcademics = "select AdmissionFormId as Id,AcademicYear,AdmissionClass as ClassName,InstituteName,InstituteCity,InstituteAffiliaton,RelationshipId,Language from sAdmission.tAdmissionFormParentAcademic where  AdmissionFormId=" + oldds.Tables[0].Rows[0]["Id"].ToString() + " AND RelationshipId=" + 7;
        //        DataSet GuardianAcademicDS = new DataSet();
        //        CommonFunctions GuardianAcademiscf = new CommonFunctions();
        //        GuardianAcademicDS = GuardianAcademiscf.GetDataset(SQL_GuardianAcademics);
        //        if (GuardianAcademicDS != null && GuardianAcademicDS.Tables.Count > 0 && GuardianAcademicDS.Tables[0].Rows.Count > 0)
        //        {
        //            AdmissionSetupGridViewGuardian.DataSource = GuardianAcademicDS;
        //            AdmissionSetupGridViewGuardian.DataBind();
        //        }

        //        else
        //        {
        //            DataTable dtnew = AdmissionCriteriaDS.Tables.Add("ModifiedDataTable");

        //            //dtnew.Columns.Add("Id");
        //            dtnew.Columns.Add("AcademicYear");
        //            dtnew.Columns.Add("ClassName");
        //            dtnew.Columns.Add("InstituteName");
        //            dtnew.Columns.Add("InstituteCity");
        //            dtnew.Columns.Add("InstituteAffiliaton");
        //            dtnew.Columns.Add("Result");
        //            dtnew.Columns.Add("Language");
        //            // dtnew = AdmissionCriteriaDS.Tables.Remove("ModifiedDataTable");
        //            AdmissionCriteriaDS.Tables.Remove("ModifiedDataTable");

        //            foreach (DataRow dr in AdmissionCriteriaDS.Tables[0].Rows)
        //            {
        //                string StudentAcademicStandardnew = (AdmissionCriteriaDS.Tables[0].Rows[0]["ParentAcademicFor"]).ToString();
        //                string[] StudentAcademicStandardArraynew = StudentAcademicStandardnew.Split(',');

        //                DataRow newrow = null;

        //                for (int k = 0; k < StudentAcademicStandardArraynew.Length; k++)
        //                {
        //                    newrow = dtnew.NewRow();
        //                    // newrow["Id"] = dsacedemic.Tables[0].Rows[0]["Id"];
        //                    // newrow["AcademicYearTextBox"] = (AdmissionCriteriaDS.Tables[0].Rows[0]["BatchId"]).ToString();

        //                    newrow["ClassName"] = StudentAcademicStandardArraynew[k];
        //                    dtnew.Rows.Add(newrow);
        //                }
        //            }

        //            AdmissionSetupGridViewGuardian.DataSource = dtnew;
        //            AdmissionSetupGridViewGuardian.DataBind();

        //        }
        //    }
        //    else
        //    {
        //        DataTable dtnew = AdmissionCriteriaDS.Tables.Add("ModifiedDataTable");

        //        //dtnew.Columns.Add("Id");
        //        dtnew.Columns.Add("AcademicYear");
        //        dtnew.Columns.Add("ClassName");
        //        dtnew.Columns.Add("InstituteName");
        //        dtnew.Columns.Add("InstituteCity");
        //        dtnew.Columns.Add("InstituteAffiliaton");
        //        dtnew.Columns.Add("Result");
        //        dtnew.Columns.Add("Language");
        //        // dtnew = AdmissionCriteriaDS.Tables.Remove("ModifiedDataTable");
        //        AdmissionCriteriaDS.Tables.Remove("ModifiedDataTable");

        //        foreach (DataRow dr in AdmissionCriteriaDS.Tables[0].Rows)
        //        {
        //            string StudentAcademicStandardnew = (AdmissionCriteriaDS.Tables[0].Rows[0]["ParentAcademicFor"]).ToString();
        //            string[] StudentAcademicStandardArraynew = StudentAcademicStandardnew.Split(',');

        //            DataRow newrow = null;

        //            for (int k = 0; k < StudentAcademicStandardArraynew.Length; k++)
        //            {
        //                newrow = dtnew.NewRow();
        //                // newrow["Id"] = dsacedemic.Tables[0].Rows[0]["Id"];
        //                // newrow["AcademicYearTextBox"] = (AdmissionCriteriaDS.Tables[0].Rows[0]["BatchId"]).ToString();

        //                newrow["ClassName"] = StudentAcademicStandardArraynew[k];
        //                dtnew.Rows.Add(newrow);
        //            }
        //        }


        //        AdmissionSetupGridViewGuardian.DataSource = dtnew;
        //        AdmissionSetupGridViewGuardian.DataBind();
        //    }
        //}
        //else
        //{
        //    GuardianAcdemicDetailsDiv.Visible = false;
        //}






        //if (IsHealthDetailRequired == "True")
        //{
        //    //string sql="select  IsPysicalDeformity,PysicalDeformityRemark,IsMajorIllness,MajorIllnessRemark,IsAllergy,AllergyRemarkfrom  from sAdmission.tAdmissionForm  where  AdmissionFormId=" + oldds.Tables[0].Rows[0]["Id"].ToString() + " ";
        //    HealthDiv.Visible = true;
        //}
        //else
        //{
        //    HealthDiv.Visible = false;
        //    PhysicalDeformityCheckBox.Checked = false;
        //    pRemarkTextBox.Text = string.Empty;
        //    MajorIllnessCheckBox.Checked = false;
        //    MRemarkTextBox.Text = string.Empty;
        //    IsAllergyCheckBox.Checked = false;
        //    ARemarkTextBox.Text = string.Empty;
        //    HealthDiv.Visible = false;
        //}
        //if (IsBirthPlaceDetailRequired == "True")
        //{
        //    //GetDisplayField();
        //    BirthDetailsDiv.Visible = true;

        //}
        //else
        //{
        //    BirthDetailsDiv.Visible = false;
        //    //BirthCountryTextBox.Text = string.Empty;
        //    //BirthDistrictTextBox.Text = string.Empty;
        //    //BirthPlaceTextBox.Text = string.Empty;
        //    //BirthStateTextBox.Text = string.Empty;
        //    //BirthTalukaTextBox.Text = string.Empty;
        //    //BirthDistDiv.Visible = false;
        //    //BirthTalukaDiv.Visible = false;
        //    //BirthPlaceDiv.Visible = false;
        //    //BirthStateDiv.Visible = false;
        //    //BirthCountryDiv.Visible = false;
        //}
        //if (IsAadhaarDetailRequired == "True")
        //    AdhaarDiv.Visible = true;
        //else
        //{
        //    AdhaarDiv.Visible = false;
        //    AdhaarNumberTextBox.Text = string.Empty;
        //}
        //if (IsBloodGroupDetailRequired == "True")
        //    BGDiv.Visible = true;
        //else
        //{
        //    BloodGroupDropDownList.SelectedIndex = 0;
        //    BGDiv.Visible = false;
        //}
        //if (IsHostelDetailRequired == "True")
        //    HOstelDiv.Visible = true;
        //else
        //{
        //    HOstelDiv.Visible = false;
        //    hostelCheckBox.Checked = false;
        //}
        //if (IsTransportDetailRequired == "True")
        //    TransportRequireddiv.Visible = true;
        //else
        //{
        //    TransportRequireddiv.Visible = false;
        //    TransportCheckBox.Checked = false;
        //}
        //if (IsotherdeatilRequired == true)
        //    Otherdetaildiv.Visible = true;
        //else
        //    Otherdetaildiv.Visible = false;
        //settabindex();
        //FirstNameTextBox.Focus();

        //GetDisplayField();

        //string SQL_String = "SELECT ISNULL(IsCustomField1Required,0) AS IsCustomField1Required, " +
        //                        "ISNULL(CustomField1Remark,'') AS CustomField1Remark," +
        //                        "ISNULL(CustomField1TypeId,0) AS CustomField1TypeId," +
        //                        "ISNULL(CustomField1List,'') AS CustomField1List," +
        //                        "ISNULL(IsCustomField1Mandatory,0) AS IsCustomField1Mandatory," +
        //                        "ISNULL(IsCustomField2Required,0) AS IsCustomField2Required," +
        //                        "ISNULL(CustomField2Remark,'') AS CustomField2Remark," +
        //                        "ISNULL(CustomField2TypeId,0) AS CustomField2TypeId," +
        //                        "ISNULL(CustomField2List,'') AS CustomField2List," +
        //                        "ISNULL(IsCustomField2Mandatory,0) AS IsCustomField2Mandatory," +
        //                        "ISNULL(IsCustomField3Required,0) AS IsCustomField3Required," +
        //                        "ISNULL(CustomField3Remark,'') AS CustomField3Remark," +
        //                        "ISNULL(CustomField3TypeId,0) AS CustomField3TypeId," +
        //                        "ISNULL(CustomField3List,'') AS CustomField3List," +
        //                        "ISNULL(IsCustomField3Mandatory,0) AS IsCustomField3Mandatory" +
        //                        " FROM sAdmission.tAdmissionCriteria WHERE ClassId =" + StandardDropDownList.SelectedValue +
        //                        " AND BatchId = " + BatchDropDownList.SelectedValue;
        //DataSet ds = new DataSet();
        //CommonFunctions CommonFunctionsObj = new CommonFunctions();
        //ds = CommonFunctionsObj.GetDataset(SQL_String);
        //if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
        //{
        //    // CustomField1Required
        //    #region CustomField1Required
        //    bool IsCustomField1Required = bool.Parse(ds.Tables[0].Rows[0]["IsCustomField1Required"].ToString());
        //    if (IsCustomField1Required == true)
        //    {
        //        string CustomField1Remark = ds.Tables[0].Rows[0]["CustomField1Remark"].ToString();
        //        int CustomField1TypeId = int.Parse(ds.Tables[0].Rows[0]["CustomField1TypeId"].ToString());
        //        string CustomField1List = ds.Tables[0].Rows[0]["CustomField1List"].ToString();
        //        bool IsCustomField1Mandatory = bool.Parse(ds.Tables[0].Rows[0]["IsCustomField1Mandatory"].ToString());

        //        CustomField1Div.Visible = true;
        //        CustomField1AnswerLabel.Text = CustomField1Remark;

        //        if (CustomField1TypeId == 1 || CustomField1TypeId == 2)
        //        {
        //            CustomField1DropDownList.Visible = true;
        //            CustomField1DropDownList.Items.Clear();
        //            CustomField1DropDownList.Items.Add(new ListItem("- Select -", "0"));
        //            if (CustomField1TypeId == 1)
        //            {
        //                CustomField1DropDownList.Items.Add(new ListItem("Yes", "1"));
        //                CustomField1DropDownList.Items.Add(new ListItem("No", "2"));
        //            }

        //            else if (CustomField1TypeId == 2)
        //            {
        //                string[] strArray = CustomField1List.Split(',');

        //                for (int i = 0; i < strArray.Length; i++)
        //                {
        //                    CustomField1DropDownList.Items.Add(new ListItem(strArray[i].ToString(), (i + 1).ToString()));
        //                }
        //            }
        //        }
        //        else
        //        {
        //            if (CustomField1TypeId == 3)
        //            {
        //                CustomField1AnswerTextBox.Visible = true;
        //                CustomField1AnswerTextBox.TextMode = TextBoxMode.MultiLine;
        //            }
        //            if (CustomField1TypeId == 4)
        //            {
        //                CustomField1AnswerTextBox.Visible = true;
        //                CustomField1AnswerTextBox.Attributes.Add("onkeypress", "return isNumberKey(event)");
        //                //CustomField1AnswerTextBox.TextMode = TextBoxMode.Number;
        //            }
        //        }


        //        if (IsCustomField1Mandatory == true)
        //            MCustomField1AnswerLabel.Visible = true;
        //        else
        //            MCustomField1AnswerLabel.Visible = false;
        //    }
        //    else
        //    {
        //        CustomField1Div.Visible = false;
        //        MCustomField1AnswerLabel.Text = string.Empty;
        //        CustomField1AnswerLabel.Text = string.Empty;
        //        CustomField1AnswerTextBox.Text = string.Empty;
        //        CustomField1DropDownList.Items.Clear();
        //    }
        //    #endregion

        //    // CustomField2Required
        //    #region CustomField2Required
        //    bool IsCustomField2Required = bool.Parse(ds.Tables[0].Rows[0]["IsCustomField2Required"].ToString());
        //    if (IsCustomField2Required == true)
        //    {
        //        string CustomField2Remark = ds.Tables[0].Rows[0]["CustomField2Remark"].ToString();
        //        int CustomField2TypeId = int.Parse(ds.Tables[0].Rows[0]["CustomField2TypeId"].ToString());
        //        string CustomField2List = ds.Tables[0].Rows[0]["CustomField2List"].ToString();
        //        bool IsCustomField2Mandatory = bool.Parse(ds.Tables[0].Rows[0]["IsCustomField2Mandatory"].ToString());

        //        CustomField2Div.Visible = true;

        //        CustomField2AnswerLabel.Text = CustomField2Remark;

        //        if (CustomField2TypeId == 1 || CustomField2TypeId == 2)
        //        {
        //            CustomField2DropDownList.Visible = true;
        //            CustomField2DropDownList.Items.Clear();
        //            CustomField2DropDownList.Items.Add(new ListItem("- Select -", "0"));
        //            if (CustomField2TypeId == 1)
        //            {
        //                CustomField2DropDownList.Items.Add(new ListItem("Yes", "1"));
        //                CustomField2DropDownList.Items.Add(new ListItem("No", "2"));
        //            }

        //            else if (CustomField2TypeId == 2)
        //            {
        //                string[] strArray = CustomField2List.Split(',');

        //                for (int i = 0; i < strArray.Length; i++)
        //                {
        //                    CustomField2DropDownList.Items.Add(new ListItem(strArray[i].ToString(), (i + 1).ToString()));
        //                }
        //            }
        //        }
        //        else
        //        {
        //            if (CustomField2TypeId == 3)
        //            {
        //                CustomField2AnswerTextBox.Visible = true;
        //                CustomField2AnswerTextBox.TextMode = TextBoxMode.MultiLine;
        //            }
        //            if (CustomField2TypeId == 4)
        //            {
        //                CustomField2AnswerTextBox.Visible = true;
        //                CustomField2AnswerTextBox.Attributes.Add("onkeypress", "return isNumberKey(event)");
        //            }
        //        }
        //        if (IsCustomField2Mandatory == true)
        //            MCustomField2AnswerLabel.Visible = true;
        //        else
        //            MCustomField2AnswerLabel.Visible = false;
        //    }
        //    else
        //    {
        //        CustomField2Div.Visible = false;
        //        MCustomField2AnswerLabel.Text = string.Empty;
        //        CustomField2AnswerLabel.Text = string.Empty;
        //        CustomField2AnswerTextBox.Text = string.Empty;
        //        CustomField2DropDownList.Items.Clear();
        //    }
        //    #endregion

        //    // CustomField3Required
        //    #region CustomField3Required
        //    bool IsCustomField3Required = bool.Parse(ds.Tables[0].Rows[0]["IsCustomField3Required"].ToString());
        //    if (IsCustomField3Required == true)
        //    {
        //        string CustomField3Remark = ds.Tables[0].Rows[0]["CustomField3Remark"].ToString();
        //        int CustomField3TypeId = int.Parse(ds.Tables[0].Rows[0]["CustomField3TypeId"].ToString());
        //        string CustomField3List = ds.Tables[0].Rows[0]["CustomField3List"].ToString();
        //        bool IsCustomField3Mandatory = bool.Parse(ds.Tables[0].Rows[0]["IsCustomField3Mandatory"].ToString());

        //        CustomField3Div.Visible = true;
        //        CustomField3AnswerLabel.Text = CustomField3Remark;

        //        if (CustomField3TypeId == 1 || CustomField3TypeId == 2)
        //        {
        //            CustomField3DropDownList.Visible = true;
        //            CustomField3DropDownList.Items.Clear();
        //            CustomField3DropDownList.Items.Add(new ListItem("- Select -", "0"));

        //            if (CustomField3TypeId == 1)
        //            {
        //                CustomField3DropDownList.Items.Add(new ListItem("Yes", "1"));
        //                CustomField3DropDownList.Items.Add(new ListItem("No", "2"));
        //            }

        //            else if (CustomField3TypeId == 2)
        //            {
        //                string[] strArray = CustomField3List.Split(',');

        //                for (int i = 0; i < strArray.Length; i++)
        //                {
        //                    CustomField3DropDownList.Items.Add(new ListItem(strArray[i].ToString(), (i + 1).ToString()));
        //                }
        //            }
        //        }
        //        else
        //        {
        //            if (CustomField3TypeId == 3)
        //            {
        //                CustomField3AnswerTextBox.Visible = true;
        //                CustomField3AnswerTextBox.TextMode = TextBoxMode.MultiLine;
        //            }
        //            if (CustomField3TypeId == 4)
        //            {
        //                CustomField3AnswerTextBox.Visible = true;
        //                CustomField3AnswerTextBox.Attributes.Add("onkeypress", "return isNumberKey(event)");
        //            }
        //        }

        //        if (IsCustomField3Mandatory == true)
        //            MCustomField3AnswerLabel.Visible = true;
        //        else
        //            MCustomField3AnswerLabel.Visible = false;
        //    }
        //    else
        //    {
        //        CustomField3Div.Visible = false;
        //        MCustomField3AnswerLabel.Text = string.Empty;
        //        CustomField3AnswerLabel.Text = string.Empty;
        //        CustomField3AnswerTextBox.Text = string.Empty;
        //        CustomField3DropDownList.Items.Clear();
        //    }
        //    #endregion
        //}


        //#region Dynemic Admission Form Filed

        //if (Session["AdmissionFormDetails"] != null)
        //{
        //    string SQLString = "SELECT Id, FieldRemark,FieldTypeId,FieldList,IsFieldMandatory,FieldGroup,FieldOrder,ISNULL(AdmissionFormFieldResponse,'') AS AdmissionFormFieldResponse " +
        //                                  "FROM sAdmission.tAdmissionCriteriaForm ACF LEFT JOIN sAdmission.tAdmissionFormField AFF ON ACF.Id= AFF.AdmissionCriteriaFormId AND AdmissionFormId = " + oldds.Tables[0].Rows[0]["Id"].ToString() +
        //                                  "WHERE ClassId =" + StandardDropDownList.SelectedValue + " AND BatchId = " + BatchDropDownList.SelectedValue + " ORDER BY FieldOrder";
        //    DataSet DS = new DataSet();
        //    CommonFunctions CF = new CommonFunctions();
        //    DS = CF.GetDataset(SQLString);
        //    if (DS != null && DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
        //    {
        //        AdmissionCriteriaFormDiv.Visible = true;
        //        AdmissionCriteriaFormGridView.DataSource = DS;
        //        AdmissionCriteriaFormGridView.DataBind();
        //        MergeRows(AdmissionCriteriaFormGridView);

        //    }
        //    else
        //    {
        //        AdmissionCriteriaFormGridView.DataSource = null;
        //        AdmissionCriteriaFormGridView.DataBind();
        //        AdmissionCriteriaFormDiv.Visible = false;
        //    }

        //}
        //else
        //{
        //    string SQLString = "SELECT Id, FieldRemark,FieldTypeId,FieldList,IsFieldMandatory,FieldGroup,FieldOrder,ISNULL(AdmissionFormFieldResponse,'') AS AdmissionFormFieldResponse " +
        //                                  "FROM sAdmission.tAdmissionCriteriaForm ACF LEFT JOIN sAdmission.tAdmissionFormField AFF ON ACF.Id= AFF.AdmissionCriteriaFormId AND AdmissionFormId = 0 " +
        //                                  "WHERE ClassId =" + StandardDropDownList.SelectedValue + " AND BatchId = " + BatchDropDownList.SelectedValue + " ORDER BY FieldOrder";
        //    DataSet DS = new DataSet();
        //    CommonFunctions CF = new CommonFunctions();
        //    DS = CF.GetDataset(SQLString);
        //    if (DS != null && DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
        //    {
        //        AdmissionCriteriaFormDiv.Visible = true;
        //        AdmissionCriteriaFormGridView.DataSource = DS;
        //        AdmissionCriteriaFormGridView.DataBind();
        //        MergeRows(AdmissionCriteriaFormGridView);

        //    }
        //    else
        //    {
        //        AdmissionCriteriaFormGridView.DataSource = null;
        //        AdmissionCriteriaFormGridView.DataBind();
        //        AdmissionCriteriaFormDiv.Visible = false;
        //    }
        //}
        //SetCasePropertyForTextBox();
        //#endregion


    }
    private void GetDisplayField()
    {
        Boolean IsDisplayFamilyDetails = false, IsDisplayAdmissionDetail = false, IsDisplayCollegeAdmissionDetail = false;
        Boolean IsDisplayGovRegNumberDetail = false, IsDisplayDemographicDetail = false, IsDisplayCommunicationDetail = false;
        Boolean IsDisplayBankDetail = false, IsDisplayBoardDetail = false, IsDisplayPassportDetail = false, IsDisplaySSCResultDetail = false;
        Boolean IsDisplayHSCResultDetail = false, IsDisplayJEEDetail = false, IsDisplayDiplomaDetail = false, IsDisplayStudentCustomFields = false;
        Boolean IsDisplayLocalAddress = false, IsDisplayPermanentAddress = false, IsDisplayEmergencyAddress = false, IsDisplayHealthDetail = false; // IsDisplayHealthDetail Addded By Dhananjay for Mantis - 0033982  
        //if (ClassIdDropDownList.SelectedValue != "-1")
        //{
        CommonFunctions CF = new CommonFunctions();
        string SQL_String = string.Empty;
        SQL_String = "SELECT  ISNULL(DM.Id,0) AS DisplayFieldId,ISNULL(DM.Name,'') AS Name,(CASE WHEN DO.OnlineRegistrationDisplayFieldId Is Null THEN 'False'  ELSE 'True' END) AS Selected ,(CASE WHEN DO.IsFieldMandatory Is Null THEN 'False' WHEN DO.IsFieldMandatory = 1 THEN 'True' ELSE 'False' END) AS IsMandatory " +
            " FROM sStudent.tOnlineRegistrationDisplayFieldMaster DM LEFT JOIN sStudent.tOnlineRegistrationDisplayField DO ON  DO.BatchId=" + BatchDropDownList.SelectedValue + " And DO.ClassId=" + ClassIdDropDownList.SelectedValue + " And DO.OnlineRegistrationDisplayFieldId = DM.Id WHERE DM.FieldSource = 'Online Student Registration' ";
        DataSet OnlineRegistrationDS = new DataSet();
        OnlineRegistrationDS = CF.GetDataset(SQL_String);
        if (OnlineRegistrationDS.Tables[0].Rows.Count > 0)
        {
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[0]["DisplayFieldId"].ToString()) == 1)
            {
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[0]["Selected"].ToString()) == true)
                {
                    MiddleNameDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[0]["IsMandatory"].ToString()) == true)
                        MiddleNamelbl.Visible = true;
                    else
                        MiddleNamelbl.Visible = false;
                }
                else
                    MiddleNameDiv.Visible = false;
            }

            //if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[1]["DisplayFieldId"].ToString()) == 2)
            //{
            //    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[1]["Selected"].ToString()) == true)
            //    {
            //        RecordTagDiv.Visible = true;
            //        if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[1]["IsMandatory"].ToString()) == true)
            //            RecordTaglbl.Visible = true;
            //        else
            //            RecordTaglbl.Visible = false;
            //    }
            //    else
            //        RecordTagDiv.Visible = false;
            //}


            //if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[2]["DisplayFieldId"].ToString()) == 3)
            //{
            //    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[2]["Selected"].ToString()) == true)
            //    {
            //        FeesCategoryDiv.Visible = true;
            //        if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[2]["IsMandatory"].ToString()) == true)
            //            FeesCategorylbl.Visible = true;
            //        else
            //            FeesCategorylbl.Visible = false;
            //    }
            //    else
            //        FeesCategoryDiv.Visible = false;
            //}
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[3]["DisplayFieldId"].ToString()) == 4)
            {
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[3]["Selected"].ToString()) == true)
                {
                    RegistrationNumberDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[3]["IsMandatory"].ToString()) == true)
                        RegistrationNumberlbl.Visible = true;
                    else
                        RegistrationNumberlbl.Visible = false;
                }
                else
                    RegistrationNumberDiv.Visible = false;
            }


            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[4]["DisplayFieldId"].ToString()) == 5)
            {
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[4]["Selected"].ToString()) == true)
                {
                    RollNoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[4]["IsMandatory"].ToString()) == true)
                        RollNolbl.Visible = true;
                    else
                        RollNolbl.Visible = false;
                }
                else
                    RollNoDiv.Visible = false;
            }

            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[5]["DisplayFieldId"].ToString()) == 6)
            {
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[5]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    FamilyDetailFatherNameDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[5]["IsMandatory"].ToString()) == true)
                        FamilyDetailFatherNamelbl.Visible = true;
                    else
                        FamilyDetailFatherNamelbl.Visible = false;
                }
                else
                    FamilyDetailFatherNameDiv.Visible = false;
            }


            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[6]["DisplayFieldId"].ToString()) == 7)
            {
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[6]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    FatherDateofBirthDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[6]["IsMandatory"].ToString()) == true)
                        FatherDateofBirthlbl.Visible = true;
                    else
                        FatherDateofBirthlbl.Visible = false;
                }
                else
                    FatherDateofBirthDiv.Visible = false;
            }


            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[7]["DisplayFieldId"].ToString()) == 8)
            {
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[7]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    FatherOccupationDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[7]["IsMandatory"].ToString()) == true)
                        FatherOccupationlbl.Visible = true;
                    else
                        FatherOccupationlbl.Visible = false;
                }
                else
                    FatherOccupationDiv.Visible = false;
            }


            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[8]["DisplayFieldId"].ToString()) == 9)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[8]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    FatherQualificationDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[8]["IsMandatory"].ToString()) == true)
                        FatherQualificationlbl.Visible = true;
                    else
                        FatherQualificationlbl.Visible = false;
                }
                else
                    FatherQualificationDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[9]["DisplayFieldId"].ToString()) == 10)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[9]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    FatherContactNoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[9]["IsMandatory"].ToString()) == true)
                        FatherContactNolbl.Visible = true;
                    else
                        FatherContactNolbl.Visible = false;
                }
                else
                    FatherContactNoDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[10]["DisplayFieldId"].ToString()) == 11)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[10]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    FatherMailDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[10]["IsMandatory"].ToString()) == true)
                        FatherMaillbl.Visible = true;
                    else
                        FatherMaillbl.Visible = false;
                }
                else
                    FatherMailDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[11]["DisplayFieldId"].ToString()) == 12)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[11]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    FatherOfficeAddressDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[11]["IsMandatory"].ToString()) == true)
                        FatherOfficeAddresslbl.Visible = true;
                    else
                        FatherOfficeAddresslbl.Visible = false;
                }
                else
                    FatherOfficeAddressDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[12]["DisplayFieldId"].ToString()) == 13)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[12]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    FatherIncomeDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[12]["IsMandatory"].ToString()) == true)
                        FatherIncomelbl.Visible = true;
                    else
                        FatherIncomelbl.Visible = false;
                }
                else
                    FatherIncomeDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[13]["DisplayFieldId"].ToString()) == 14)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[13]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    MotherNameDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[13]["IsMandatory"].ToString()) == true)
                        MotherNamelbl.Visible = true;
                    else
                        MotherNamelbl.Visible = false;
                }
                else
                    MotherNameDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[14]["DisplayFieldId"].ToString()) == 15)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[14]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    MotherDateofBirthDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[14]["IsMandatory"].ToString()) == true)
                        MotherDateofBirthlbl.Visible = true;
                    else
                        MotherDateofBirthlbl.Visible = false;
                }
                else
                    MotherDateofBirthDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[15]["DisplayFieldId"].ToString()) == 16)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[15]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    MotherOccupationDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[15]["IsMandatory"].ToString()) == true)
                        MotherOccupationlbl.Visible = true;
                    else
                        MotherOccupationlbl.Visible = false;
                }
                else
                    MotherOccupationDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[16]["DisplayFieldId"].ToString()) == 17)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[16]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    MotherQualificationDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[16]["IsMandatory"].ToString()) == true)
                        MotherQualificationlbl.Visible = true;
                    else
                        MotherQualificationlbl.Visible = false;
                }
                else
                    MotherQualificationDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[17]["DisplayFieldId"].ToString()) == 18)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[17]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    MotherContactNoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[17]["IsMandatory"].ToString()) == true)
                        MotherContactNolbl.Visible = true;
                    else
                        MotherContactNolbl.Visible = false;
                }
                else
                    MotherContactNoDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[18]["DisplayFieldId"].ToString()) == 19)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[18]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    MotherMailDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[18]["IsMandatory"].ToString()) == true)
                        MotherMaillbl.Visible = true;
                    else
                        MotherMaillbl.Visible = false;
                }
                else
                    MotherMailDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[19]["DisplayFieldId"].ToString()) == 20)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[19]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    MotherOfficeAddressDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[19]["IsMandatory"].ToString()) == true)
                        MotherOfficeAddresslbl.Visible = true;
                    else
                        MotherOfficeAddresslbl.Visible = false;
                }
                else
                    MotherOfficeAddressDiv.Visible = false;
            }

            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[20]["DisplayFieldId"].ToString()) == 21)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[20]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    MotherIncomeDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[20]["IsMandatory"].ToString()) == true)
                        MotherIncomelbl.Visible = true;
                    else
                        MotherIncomelbl.Visible = false;
                }
                else
                    MotherIncomeDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[21]["DisplayFieldId"].ToString()) == 22)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[21]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    RelationNameDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[21]["IsMandatory"].ToString()) == true)
                        RelationNamelbl.Visible = true;
                    else
                        RelationNamelbl.Visible = false;
                }
                else
                    RelationNameDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[22]["DisplayFieldId"].ToString()) == 23)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[22]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    RelativeNameDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[22]["IsMandatory"].ToString()) == true)
                        RelativeNamelbl.Visible = true;
                    else
                        RelativeNamelbl.Visible = false;
                }
                else
                    RelativeNameDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[23]["DisplayFieldId"].ToString()) == 24)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[23]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    RelativeDateofBirthDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[23]["IsMandatory"].ToString()) == true)
                        RelativeDateofBirthlbl.Visible = true;
                    else
                        RelativeDateofBirthlbl.Visible = false;
                }
                else
                    RelativeDateofBirthDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[24]["DisplayFieldId"].ToString()) == 25)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[24]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    RelativeOccupationDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[24]["IsMandatory"].ToString()) == true)
                        RelativeOccupationlbl.Visible = true;
                    else
                        RelativeOccupationlbl.Visible = false;
                }
                else
                    RelativeOccupationDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[25]["DisplayFieldId"].ToString()) == 26)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[25]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    RelativeQualificationDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[25]["IsMandatory"].ToString()) == true)
                        RelativeQualificationlbl.Visible = true;
                    else
                        RelativeQualificationlbl.Visible = false;
                }
                else
                    RelativeQualificationDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[26]["DisplayFieldId"].ToString()) == 27)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[26]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    RelativeContactNoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[26]["IsMandatory"].ToString()) == true)
                        RelativeContactNolbl.Visible = true;
                    else
                        RelativeContactNolbl.Visible = false;
                }
                else
                    RelativeContactNoDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[27]["DisplayFieldId"].ToString()) == 28)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[27]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    RelativeMailDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[27]["IsMandatory"].ToString()) == true)
                        RelativeMaillbl.Visible = true;
                    else
                        RelativeMaillbl.Visible = false;
                }
                else
                    RelativeMailDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[28]["DisplayFieldId"].ToString()) == 29)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[28]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    RelativeOfficeAddressDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[28]["IsMandatory"].ToString()) == true)
                        RelativeOfficeAddresslbl.Visible = true;
                    else
                        RelativeOfficeAddresslbl.Visible = false;
                }
                else
                    RelativeOfficeAddressDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[29]["DisplayFieldId"].ToString()) == 30)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[29]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    RelativeIncomeDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[29]["IsMandatory"].ToString()) == true)
                        RelativeIncomelbl.Visible = true;
                    else
                        RelativeIncomelbl.Visible = false;
                }
                else
                    RelativeIncomeDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[30]["DisplayFieldId"].ToString()) == 31)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[30]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    FatherPhotoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[30]["IsMandatory"].ToString()) == true)
                        FatherPhotolbl.Visible = true;
                    else
                        FatherPhotolbl.Visible = false;
                }
                else
                    FatherPhotoDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[31]["DisplayFieldId"].ToString()) == 32)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[31]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    MotherPhotoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[31]["IsMandatory"].ToString()) == true)
                        MotherPhotolbl.Visible = true;
                    else
                        MotherPhotolbl.Visible = false;
                }
                else
                    MotherPhotoDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[32]["DisplayFieldId"].ToString()) == 33)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[32]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    RelativePhotoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[32]["IsMandatory"].ToString()) == true)
                        RelativePhotolbl.Visible = true;
                    else
                        RelativePhotolbl.Visible = false;
                }
                else
                    RelativePhotoDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[33]["DisplayFieldId"].ToString()) == 34)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[33]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    MarriageAnniversaryDateDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[33]["IsMandatory"].ToString()) == true)
                        MarriageAnniversaryDatelbl.Visible = true;
                    else
                        MarriageAnniversaryDatelbl.Visible = false;
                }
                else
                    MarriageAnniversaryDateDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[34]["DisplayFieldId"].ToString()) == 35)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[34]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    LiveWithDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[34]["IsMandatory"].ToString()) == true)
                        LiveWithlbl.Visible = true;
                    else
                        LiveWithlbl.Visible = false;
                }
                else
                    LiveWithDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[35]["DisplayFieldId"].ToString()) == 36)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[35]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    ISFatherExStudentDiv.Visible = true;
                    //if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[35]["IsMandatory"].ToString()) == true)
                    //    ISFatherExStudentlbl.Visible = true;
                    //else
                    //    ISFatherExStudentlbl.Visible = false;
                }
                else
                    ISFatherExStudentDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[36]["DisplayFieldId"].ToString()) == 37)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[36]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    FatherPassOutYearDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[36]["IsMandatory"].ToString()) == true)
                        FatherPassOutYearlbl.Visible = true;
                    else
                        FatherPassOutYearlbl.Visible = false;
                }
                else
                    FatherPassOutYearDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[37]["DisplayFieldId"].ToString()) == 38)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[37]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    ISMotherExStudentDiv.Visible = true;
                    //if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[37]["IsMandatory"].ToString()) == true)
                    //    ISMotherExStudentlbl.Visible = true;
                    //else
                    //    ISMotherExStudentlbl.Visible = false;
                }
                else
                    ISMotherExStudentDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[38]["DisplayFieldId"].ToString()) == 39)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[38]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    MotherPassOutYearDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[38]["IsMandatory"].ToString()) == true)
                        MotherPassOutYearlbl.Visible = true;
                    else
                        MotherPassOutYearlbl.Visible = false;
                }
                else
                    MotherPassOutYearDiv.Visible = false;
            }

            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[39]["DisplayFieldId"].ToString()) == 40)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[39]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    ISRelativeExStudentDiv.Visible = true;
                    //if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[39]["IsMandatory"].ToString()) == true)
                    //    ISRelativeExStudentlbl.Visible = true;
                    //else
                    //    ISRelativeExStudentlbl.Visible = false;
                }
                else
                    ISRelativeExStudentDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[40]["DisplayFieldId"].ToString()) == 41)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[40]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    RelativePassOutYearDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[40]["IsMandatory"].ToString()) == true)
                        RelativePassOutYearlbl.Visible = true;
                    else
                        RelativePassOutYearlbl.Visible = false;
                }
                else
                    RelativePassOutYearDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[41]["DisplayFieldId"].ToString()) == 42)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[40]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    IsSingleChildDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[40]["IsMandatory"].ToString()) == true)
                        RelativePassOutYearlbl.Visible = true;
                    else
                        RelativePassOutYearlbl.Visible = false;
                }
                else
                    RelativePassOutYearDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[42]["DisplayFieldId"].ToString()) == 43)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[42]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    FatherOrganizationDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[42]["IsMandatory"].ToString()) == true)
                        FatherOrganizationlbl.Visible = true;
                    else
                        FatherOrganizationlbl.Visible = false;
                }
                else
                    FatherOrganizationDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[43]["DisplayFieldId"].ToString()) == 44)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[43]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    FatherDesignationDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[43]["IsMandatory"].ToString()) == true)
                        FatherDesignationlbl.Visible = true;
                    else
                        FatherDesignationlbl.Visible = false;
                }
                else
                    FatherDesignationDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[44]["DisplayFieldId"].ToString()) == 45)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[44]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    MotherOrganizationDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[44]["IsMandatory"].ToString()) == true)
                        MotherOrganizationlbl.Visible = true;
                    else
                        MotherOrganizationlbl.Visible = false;
                }
                else
                    MotherOrganizationDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[45]["DisplayFieldId"].ToString()) == 46)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[45]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    MotherDesignationDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[45]["IsMandatory"].ToString()) == true)
                        MotherDesignationlbl.Visible = true;
                    else
                        MotherDesignationlbl.Visible = false;
                }
                else
                    MotherDesignationDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[46]["DisplayFieldId"].ToString()) == 47)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[46]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    RelativeOrganizationDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[46]["IsMandatory"].ToString()) == true)
                        RelativeOrganizationlbl.Visible = true;
                    else
                        RelativeOrganizationlbl.Visible = false;
                }
                else
                    RelativeOrganizationDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[47]["DisplayFieldId"].ToString()) == 48)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[47]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    RelativeDesignationDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[47]["IsMandatory"].ToString()) == true)
                        RelativeDesignationlbl.Visible = true;
                    else
                        RelativeDesignationlbl.Visible = false;
                }
                else
                    RelativeDesignationDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[48]["DisplayFieldId"].ToString()) == 49)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[48]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    FatherAadharNoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[48]["IsMandatory"].ToString()) == true)
                        FatherAadharNolbl.Visible = true;
                    else
                        FatherAadharNolbl.Visible = false;
                }
                else
                    FatherAadharNoDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[49]["DisplayFieldId"].ToString()) == 50)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[49]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    MotherAadharNoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[49]["IsMandatory"].ToString()) == true)
                        MotherAadharNolbl.Visible = true;
                    else
                        MotherAadharNolbl.Visible = false;
                }
                else
                    MotherAadharNoDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[50]["DisplayFieldId"].ToString()) == 51)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[50]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    FatherOfficeContactNoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[50]["IsMandatory"].ToString()) == true)
                        FatherOfficeContactNolbl.Visible = true;
                    else
                        FatherOfficeContactNolbl.Visible = false;
                }
                else
                    FatherOfficeContactNoDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[51]["DisplayFieldId"].ToString()) == 52)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[51]["Selected"].ToString()) == true)
                {
                    IsDisplayFamilyDetails = true;
                    MotherOfficeContactNoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[51]["IsMandatory"].ToString()) == true)
                        MotherOfficeContactNolbl.Visible = true;
                    else
                        MotherOfficeContactNolbl.Visible = false;
                }
                else
                    MotherOfficeContactNoDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[52]["DisplayFieldId"].ToString()) == 53)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[52]["Selected"].ToString()) == true)
                {
                    IsDisplayGovRegNumberDetail = true;
                    UIDNumberDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[52]["IsMandatory"].ToString()) == true)
                        UIDNumberlbl.Visible = true;
                    else
                        UIDNumberlbl.Visible = false;
                }
                else
                    UIDNumberDiv.Visible = false;
            }
            //if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[53]["DisplayFieldId"].ToString()) == 54)
            //{

            //    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[53]["Selected"].ToString()) == true)
            //    {
            //        IsDisplayDemographicDetail = true;
            //        DateofBirthDiv.Visible = true;
            //        if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[53]["IsMandatory"].ToString()) == true)
            //            DateofBirthlbl.Visible = true;
            //        else
            //            DateofBirthlbl.Visible = false;
            //    }
            //    else
            //        DateofBirthDiv.Visible = false;
            //}
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[54]["DisplayFieldId"].ToString()) == 55)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[54]["Selected"].ToString()) == true)
                {
                    IsDisplayDemographicDetail = true;
                    BirthdateinwordDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[54]["IsMandatory"].ToString()) == true)
                        Birthdateinwordlbl.Visible = true;
                    else
                        Birthdateinwordlbl.Visible = false;
                }
                else
                    BirthdateinwordDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[55]["DisplayFieldId"].ToString()) == 56)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[55]["Selected"].ToString()) == true)
                {
                    IsDisplayDemographicDetail = true;
                    TransportDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[55]["IsMandatory"].ToString()) == true)
                        Transportlbl.Visible = true;
                    else
                        Transportlbl.Visible = false;
                }
                else
                    TransportDiv.Visible = false;
            }
            //if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[56]["DisplayFieldId"].ToString()) == 57)
            //{

            //    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[56]["Selected"].ToString()) == true)
            //    {
            //        IsDisplayDemographicDetail = true;
            //        GenderDiv.Visible = true;
            //        if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[56]["IsMandatory"].ToString()) == true)
            //            Genderlbl.Visible = true;
            //        else
            //            Genderlbl.Visible = false;
            //    }
            //    else
            //        GenderDiv.Visible = false;
            //}
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[57]["DisplayFieldId"].ToString()) == 58)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[57]["Selected"].ToString()) == true)
                {
                    IsDisplayDemographicDetail = true;
                    BloodGroupDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[57]["IsMandatory"].ToString()) == true)
                        BloodGrouplbl.Visible = true;
                    else
                        BloodGrouplbl.Visible = false;
                }
                else
                    BloodGroupDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[58]["DisplayFieldId"].ToString()) == 59)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[58]["Selected"].ToString()) == true)
                {
                    IsDisplayDemographicDetail = true;
                    BirthPlaceDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[58]["IsMandatory"].ToString()) == true)
                        BirthPlacelbl.Visible = true;
                    else
                        BirthPlacelbl.Visible = false;
                }
                else
                    BirthPlaceDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[59]["DisplayFieldId"].ToString()) == 60)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[59]["Selected"].ToString()) == true)
                {
                    IsDisplayDemographicDetail = true;
                    BirthTalukaDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[59]["IsMandatory"].ToString()) == true)
                        BirthTalukalbl.Visible = true;
                    else
                        BirthTalukalbl.Visible = false;
                }
                else
                    BirthTalukaDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[60]["DisplayFieldId"].ToString()) == 61)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[60]["Selected"].ToString()) == true)
                {
                    IsDisplayDemographicDetail = true;
                    BirthDistrictDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[60]["IsMandatory"].ToString()) == true)
                        BirthDistrictlbl.Visible = true;
                    else
                        BirthDistrictlbl.Visible = false;
                }
                else
                    BirthDistrictDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[61]["DisplayFieldId"].ToString()) == 62)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[61]["Selected"].ToString()) == true)
                {
                    IsDisplayDemographicDetail = true;
                    FamilyCasteDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[61]["IsMandatory"].ToString()) == true)
                        FamilyCastelbl.Visible = true;
                    else
                        FamilyCastelbl.Visible = false;
                }
                else
                    FamilyCasteDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[62]["DisplayFieldId"].ToString()) == 63)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[62]["Selected"].ToString()) == true)
                {
                    IsDisplayDemographicDetail = true;
                    FamilySubCasteDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[62]["IsMandatory"].ToString()) == true)
                        FamilySubCastelbl.Visible = true;
                    else
                        FamilySubCastelbl.Visible = false;
                }
                else
                    FamilySubCasteDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[63]["DisplayFieldId"].ToString()) == 64)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[63]["Selected"].ToString()) == true)
                {
                    IsDisplayDemographicDetail = true;
                    CasteCategoryDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[63]["IsMandatory"].ToString()) == true)
                        CasteCategorylbl.Visible = true;
                    else
                        CasteCategorylbl.Visible = false;
                }
                else
                    CasteCategoryDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[64]["DisplayFieldId"].ToString()) == 65)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[64]["Selected"].ToString()) == true)
                {
                    IsDisplayDemographicDetail = true;
                    ReligionDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[64]["IsMandatory"].ToString()) == true)
                        Religionlbl.Visible = true;
                    else
                        Religionlbl.Visible = false;
                }
                else
                    ReligionDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[65]["DisplayFieldId"].ToString()) == 66)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[65]["Selected"].ToString()) == true)
                {
                    IsDisplayDemographicDetail = true;
                    HouseDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[65]["IsMandatory"].ToString()) == true)
                        Houselbl.Visible = true;
                    else
                        Houselbl.Visible = false;
                }
                else
                    HouseDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[66]["DisplayFieldId"].ToString()) == 67)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[66]["Selected"].ToString()) == true)
                {
                    IsDisplayDemographicDetail = true;
                    MotherTongueDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[66]["IsMandatory"].ToString()) == true)
                        MotherTonguelbl.Visible = true;
                    else
                        MotherTonguelbl.Visible = false;
                }
                else
                    MotherTongueDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[67]["DisplayFieldId"].ToString()) == 68)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[67]["Selected"].ToString()) == true)
                {
                    IsDisplayDemographicDetail = true;
                    NationalityDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[67]["IsMandatory"].ToString()) == true)
                        Nationalitylbl.Visible = true;
                    else
                        Nationalitylbl.Visible = false;
                }
                else
                    NationalityDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[68]["DisplayFieldId"].ToString()) == 69)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[68]["Selected"].ToString()) == true)
                {
                    IsDisplayDemographicDetail = true;
                    HobbyDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[68]["IsMandatory"].ToString()) == true)
                        Hobbylbl.Visible = true;
                    else
                        Hobbylbl.Visible = false;
                }
                else
                    HobbyDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[69]["DisplayFieldId"].ToString()) == 70)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[69]["Selected"].ToString()) == true)
                {
                    IsDisplayDemographicDetail = true;
                    ReferenceRemarkDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[69]["IsMandatory"].ToString()) == true)
                        ReferenceRemarklbl.Visible = true;
                    else
                        ReferenceRemarklbl.Visible = false;
                }
                else
                    ReferenceRemarkDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[70]["DisplayFieldId"].ToString()) == 71)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[70]["Selected"].ToString()) == true)
                {
                    IsDisplayGovRegNumberDetail = true;
                    AadhaarNumberDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[70]["IsMandatory"].ToString()) == true)
                        AadhaarNumberlbl.Visible = true;
                    else
                        AadhaarNumberlbl.Visible = false;
                }
                else
                    AadhaarNumberDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[71]["DisplayFieldId"].ToString()) == 72)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[71]["Selected"].ToString()) == true)
                {
                    IsDisplayDemographicDetail = true;
                    QuotaDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[71]["IsMandatory"].ToString()) == true)
                        Quotalbl.Visible = true;
                    else
                        Quotalbl.Visible = false;
                }
                else
                    QuotaDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[72]["DisplayFieldId"].ToString()) == 73)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[72]["Selected"].ToString()) == true)
                {
                    IsDisplayDemographicDetail = true;
                    BirthStateDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[72]["IsMandatory"].ToString()) == true)
                        BirthStatelbl.Visible = true;
                    else
                        BirthStatelbl.Visible = false;
                }
                else
                    BirthStateDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[73]["DisplayFieldId"].ToString()) == 74)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[73]["Selected"].ToString()) == true)
                {
                    IsDisplayBankDetail = true;
                    BirthCountryDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[73]["IsMandatory"].ToString()) == true)
                        BirthCountrylbl.Visible = true;
                    else
                        BirthCountrylbl.Visible = false;
                }
                else
                    BirthCountryDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[74]["DisplayFieldId"].ToString()) == 75)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[74]["Selected"].ToString()) == true)
                {
                    IsDisplayBankDetail = true;
                    BankAccountNumberDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[74]["IsMandatory"].ToString()) == true)
                        BankAccountNumberlbl.Visible = true;
                    else
                        BankAccountNumberlbl.Visible = false;
                }
                else
                    BankAccountNumberDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[75]["DisplayFieldId"].ToString()) == 76)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[75]["Selected"].ToString()) == true)
                {
                    IsDisplayBankDetail = true;
                    BankNameDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[75]["IsMandatory"].ToString()) == true)
                        BankNamelbl.Visible = true;
                    else
                        BankNamelbl.Visible = false;
                }
                else
                    BankNameDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[76]["DisplayFieldId"].ToString()) == 77)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[76]["Selected"].ToString()) == true)
                {
                    IsDisplayBankDetail = true;
                    BankBranchDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[76]["IsMandatory"].ToString()) == true)
                        BankBranchlbl.Visible = true;
                    else
                        BankBranchlbl.Visible = false;
                }
                else
                    BankBranchDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[77]["DisplayFieldId"].ToString()) == 78)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[77]["Selected"].ToString()) == true)
                {
                    IsDisplayBankDetail = true;
                    BankIFSCCodeDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[77]["IsMandatory"].ToString()) == true)
                        BankIFSCCodelbl.Visible = true;
                    else
                        BankIFSCCodelbl.Visible = false;
                }
                else
                    BankIFSCCodeDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[78]["DisplayFieldId"].ToString()) == 79)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[78]["Selected"].ToString()) == true)
                {
                    IsDisplayBoardDetail = true;
                    Class9BoardRegistrationNumberDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[78]["IsMandatory"].ToString()) == true)
                        Class9BoardRegistrationNumberlbl.Visible = true;
                    else
                        Class9BoardRegistrationNumberlbl.Visible = false;
                }
                else
                    Class9BoardRegistrationNumberDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[79]["DisplayFieldId"].ToString()) == 80)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[79]["Selected"].ToString()) == true)
                {
                    IsDisplayBoardDetail = true;
                    Class11BoardRegistrationNumberDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[79]["IsMandatory"].ToString()) == true)
                        Class11BoardRegistrationNumberlbl.Visible = true;
                    else
                        Class11BoardRegistrationNumberlbl.Visible = false;
                }
                else
                    Class11BoardRegistrationNumberDiv.Visible = false;
            }
            //if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[74]["DisplayFieldId"].ToString()) == 75)
            //{

            //    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[74]["Selected"].ToString()) == true)
            //    {
            //        IsDisplayDemographicDetail = true;
            //        MotherTongueDiv.Visible = true;
            //        if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[74]["IsMandatory"].ToString()) == true)
            //            MotherTonguelbl.Visible = true;
            //        else
            //            MotherTonguelbl.Visible = false;
            //    }
            //    else
            //        MotherTongueDiv.Visible = false;
            //}
            //if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[75]["DisplayFieldId"].ToString()) == 76)
            //{

            //    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[75]["Selected"].ToString()) == true)
            //    {
            //        IsDisplayDemographicDetail = true;
            //        QuotaDiv.Visible = true;
            //        if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[75]["IsMandatory"].ToString()) == true)
            //            Quotalbl.Visible = true;
            //        else
            //            Quotalbl.Visible = false;
            //    }
            //    else
            //        AdmissionQuotaDiv.Visible = false;
            //}


            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[80]["DisplayFieldId"].ToString()) == 81)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[80]["Selected"].ToString()) == true)
                {
                    IsDisplayPassportDetail = true;
                    PassportNumberDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[80]["IsMandatory"].ToString()) == true)
                        PassportNumberlbl.Visible = true;
                    else
                        PassportNumberlbl.Visible = false;
                }
                else
                    PassportNumberDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[81]["DisplayFieldId"].ToString()) == 82)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[81]["Selected"].ToString()) == true)
                {
                    IsDisplayPassportDetail = true;
                    PassportTypeDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[81]["IsMandatory"].ToString()) == true)
                        PassportTypelbl.Visible = true;
                    else
                        PassportTypelbl.Visible = false;
                }
                else
                    PassportTypeDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[82]["DisplayFieldId"].ToString()) == 83)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[82]["Selected"].ToString()) == true)
                {
                    IsDisplayPassportDetail = true;
                    PassportCountryCodeDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[82]["IsMandatory"].ToString()) == true)
                        PassportCountryCodelbl.Visible = true;
                    else
                        PassportCountryCodelbl.Visible = false;
                }
                else
                    PassportCountryCodeDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[83]["DisplayFieldId"].ToString()) == 84)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[83]["Selected"].ToString()) == true)
                {
                    IsDisplayPassportDetail = true;
                    PassportIssueDateDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[83]["IsMandatory"].ToString()) == true)
                        PassportIssueDatelbl.Visible = true;
                    else
                        PassportIssueDatelbl.Visible = false;
                }
                else
                    PassportIssueDateDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[84]["DisplayFieldId"].ToString()) == 85)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[84]["Selected"].ToString()) == true)
                {
                    IsDisplayPassportDetail = true;
                    PassportExpiryDateDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[84]["IsMandatory"].ToString()) == true)
                        PassportExpiryDatelbl.Visible = true;
                    else
                        PassportExpiryDatelbl.Visible = false;
                }
                else
                    PassportExpiryDateDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[85]["DisplayFieldId"].ToString()) == 86)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[85]["Selected"].ToString()) == true)
                {
                    IsDisplayBankDetail = true;
                    BankAccountHolderNameDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[85]["IsMandatory"].ToString()) == true)
                        BankAccountHolderNamelbl.Visible = true;
                    else
                        BankAccountHolderNamelbl.Visible = false;
                }
                else
                    BankAccountHolderNameDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[86]["DisplayFieldId"].ToString()) == 87)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[86]["Selected"].ToString()) == true)
                {
                    IsDisplayLocalAddress = true;
                    IsDisplayCommunicationDetail = true;
                    LocalAddressAddress1Div.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[86]["IsMandatory"].ToString()) == true)
                        LocalAddressAddress1lbl.Visible = true;
                    else
                        LocalAddressAddress1lbl.Visible = false;
                }
                else
                    LocalAddressAddress1Div.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[87]["DisplayFieldId"].ToString()) == 88)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[87]["Selected"].ToString()) == true)
                {
                    IsDisplayLocalAddress = true;
                    IsDisplayCommunicationDetail = true;
                    LocalAddressAddress2Div.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[87]["IsMandatory"].ToString()) == true)
                        LocalAddressAddress2lbl.Visible = true;
                    else
                        LocalAddressAddress2lbl.Visible = false;
                }
                else
                    LocalAddressAddress2Div.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[88]["DisplayFieldId"].ToString()) == 89)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[88]["Selected"].ToString()) == true)
                {
                    IsDisplayLocalAddress = true;
                    IsDisplayCommunicationDetail = true;
                    LocalAddressAddress3Div.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[88]["IsMandatory"].ToString()) == true)
                        LocalAddressAddress3lbl.Visible = true;
                    else
                        LocalAddressAddress3lbl.Visible = false;
                }
                else
                    LocalAddressAddress3Div.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[89]["DisplayFieldId"].ToString()) == 90)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[89]["Selected"].ToString()) == true)
                {
                    IsDisplayLocalAddress = true;
                    IsDisplayCommunicationDetail = true;
                    LocalAddressCountryDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[89]["IsMandatory"].ToString()) == true)
                        LocalAddressCountrylbl.Visible = true;
                    else
                        LocalAddressCountrylbl.Visible = false;
                }
                else
                    LocalAddressCountryDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[90]["DisplayFieldId"].ToString()) == 91)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[90]["Selected"].ToString()) == true)
                {
                    IsDisplayLocalAddress = true;
                    IsDisplayCommunicationDetail = true;
                    LocalAddressStateDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[90]["IsMandatory"].ToString()) == true)
                        LocalAddressStatelbl.Visible = true;
                    else
                        LocalAddressStatelbl.Visible = false;
                }
                else
                    LocalAddressStateDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[91]["DisplayFieldId"].ToString()) == 92)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[91]["Selected"].ToString()) == true)
                {
                    IsDisplayLocalAddress = true;
                    IsDisplayCommunicationDetail = true;
                    LocalAddressCityDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[91]["IsMandatory"].ToString()) == true)
                        LocalAddressCitylbl.Visible = true;
                    else
                        LocalAddressCitylbl.Visible = false;
                }
                else
                    LocalAddressCityDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[92]["DisplayFieldId"].ToString()) == 93)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[92]["Selected"].ToString()) == true)
                {
                    IsDisplayLocalAddress = true;
                    IsDisplayCommunicationDetail = true;
                    LocalAddressPINCodeDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[92]["IsMandatory"].ToString()) == true)
                        LocalAddressPINCodelbl.Visible = true;
                    else
                        LocalAddressPINCodelbl.Visible = false;
                }
                else
                    LocalAddressPINCodeDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[93]["DisplayFieldId"].ToString()) == 94)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[93]["Selected"].ToString()) == true)
                {
                    IsDisplayLocalAddress = true;
                    IsDisplayCommunicationDetail = true;
                    LocalAddressContactNoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[93]["IsMandatory"].ToString()) == true)
                        LocalAddressContactNolbl.Visible = true;
                    else
                        LocalAddressContactNolbl.Visible = false;
                }
                else
                    LocalAddressContactNoDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[94]["DisplayFieldId"].ToString()) == 95)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[94]["Selected"].ToString()) == true)
                {
                    IsDisplayPermanentAddress = true;
                    IsDisplayCommunicationDetail = true;
                    PermanentAddressAddress1Div.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[94]["IsMandatory"].ToString()) == true)
                        PermanentAddressAddress1lbl.Visible = true;
                    else
                        PermanentAddressAddress1lbl.Visible = false;
                }
                else
                    PermanentAddressAddress1Div.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[95]["DisplayFieldId"].ToString()) == 96)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[95]["Selected"].ToString()) == true)
                {
                    IsDisplayPermanentAddress = true;
                    IsDisplayCommunicationDetail = true;
                    PermanentAddressAddress2Div.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[95]["IsMandatory"].ToString()) == true)
                        PermanentAddressAddress2lbl.Visible = true;
                    else
                        PermanentAddressAddress2lbl.Visible = false;
                }
                else
                    PermanentAddressAddress2Div.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[96]["DisplayFieldId"].ToString()) == 97)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[96]["Selected"].ToString()) == true)
                {
                    IsDisplayPermanentAddress = true;
                    IsDisplayCommunicationDetail = true;
                    PermanentAddressAddress3Div.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[96]["IsMandatory"].ToString()) == true)
                        PermanentAddressAddress3lbl.Visible = true;
                    else
                        PermanentAddressAddress3lbl.Visible = false;
                }
                else
                    PermanentAddressAddress3Div.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[97]["DisplayFieldId"].ToString()) == 98)
            {
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[97]["Selected"].ToString()) == true)
                {
                    IsDisplayPermanentAddress = true;
                    IsDisplayCommunicationDetail = true;
                    PermanentAddressCountryDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[97]["IsMandatory"].ToString()) == true)
                        PermanentAddressCountrylbl.Visible = true;
                    else
                        PermanentAddressCountrylbl.Visible = false;
                }
                else
                    PermanentAddressCountryDiv.Visible = false;
            }

            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[98]["DisplayFieldId"].ToString()) == 99)
            {
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[98]["Selected"].ToString()) == true)
                {
                    IsDisplayPermanentAddress = true;
                    IsDisplayCommunicationDetail = true;
                    PermanentAddressStateDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[98]["IsMandatory"].ToString()) == true)
                        PermanentAddressStatelbl.Visible = true;
                    else
                        PermanentAddressStatelbl.Visible = false;
                }
                else
                    PermanentAddressStateDiv.Visible = false;
            }


            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[99]["DisplayFieldId"].ToString()) == 100)
            {
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[99]["Selected"].ToString()) == true)
                {
                    IsDisplayPermanentAddress = true;
                    IsDisplayCommunicationDetail = true;
                    PermanentAddressCityDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[99]["IsMandatory"].ToString()) == true)
                        PermanentAddressCitylbl.Visible = true;
                    else
                        PermanentAddressCitylbl.Visible = false;
                }
                else
                    PermanentAddressCityDiv.Visible = false;
            }


            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[100]["DisplayFieldId"].ToString()) == 101)
            {
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[100]["Selected"].ToString()) == true)
                {
                    IsDisplayPermanentAddress = true;
                    IsDisplayCommunicationDetail = true;
                    PermanentAddressPINCodeDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[100]["IsMandatory"].ToString()) == true)
                        PermanentAddressPINCodelbl.Visible = true;
                    else
                        PermanentAddressPINCodelbl.Visible = false;
                }
                else
                    PermanentAddressPINCodeDiv.Visible = false;
            }


            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[101]["DisplayFieldId"].ToString()) == 102)
            {
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[101]["Selected"].ToString()) == true)
                {
                    IsDisplayPermanentAddress = true;
                    IsDisplayCommunicationDetail = true;
                    PermanentAddressContactNoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[101]["IsMandatory"].ToString()) == true)
                        PermanentAddressContactNolbl.Visible = true;
                    else
                        PermanentAddressContactNolbl.Visible = false;
                }
                else
                    PermanentAddressContactNoDiv.Visible = false;
            }


            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[102]["DisplayFieldId"].ToString()) == 103)
            {
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[102]["Selected"].ToString()) == true)
                {
                    IsDisplayEmergencyAddress = true;
                    IsDisplayCommunicationDetail = true;
                    EmergencyAddressAddress1Div.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[102]["IsMandatory"].ToString()) == true)
                        EmergencyAddressAddress1lbl.Visible = true;
                    else
                        EmergencyAddressAddress1lbl.Visible = false;
                }
                else
                    EmergencyAddressAddress1Div.Visible = false;
            }


            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[103]["DisplayFieldId"].ToString()) == 104)
            {
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[103]["Selected"].ToString()) == true)
                {
                    IsDisplayEmergencyAddress = true;
                    IsDisplayCommunicationDetail = true;
                    EmergencyAddressAddress2Div.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[103]["IsMandatory"].ToString()) == true)
                        EmergencyAddressAddress2lbl.Visible = true;
                    else
                        EmergencyAddressAddress2lbl.Visible = false;
                }
                else
                    EmergencyAddressAddress2Div.Visible = false;
            }

            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[104]["DisplayFieldId"].ToString()) == 105)
            {
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[104]["Selected"].ToString()) == true)
                {
                    IsDisplayEmergencyAddress = true;
                    IsDisplayCommunicationDetail = true;
                    EmergencyAddressAddress3Div.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[104]["IsMandatory"].ToString()) == true)
                        EmergencyAddressAddress3lbl.Visible = true;
                    else
                        EmergencyAddressAddress3lbl.Visible = false;
                }
                else
                    EmergencyAddressAddress3Div.Visible = false;
            }


            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[105]["DisplayFieldId"].ToString()) == 106)
            {
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[105]["Selected"].ToString()) == true)
                {
                    IsDisplayEmergencyAddress = true;
                    IsDisplayCommunicationDetail = true;
                    EmergencyAddressCountryDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[105]["IsMandatory"].ToString()) == true)
                        EmergencyAddressCountrylbl.Visible = true;
                    else
                        EmergencyAddressCountrylbl.Visible = false;
                }
                else
                    EmergencyAddressCountryDiv.Visible = false;
            }


            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[106]["DisplayFieldId"].ToString()) == 107)
            {
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[106]["Selected"].ToString()) == true)
                {
                    IsDisplayEmergencyAddress = true;
                    IsDisplayCommunicationDetail = true;
                    EmergencyAddressStateDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[106]["IsMandatory"].ToString()) == true)
                        EmergencyAddressStatelbl.Visible = true;
                    else
                        EmergencyAddressStatelbl.Visible = false;
                }
                else
                    EmergencyAddressStateDiv.Visible = false;
            }


            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[107]["DisplayFieldId"].ToString()) == 108)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[107]["Selected"].ToString()) == true)
                {
                    IsDisplayEmergencyAddress = true;
                    IsDisplayCommunicationDetail = true;
                    EmergencyAddressCityDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[107]["IsMandatory"].ToString()) == true)
                        EmergencyAddressCitylbl.Visible = true;
                    else
                        EmergencyAddressCitylbl.Visible = false;
                }
                else
                    EmergencyAddressCityDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[108]["DisplayFieldId"].ToString()) == 109)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[108]["Selected"].ToString()) == true)
                {
                    IsDisplayEmergencyAddress = true;
                    IsDisplayCommunicationDetail = true;
                    EmergencyAddressPINCodeDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[108]["IsMandatory"].ToString()) == true)
                        EmergencyAddressPINCodelbl.Visible = true;
                    else
                        EmergencyAddressPINCodelbl.Visible = false;
                }
                else
                    EmergencyAddressPINCodeDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[109]["DisplayFieldId"].ToString()) == 110)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[109]["Selected"].ToString()) == true)
                {
                    IsDisplayEmergencyAddress = true;
                    IsDisplayCommunicationDetail = true;
                    EmergencyAddressContactNoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[109]["IsMandatory"].ToString()) == true)
                        EmergencyAddressContactNolbl.Visible = true;
                    else
                        EmergencyAddressContactNolbl.Visible = false;
                }
                else
                    EmergencyAddressContactNoDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[110]["DisplayFieldId"].ToString()) == 111)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[110]["Selected"].ToString()) == true)
                {
                    IsDisplayEmergencyAddress = true;
                    IsDisplayCommunicationDetail = true;
                    ParentContactNoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[110]["IsMandatory"].ToString()) == true)
                        ParentContactNolbl.Visible = true;
                    else
                        ParentContactNolbl.Visible = false;
                }
                else
                    ParentContactNoDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[111]["DisplayFieldId"].ToString()) == 112)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[111]["Selected"].ToString()) == true)
                {
                    IsDisplayCommunicationDetail = true;
                    ParentEmailDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[111]["IsMandatory"].ToString()) == true)
                        ParentEmaillbl.Visible = true;
                    else
                        ParentEmaillbl.Visible = false;
                }
                else
                    ParentEmailDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[112]["DisplayFieldId"].ToString()) == 113)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[112]["Selected"].ToString()) == true)
                {
                    IsDisplayCommunicationDetail = true;
                    StudentContactNoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[112]["IsMandatory"].ToString()) == true)
                        StudentContactNolbl.Visible = true;
                    else
                        StudentContactNolbl.Visible = false;
                }
                else
                    StudentContactNoDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[113]["DisplayFieldId"].ToString()) == 114)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[113]["Selected"].ToString()) == true)
                {
                    IsDisplayCommunicationDetail = true;
                    StudentEmailDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[113]["IsMandatory"].ToString()) == true)
                        StudentEmaillbl.Visible = true;
                    else
                        StudentEmaillbl.Visible = false;
                }
                else
                    StudentEmailDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[114]["DisplayFieldId"].ToString()) == 115)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[114]["Selected"].ToString()) == true)
                {
                    IsDisplayCommunicationDetail = true;
                    DistanceFromSchoolDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[114]["IsMandatory"].ToString()) == true)
                        DistanceFromSchoollbl.Visible = true;
                    else
                        DistanceFromSchoollbl.Visible = false;
                }
                else
                    DistanceFromSchoolDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[115]["DisplayFieldId"].ToString()) == 116)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[115]["Selected"].ToString()) == true)
                {
                    IsDisplayCommunicationDetail = true;
                    StudentCustomAlertDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[115]["IsMandatory"].ToString()) == true)
                        StudentCustomAlertlbl.Visible = true;
                    else
                        StudentCustomAlertlbl.Visible = false;
                }
                else
                    StudentCustomAlertDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[116]["DisplayFieldId"].ToString()) == 117)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[116]["Selected"].ToString()) == true)
                {
                    IsDisplayCommunicationDetail = true;
                    WhatsAppContactNoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[116]["IsMandatory"].ToString()) == true)
                        WhatsAppContactNolbl.Visible = true;
                    else
                        WhatsAppContactNolbl.Visible = false;
                }
                else
                    WhatsAppContactNoDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[117]["DisplayFieldId"].ToString()) == 118)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[117]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    PreviousSchoolDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[117]["IsMandatory"].ToString()) == true)
                        PreviousSchoollbl.Visible = true;
                    else
                        PreviousSchoollbl.Visible = false;
                }
                else
                    PreviousSchoolDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[118]["DisplayFieldId"].ToString()) == 119)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[118]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    PreviousSchoolTypeDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[118]["IsMandatory"].ToString()) == true)
                        PreviousSchoolTypelbl.Visible = true;
                    else
                        PreviousSchoolTypelbl.Visible = false;
                }
                else
                    PreviousSchoolTypeDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[119]["DisplayFieldId"].ToString()) == 120)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[119]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    PreviousSchoolDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[119]["IsMandatory"].ToString()) == true)
                        PreviousSchoollbl.Visible = true;
                    else
                        PreviousSchoollbl.Visible = false;
                }
                else
                    PreviousSchoolDiv.Visible = false;
            }
            //if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[120]["DisplayFieldId"].ToString()) == 121)
            //{

            //    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[120]["Selected"].ToString()) == true)
            //    {
            //        IsDisplayAdmissionDetail = true;
            //        AdmissionNumberDiv.Visible = true;
            //        if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[120]["IsMandatory"].ToString()) == true)
            //            AdmissionNumberlbl.Visible = true;
            //        else
            //            AdmissionNumberlbl.Visible = false;
            //    }
            //    else
            //        AdmissionNumberDiv.Visible = false;
            //}
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[121]["DisplayFieldId"].ToString()) == 122)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[121]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    AdmissionFormNumberDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[121]["IsMandatory"].ToString()) == true)
                        AdmissionFormNumberlbl.Visible = true;
                    else
                        AdmissionFormNumberlbl.Visible = false;
                }
                else
                    AdmissionFormNumberDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[122]["DisplayFieldId"].ToString()) == 123)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[122]["Selected"].ToString()) == true)
                {

                    AdmissionStandardDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[122]["IsMandatory"].ToString()) == true)
                        AdmissionStandardlbl.Visible = true;
                    else
                        AdmissionStandardlbl.Visible = false;
                }
                else
                    AdmissionStandardDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[123]["DisplayFieldId"].ToString()) == 124)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[123]["Selected"].ToString()) == true)
                {
                    //IsDisplayAdmissionDetail = true;
                    AdmissionDateDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[123]["IsMandatory"].ToString()) == true)
                        AdmissionDatelbl.Visible = true;
                    else
                        AdmissionDatelbl.Visible = false;
                }
                else
                    AdmissionDateDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[124]["DisplayFieldId"].ToString()) == 125)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[124]["Selected"].ToString()) == true)
                {
                    //IsDisplayAdmissionDetail = true;
                    AdmissionYearDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[124]["IsMandatory"].ToString()) == true)
                        AdmissionYearlbl.Visible = true;
                    else
                        AdmissionYearlbl.Visible = false;
                }
                else
                    AdmissionYearDiv.Visible = false;
            }
            //if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[125]["DisplayFieldId"].ToString()) == 126)
            //{

            //    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[125]["Selected"].ToString()) == true)
            //    {
            //        //IsDisplayAdmissionDetail = true;
            //        LeftStandardDiv.Visible = true;
            //        if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[125]["IsMandatory"].ToString()) == true)
            //            LeftStandardlbl.Visible = true;
            //        else
            //            LeftStandardlbl.Visible = false;
            //    }
            //    else
            //        LeftStandardDiv.Visible = false;
            //}
            //if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[126]["DisplayFieldId"].ToString()) == 127)
            //{

            //    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[126]["Selected"].ToString()) == true)
            //    {
            //        //IsDisplayAdmissionDetail = true;
            //        LeftDatedDiv.Visible = true;
            //        if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[126]["IsMandatory"].ToString()) == true)
            //            LeftDatedlbl.Visible = true;
            //        else
            //            LeftDatedlbl.Visible = false;
            //    }
            //    else
            //        LeftDatedDiv.Visible = false;
            //}
            //if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[127]["DisplayFieldId"].ToString()) == 128)
            //{

            //    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[127]["Selected"].ToString()) == true)
            //    {
            //        //IsDisplayAdmissionDetail = true;
            //        LeftYearDiv.Visible = true;
            //        if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[127]["IsMandatory"].ToString()) == true)
            //            LeftYearlbl.Visible = true;
            //        else
            //            LeftYearlbl.Visible = false;
            //    }
            //    else
            //        LeftYearDiv.Visible = false;
            //}
            //if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[128]["DisplayFieldId"].ToString()) == 129)
            //{

            //    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[128]["Selected"].ToString()) == true)
            //    {
            //        //IsDisplayAdmissionDetail = true;
            //        InActiveDateDiv.Visible = true;
            //        if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[128]["IsMandatory"].ToString()) == true)
            //            InActiveDatelbl.Visible = true;
            //        else
            //            InActiveDatelbl.Visible = false;
            //    }
            //    else
            //        InActiveDateDiv.Visible = false;
            //}
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[129]["DisplayFieldId"].ToString()) == 130)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[129]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    InActiveReasonDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[129]["IsMandatory"].ToString()) == true)
                        InActiveReasonlbl.Visible = true;
                    else
                        InActiveReasonlbl.Visible = false;
                }
                else
                    InActiveReasonDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[130]["DisplayFieldId"].ToString()) == 131)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[130]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    LeftReasonDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[130]["IsMandatory"].ToString()) == true)
                        LeftReasonlbl.Visible = true;
                    else
                        LeftReasonlbl.Visible = false;
                }
                else
                    LeftReasonDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[131]["DisplayFieldId"].ToString()) == 132)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[131]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    LCProgressDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[131]["IsMandatory"].ToString()) == true)
                        LCProgresslbl.Visible = true;
                    else
                        LCProgresslbl.Visible = false;
                }
                else
                    LCProgressDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[132]["DisplayFieldId"].ToString()) == 133)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[132]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    LCConductDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[132]["IsMandatory"].ToString()) == true)
                        LCConductlbl.Visible = true;
                    else
                        LCConductlbl.Visible = false;
                }
                else
                    LCConductDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[133]["DisplayFieldId"].ToString()) == 134)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[133]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    LCBookDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[133]["IsMandatory"].ToString()) == true)
                        LCBooklbl.Visible = true;
                    else
                        LCBooklbl.Visible = false;
                }
                else
                    LCBookDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[134]["DisplayFieldId"].ToString()) == 135)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[134]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    LCNumberDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[134]["IsMandatory"].ToString()) == true)
                        LCNumberlbl.Visible = true;
                    else
                        LCNumberlbl.Visible = false;
                }
                else
                    LCNumberDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[135]["DisplayFieldId"].ToString()) == 136)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[135]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    LCDateDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[135]["IsMandatory"].ToString()) == true)
                        LCDatelbl.Visible = true;
                    else
                        LCDatelbl.Visible = false;
                }
                else
                    LCDateDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[136]["DisplayFieldId"].ToString()) == 137)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[136]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    LCRemarkDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[136]["IsMandatory"].ToString()) == true)
                        LCRemarklbl.Visible = true;
                    else
                        LCRemarklbl.Visible = false;
                }
                else
                    LCRemarkDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[137]["DisplayFieldId"].ToString()) == 138)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[137]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    LCCopyDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[137]["IsMandatory"].ToString()) == true)
                        LCCopylbl.Visible = true;
                    else
                        LCCopylbl.Visible = false;
                }
                else
                    LCCopyDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[138]["DisplayFieldId"].ToString()) == 139)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[138]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    LcIdDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[138]["IsMandatory"].ToString()) == true)
                        LcIdlbl.Visible = true;
                    else
                        LcIdlbl.Visible = false;
                }
                else
                    LcIdDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[139]["DisplayFieldId"].ToString()) == 140)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[139]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    ExamSeatNoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[139]["IsMandatory"].ToString()) == true)
                        ExamSeatNolbl.Visible = true;
                    else
                        ExamSeatNolbl.Visible = false;
                }
                else
                    ExamSeatNoDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[140]["DisplayFieldId"].ToString()) == 141)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[140]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    AdmissionNumberDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[140]["IsMandatory"].ToString()) == true)
                        AdmissionNumberlbl.Visible = true;
                    else
                        AdmissionNumberlbl.Visible = false;
                }
                else
                    AdmissionNumberDiv.Visible = false;
            }


            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[141]["DisplayFieldId"].ToString()) == 142)// || Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[154]["DisplayFieldId"].ToString()) == 155)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[141]["Selected"].ToString()) == true)// || Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[154]["Selected"].ToString()) == true)
                {
                    IsDisplayCollegeAdmissionDetail = true;
                    IsDisplayAdmissionDetail = true;
                    IsTransferDiv.Visible = true;
                    //if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[141]["IsMandatory"].ToString()) == true)// || Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[154]["IsMandatory"].ToString()) == true)
                    //    IsTransferlbl.Visible = true;
                    //else
                    //    IsTransferlbl.Visible = false;
                }
                else
                    IsTransferDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[142]["DisplayFieldId"].ToString()) == 143)//|| Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[155]["DisplayFieldId"].ToString()) == 156)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[142]["Selected"].ToString()) == true)// || Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[155]["Selected"].ToString()) == true)
                {
                    IsDisplayCollegeAdmissionDetail = true;
                    TransferFromDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[142]["IsMandatory"].ToString()) == true)// || Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[155]["IsMandatory"].ToString()) == true)
                        TransferFromlbl.Visible = true;
                    else
                        TransferFromlbl.Visible = false;
                }
                else
                    TransferFromDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[143]["DisplayFieldId"].ToString()) == 144)// || Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[156]["DisplayFieldId"].ToString()) == 157)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[143]["Selected"].ToString()) == true)// || Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[156]["Selected"].ToString()) == true)
                {
                    IsDisplayCollegeAdmissionDetail = true;
                    PassingYearDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[143]["IsMandatory"].ToString()) == true)// || Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[156]["IsMandatory"].ToString()) == true)
                        PassingYearlbl.Visible = true;
                    else
                        PassingYearlbl.Visible = false;
                }
                else
                    PassingYearDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[144]["DisplayFieldId"].ToString()) == 145)// || Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[157]["DisplayFieldId"].ToString()) == 158)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[144]["Selected"].ToString()) == true)// || Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[157]["Selected"].ToString()) == true)
                {
                    IsDisplayCollegeAdmissionDetail = true;
                    IsTFWSDiv.Visible = true;
                    //if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[144]["IsMandatory"].ToString()) == true)// || Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[157]["IsMandatory"].ToString()) == true)
                    //    IsTFWSlbl.Visible = true;
                    //else
                    //    IsTFWSlbl.Visible = false;
                }
                else
                    IsTFWSDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[145]["DisplayFieldId"].ToString()) == 146)// || Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[158]["DisplayFieldId"].ToString()) == 159)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[145]["Selected"].ToString()) == true)// || Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[158]["Selected"].ToString()) == true)
                {
                    IsDisplayCollegeAdmissionDetail = true;
                    IsCertificateHolderDiv.Visible = true;
                    //if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[145]["IsMandatory"].ToString()) == true)// || Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[158]["IsMandatory"].ToString()) == true)
                    //    IsCertificateHolderlbl.Visible = true;
                    //else
                    //    IsCertificateHolderlbl.Visible = false;
                }
                else
                    IsCertificateHolderDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[146]["DisplayFieldId"].ToString()) == 147)// || Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[159]["DisplayFieldId"].ToString()) == 160)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[146]["Selected"].ToString()) == true)// || Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[159]["Selected"].ToString()) == true)
                {
                    IsDisplayCollegeAdmissionDetail = true;
                    CertificateNameDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[146]["IsMandatory"].ToString()) == true)// || Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[159]["IsMandatory"].ToString()) == true)
                        CertificateNamelbl.Visible = true;
                    else
                        CertificateNamelbl.Visible = false;
                }
                else
                    CertificateNameDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[147]["DisplayFieldId"].ToString()) == 148)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[147]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    AdmissionQuotaDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[147]["IsMandatory"].ToString()) == true)
                        AdmissionQuotalbl.Visible = true;
                    else
                        AdmissionQuotalbl.Visible = false;
                }
                else
                    AdmissionQuotaDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[148]["DisplayFieldId"].ToString()) == 149)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[148]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    PreviousStandardDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[148]["IsMandatory"].ToString()) == true)
                        PreviousStandardlbl.Visible = true;
                    else
                        PreviousStandardlbl.Visible = false;
                }
                else
                    PreviousStandardDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[149]["DisplayFieldId"].ToString()) == 150)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[149]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    PreviousLCNumberDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[149]["IsMandatory"].ToString()) == true)
                        PreviousLCNumberlbl.Visible = true;
                    else
                        PreviousLCNumberlbl.Visible = false;
                }
                else
                    PreviousLCNumberDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[150]["DisplayFieldId"].ToString()) == 151)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[150]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    PreviousLCDateDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[150]["IsMandatory"].ToString()) == true)
                        PreviousLCDatelbl.Visible = true;
                    else
                        PreviousLCDatelbl.Visible = false;
                }
                else
                    PreviousLCDateDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[151]["DisplayFieldId"].ToString()) == 152)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[151]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    PreviousResultDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[151]["IsMandatory"].ToString()) == true)
                        PreviousResultlbl.Visible = true;
                    else
                        PreviousResultlbl.Visible = false;
                }
                else
                    PreviousResultDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[152]["DisplayFieldId"].ToString()) == 153)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[152]["Selected"].ToString()) == true)
                {
                    IsDisplayAdmissionDetail = true;
                    ProofOfDOBDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[152]["IsMandatory"].ToString()) == true)
                        ProofOfDOBlbl.Visible = true;
                    else
                        ProofOfDOBlbl.Visible = false;
                }
                else
                    ProofOfDOBDiv.Visible = false;
            }
            //if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[153]["DisplayFieldId"].ToString()) == 154)
            //{

            //    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[153]["Selected"].ToString()) == true)
            //    {
            //        IsDisplayAdmissionDetail = true;
            //        AdmissionNumberDiv.Visible = true;
            //        if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[153]["IsMandatory"].ToString()) == true)
            //            AdmissionNumberlbl.Visible = true;
            //        else
            //            AdmissionNumberlbl.Visible = false;
            //    }
            //    else
            //        AdmissionNumberDiv.Visible = false;
            //}

            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[160]["DisplayFieldId"].ToString()) == 161)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[160]["Selected"].ToString()) == true)
                {
                    IsDisplaySSCResultDetail = true;
                    SSCBoardDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[160]["IsMandatory"].ToString()) == true)
                        SSCBoardlbl.Visible = true;
                    else
                        SSCBoardlbl.Visible = false;
                }
                else
                    SSCBoardDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[161]["DisplayFieldId"].ToString()) == 162)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[161]["Selected"].ToString()) == true)
                {
                    IsDisplaySSCResultDetail = true;
                    SSCSchoolDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[161]["IsMandatory"].ToString()) == true)
                        SSCSchoollbl.Visible = true;
                    else
                        SSCSchoollbl.Visible = false;
                }
                else
                    SSCSchoolDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[162]["DisplayFieldId"].ToString()) == 163)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[162]["Selected"].ToString()) == true)
                {
                    IsDisplaySSCResultDetail = true;
                    SSCPassingYearDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[162]["IsMandatory"].ToString()) == true)
                        SSCPassingYearlbl.Visible = true;
                    else
                        SSCPassingYearlbl.Visible = false;
                }
                else
                    SSCPassingYearDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[163]["DisplayFieldId"].ToString()) == 164)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[163]["Selected"].ToString()) == true)
                {
                    IsDisplaySSCResultDetail = true;
                    SSCObtainMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[163]["IsMandatory"].ToString()) == true)
                        SSCObtainMarkslbl.Visible = true;
                    else
                        SSCObtainMarkslbl.Visible = false;
                }
                else
                    SSCObtainMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[164]["DisplayFieldId"].ToString()) == 165)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[164]["Selected"].ToString()) == true)
                {
                    IsDisplaySSCResultDetail = true;
                    SSCOutOfMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[164]["IsMandatory"].ToString()) == true)
                        SSCOutOfMarkslbl.Visible = true;
                    else
                        SSCOutOfMarkslbl.Visible = false;
                }
                else
                    SSCOutOfMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[165]["DisplayFieldId"].ToString()) == 166)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[165]["Selected"].ToString()) == true)
                {
                    IsDisplaySSCResultDetail = true;
                    SSCPercentageDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[165]["IsMandatory"].ToString()) == true)
                        SSCPercentagelbl.Visible = true;
                    else
                        SSCPercentagelbl.Visible = false;
                }
                else
                    SSCPercentageDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[166]["DisplayFieldId"].ToString()) == 167)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[166]["Selected"].ToString()) == true)
                {
                    IsDisplaySSCResultDetail = true;
                    SSCMathMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[166]["IsMandatory"].ToString()) == true)
                        SSCMathMarkslbl.Visible = true;
                    else
                        SSCMathMarkslbl.Visible = false;
                }
                else
                    SSCMathMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[167]["DisplayFieldId"].ToString()) == 168)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[167]["Selected"].ToString()) == true)
                {
                    IsDisplaySSCResultDetail = true;
                    SSCMathOutOfMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[167]["IsMandatory"].ToString()) == true)
                        SSCMathOutOfMarkslbl.Visible = true;
                    else
                        SSCMathOutOfMarkslbl.Visible = false;
                }
                else
                    SSCMathOutOfMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[168]["DisplayFieldId"].ToString()) == 169)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[168]["Selected"].ToString()) == true)
                {
                    IsDisplayHSCResultDetail = true;
                    HSCBoardDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[168]["IsMandatory"].ToString()) == true)
                        HSCBoardlbl.Visible = true;
                    else
                        HSCBoardlbl.Visible = false;
                }
                else
                    HSCBoardDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[169]["DisplayFieldId"].ToString()) == 170)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[169]["Selected"].ToString()) == true)
                {
                    IsDisplayHSCResultDetail = true;
                    HSCSchoolDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[169]["IsMandatory"].ToString()) == true)
                        HSCSchoollbl.Visible = true;
                    else
                        HSCSchoollbl.Visible = false;
                }
                else
                    HSCSchoolDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[170]["DisplayFieldId"].ToString()) == 171)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[170]["Selected"].ToString()) == true)
                {
                    IsDisplayHSCResultDetail = true;
                    HSCPassingYearDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[170]["IsMandatory"].ToString()) == true)
                        HSCPassingYearlbl.Visible = true;
                    else
                        HSCPassingYearlbl.Visible = false;
                }
                else
                    HSCPassingYearDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[171]["DisplayFieldId"].ToString()) == 172)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[171]["Selected"].ToString()) == true)
                {
                    IsDisplayHSCResultDetail = true;
                    HSCObtainMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[171]["IsMandatory"].ToString()) == true)
                        HSCObtainMarkslbl.Visible = true;
                    else
                        HSCObtainMarkslbl.Visible = false;
                }
                else
                    HSCObtainMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[172]["DisplayFieldId"].ToString()) == 173)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[172]["Selected"].ToString()) == true)
                {
                    IsDisplayHSCResultDetail = true;
                    HSCOutOfMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[172]["IsMandatory"].ToString()) == true)
                        HSCOutOfMarkslbl.Visible = true;
                    else
                        HSCOutOfMarkslbl.Visible = false;
                }
                else
                    HSCOutOfMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[173]["DisplayFieldId"].ToString()) == 174)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[173]["Selected"].ToString()) == true)
                {
                    IsDisplayHSCResultDetail = true;
                    HSCPercentageDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[173]["IsMandatory"].ToString()) == true)
                        HSCPercentagelbl.Visible = true;
                    else
                        HSCPercentagelbl.Visible = false;
                }
                else
                    HSCPercentageDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[174]["DisplayFieldId"].ToString()) == 175)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[174]["Selected"].ToString()) == true)
                {
                    IsDisplayHSCResultDetail = true;
                    HSCPhysicsMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[174]["IsMandatory"].ToString()) == true)
                        HSCPhysicsMarkslbl.Visible = true;
                    else
                        HSCPhysicsMarkslbl.Visible = false;
                }
                else
                    HSCPhysicsMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[175]["DisplayFieldId"].ToString()) == 176)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[175]["Selected"].ToString()) == true)
                {
                    IsDisplayHSCResultDetail = true;
                    HSCPhysicsOutOfMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[175]["IsMandatory"].ToString()) == true)
                        HSCPhysicsOutOfMarkslbl.Visible = true;
                    else
                        HSCPhysicsOutOfMarkslbl.Visible = false;
                }
                else
                    HSCPhysicsOutOfMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[176]["DisplayFieldId"].ToString()) == 177)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[176]["Selected"].ToString()) == true)
                {
                    IsDisplayHSCResultDetail = true;
                    HSCChemistryMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[176]["IsMandatory"].ToString()) == true)
                        HSCChemistryMarkslbl.Visible = true;
                    else
                        HSCChemistryMarkslbl.Visible = false;
                }
                else
                    HSCChemistryMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[177]["DisplayFieldId"].ToString()) == 178)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[177]["Selected"].ToString()) == true)
                {
                    IsDisplayHSCResultDetail = true;
                    HSCChemistryOutOfMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[177]["IsMandatory"].ToString()) == true)
                        HSCChemistryOutOfMarkslbl.Visible = true;
                    else
                        HSCChemistryOutOfMarkslbl.Visible = false;
                }
                else
                    HSCChemistryOutOfMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[178]["DisplayFieldId"].ToString()) == 179)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[178]["Selected"].ToString()) == true)
                {
                    IsDisplayHSCResultDetail = true;
                    HSCMathMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[178]["IsMandatory"].ToString()) == true)
                        HSCMathMarkslbl.Visible = true;
                    else
                        HSCMathMarkslbl.Visible = false;
                }
                else
                    HSCMathMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[179]["DisplayFieldId"].ToString()) == 180)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[179]["Selected"].ToString()) == true)
                {
                    IsDisplayHSCResultDetail = true;
                    HSCMathOutOfMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[179]["IsMandatory"].ToString()) == true)
                        HSCMathOutOfMarkslbl.Visible = true;
                    else
                        HSCMathOutOfMarkslbl.Visible = false;
                }
                else
                    HSCMathOutOfMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[180]["DisplayFieldId"].ToString()) == 181)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[180]["Selected"].ToString()) == true)
                {
                    IsDisplayHSCResultDetail = true;
                    HSCBiologyMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[180]["IsMandatory"].ToString()) == true)
                        HSCBiologyMarkslbl.Visible = true;
                    else
                        HSCBiologyMarkslbl.Visible = false;
                }
                else
                    HSCBiologyMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[181]["DisplayFieldId"].ToString()) == 182)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[181]["Selected"].ToString()) == true)
                {
                    IsDisplayHSCResultDetail = true;
                    HSCBiologyOutOfMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[181]["IsMandatory"].ToString()) == true)
                        HSCBiologyOutOfMarkslbl.Visible = true;
                    else
                        HSCBiologyOutOfMarkslbl.Visible = false;
                }
                else
                    HSCBiologyOutOfMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[182]["DisplayFieldId"].ToString()) == 183)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[182]["Selected"].ToString()) == true)
                {
                    IsDisplayHSCResultDetail = true;
                    PCMMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[182]["IsMandatory"].ToString()) == true)
                        PCMMarkslbl.Visible = true;
                    else
                        PCMMarkslbl.Visible = false;
                }
                else
                    PCMMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[183]["DisplayFieldId"].ToString()) == 184)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[183]["Selected"].ToString()) == true)
                {
                    IsDisplayHSCResultDetail = true;
                    PCBMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[183]["IsMandatory"].ToString()) == true)
                        PCBMarkslbl.Visible = true;
                    else
                        PCBMarkslbl.Visible = false;
                }
                else
                    PCBMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[184]["DisplayFieldId"].ToString()) == 185)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[184]["Selected"].ToString()) == true)
                {
                    IsDisplayJEEDetail = true;
                    JEERollNoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[184]["IsMandatory"].ToString()) == true)
                        JEERollNolbl.Visible = true;
                    else
                        JEERollNolbl.Visible = false;
                }
                else
                    JEERollNoDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[185]["DisplayFieldId"].ToString()) == 186)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[185]["Selected"].ToString()) == true)
                {
                    IsDisplayJEEDetail = true;
                    JEEMeritNoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[185]["IsMandatory"].ToString()) == true)
                        JEEMeritNolbl.Visible = true;
                    else
                        JEEMeritNolbl.Visible = false;
                }
                else
                    JEEMeritNoDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[186]["DisplayFieldId"].ToString()) == 187)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[186]["Selected"].ToString()) == true)
                {
                    IsDisplayJEEDetail = true;
                    JEEMeritMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[186]["IsMandatory"].ToString()) == true)
                        JEEMeritMarkslbl.Visible = true;
                    else
                        JEEMeritMarkslbl.Visible = false;
                }
                else
                    JEEMeritMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[187]["DisplayFieldId"].ToString()) == 188)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[187]["Selected"].ToString()) == true)
                {
                    IsDisplayJEEDetail = true;
                    JEEOutOfMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[187]["IsMandatory"].ToString()) == true)
                        JEEOutOfMarkslbl.Visible = true;
                    else
                        JEEOutOfMarkslbl.Visible = false;
                }
                else
                    JEEOutOfMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[188]["DisplayFieldId"].ToString()) == 189)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[188]["Selected"].ToString()) == true)
                {
                    IsDisplayDiplomaDetail = true;
                    DiplomaBoardDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[188]["IsMandatory"].ToString()) == true)
                        DiplomaBoardlbl.Visible = true;
                    else
                        DiplomaBoardlbl.Visible = false;
                }
                else
                    DiplomaBoardDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[189]["DisplayFieldId"].ToString()) == 190)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[189]["Selected"].ToString()) == true)
                {
                    IsDisplayDiplomaDetail = true;
                    DiplomaCollegeDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[189]["IsMandatory"].ToString()) == true)
                        DiplomaCollegelbl.Visible = true;
                    else
                        DiplomaCollegelbl.Visible = false;
                }
                else
                    DiplomaCollegeDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[190]["DisplayFieldId"].ToString()) == 191)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[190]["Selected"].ToString()) == true)
                {
                    IsDisplayDiplomaDetail = true;
                    DiplomaPassingYearDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[190]["IsMandatory"].ToString()) == true)
                        DiplomaPassingYearlbl.Visible = true;
                    else
                        DiplomaPassingYearlbl.Visible = false;
                }
                else
                    DiplomaPassingYearDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[191]["DisplayFieldId"].ToString()) == 192)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[191]["Selected"].ToString()) == true)
                {
                    IsDisplayDiplomaDetail = true;
                    DiplomaObtainMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[191]["IsMandatory"].ToString()) == true)
                        DiplomaObtainMarkslbl.Visible = true;
                    else
                        DiplomaObtainMarkslbl.Visible = false;
                }
                else
                    DiplomaObtainMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[192]["DisplayFieldId"].ToString()) == 193)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[192]["Selected"].ToString()) == true)
                {
                    IsDisplayDiplomaDetail = true;
                    DiplomaOutOfMarksDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[192]["IsMandatory"].ToString()) == true)
                        DiplomaOutOfMarkslbl.Visible = true;
                    else
                        DiplomaOutOfMarkslbl.Visible = false;
                }
                else
                    DiplomaOutOfMarksDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[193]["DisplayFieldId"].ToString()) == 194)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[193]["Selected"].ToString()) == true)
                {
                    IsDisplayDiplomaDetail = true;
                    DiplomaPercentageDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[193]["IsMandatory"].ToString()) == true)
                        DiplomaPercentagelbl.Visible = true;
                    else
                        DiplomaPercentagelbl.Visible = false;
                }
                else
                    DiplomaPercentageDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[194]["DisplayFieldId"].ToString()) == 195)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[194]["Selected"].ToString()) == true)
                {
                    IsDisplayDiplomaDetail = true;
                    ApplicationIdDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[194]["IsMandatory"].ToString()) == true)
                        ApplicationIdlbl.Visible = true;
                    else
                        ApplicationIdlbl.Visible = false;
                }
                else
                    ApplicationIdDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[195]["DisplayFieldId"].ToString()) == 196)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[195]["Selected"].ToString()) == true)
                {
                    IsDisplayDiplomaDetail = true;
                    AdmissionRoundDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[195]["IsMandatory"].ToString()) == true)
                        AdmissionRoundlbl.Visible = true;
                    else
                        AdmissionRoundlbl.Visible = false;
                }
                else
                    AdmissionRoundDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[196]["DisplayFieldId"].ToString()) == 197)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[196]["Selected"].ToString()) == true)
                {
                    IsDisplayCollegeAdmissionDetail = true;
                    MaritalStatusDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[196]["IsMandatory"].ToString()) == true)
                        MaritalStatuslbl.Visible = true;
                    else
                        MaritalStatuslbl.Visible = false;
                }
                else
                    MaritalStatusDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[197]["DisplayFieldId"].ToString()) == 198)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[197]["Selected"].ToString()) == true)
                {
                    IsDisplaySSCResultDetail = true;
                    SSCPercentileDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[197]["IsMandatory"].ToString()) == true)
                        SSCPercentilelbl.Visible = true;
                    else
                        SSCPercentilelbl.Visible = false;
                }
                else
                    SSCPercentileDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[198]["DisplayFieldId"].ToString()) == 199)
            {

                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[198]["Selected"].ToString()) == true)
                {
                    IsDisplaySSCResultDetail = true;
                    SSCGradeDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[198]["IsMandatory"].ToString()) == true)
                        SSCGradelbl.Visible = true;
                    else
                        SSCGradelbl.Visible = false;
                }
                else
                    SSCGradeDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[199]["DisplayFieldId"].ToString()) == 200)
            {
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[199]["Selected"].ToString()) == true)
                {
                    StudentPhotoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[199]["IsMandatory"].ToString()) == true)
                        StudentPhotolbl.Visible = true;
                    else
                        StudentPhotolbl.Visible = false;
                }
                else
                    StudentPhotoDiv.Visible = false;
            }
            // Addded By Dhananjay for Mantis Start- 0033982  
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[200]["DisplayFieldId"].ToString()) == 201)
            {
                IsDisplayHealthDetail = true;
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[200]["Selected"].ToString()) == true)
                {
                    ISPhysicalDeformityDiv.Visible = true;
                    PhysicalDropDownListDiv.Visible = true;
                    PhysicalDisabilityDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[200]["IsMandatory"].ToString()) == true)
                    {
                        Physicallbl.Visible = true;
                        PhysicalDisabilitylbl.Visible = true;
                    }
                    else
                    {
                        Physicallbl.Visible = false;
                        PhysicalDisabilitylbl.Visible = false;
                    }
                }
                else
                {
                    ISPhysicalDeformityDiv.Visible = false;
                    PhysicalDisabilityDiv.Visible = false;
                    PhysicalDropDownListDiv.Visible = false;
                }
            }

            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[201]["DisplayFieldId"].ToString()) == 202)
            {
                IsDisplayHealthDetail = true;
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[201]["Selected"].ToString()) == true)
                {
                    MajorIllnesschkDiv.Visible = true;
                    MajorIllnessDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[201]["IsMandatory"].ToString()) == true)
                        MajorIllnesslbl.Visible = true;
                    else
                        MajorIllnesslbl.Visible = false;
                }
                else
                {
                    MajorIllnesschkDiv.Visible = false;
                    MajorIllnessDiv.Visible = false;
                }
            }

            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[202]["DisplayFieldId"].ToString()) == 203)
            {
                IsDisplayHealthDetail = true;
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[202]["Selected"].ToString()) == true)
                {
                    PastHistorychkDiv.Visible = true;
                    PastHistoryDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[202]["IsMandatory"].ToString()) == true)
                        PastHistorylbl.Visible = true;
                    else
                        PastHistorylbl.Visible = false;
                }
                else
                {
                    PastHistorychkDiv.Visible = false;
                    PastHistoryDiv.Visible = false;
                }

            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[203]["DisplayFieldId"].ToString()) == 204)
            {
                IsDisplayHealthDetail = true;
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[203]["Selected"].ToString()) == true)
                {
                    AllergychkDiv.Visible = true;
                    AllergyDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[203]["IsMandatory"].ToString()) == true)
                        Allergylbl.Visible = true;
                    else
                        Allergylbl.Visible = false;
                }
                else
                {
                    AllergychkDiv.Visible = false;
                    AllergyDiv.Visible = false;
                }
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[204]["DisplayFieldId"].ToString()) == 205)
            {
                IsDisplayHealthDetail = true;
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[204]["Selected"].ToString()) == true)
                {
                    IdentificationMark1Div.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[204]["IsMandatory"].ToString()) == true)
                        IdentificationMark1lbl.Visible = true;
                    else
                        IdentificationMark1lbl.Visible = false;
                }
                else
                    IdentificationMark1Div.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[205]["DisplayFieldId"].ToString()) == 206)
            {
                IsDisplayHealthDetail = true;
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[205]["Selected"].ToString()) == true)
                {
                    IdentificationMark2Div.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[205]["IsMandatory"].ToString()) == true)
                        IdentificationMark2lbl.Visible = true;
                    else
                        IdentificationMark2lbl.Visible = false;
                }
                else
                    IdentificationMark2Div.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[206]["DisplayFieldId"].ToString()) == 207)
            {
                IsDisplayHealthDetail = true;
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[206]["Selected"].ToString()) == true)
                {
                    FamilyDoctorNameDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[206]["IsMandatory"].ToString()) == true)
                        FamilyDoctorNamelbl.Visible = true;
                    else
                        FamilyDoctorNamelbl.Visible = false;
                }
                else
                    FamilyDoctorNameDiv.Visible = false;
            }
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[207]["DisplayFieldId"].ToString()) == 208)
            {
                IsDisplayHealthDetail = true;
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[207]["Selected"].ToString()) == true)
                {
                    FamilyDoctorContactNoDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[207]["IsMandatory"].ToString()) == true)
                        FamilyDoctorContactNolbl.Visible = true;
                    else
                        FamilyDoctorContactNolbl.Visible = false;
                }
                else
                    FamilyDoctorContactNoDiv.Visible = false;
            }
            //Added for Mantis : 34798 by Nilesh
            if (Int32.Parse(OnlineRegistrationDS.Tables[0].Rows[208]["DisplayFieldId"].ToString()) == 209)
            {
                IsDisplayHealthDetail = true;
                if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[208]["Selected"].ToString()) == true)
                {
                    SurnameDiv.Visible = true;
                    if (Boolean.Parse(OnlineRegistrationDS.Tables[0].Rows[208]["IsMandatory"].ToString()) == true)
                        Surnamelbl.Visible = true;
                    else
                        Surnamelbl.Visible = false;
                }
                else
                    SurnameDiv.Visible = false;
            }

        }

        if (IsDisplayHealthDetail)
            HealthDetailDiv.Visible = true;
        else
            HealthDetailDiv.Visible = false;
        // Addded By Dhananjay for Mantis End- 0033982  
        if (IsDisplayFamilyDetails)
            FamilyDetailDiv.Visible = true;
        else
            FamilyDetailDiv.Visible = false;
        if (IsDisplayAdmissionDetail)
            AdmissionDetailDiv.Visible = true;
        else
            AdmissionDetailDiv.Visible = false;
        if (IsDisplayCollegeAdmissionDetail)
            CollegeAdmissionDetailDiv.Visible = true;
        else
            CollegeAdmissionDetailDiv.Visible = false;
        if (IsDisplayGovRegNumberDetail)
            GovRegNumberDetailDiv.Visible = true;
        else
            GovRegNumberDetailDiv.Visible = false;
        if (IsDisplayDemographicDetail)
            DemographicDetailDiv.Visible = true;
        else
            DemographicDetailDiv.Visible = false;
        if (IsDisplayCommunicationDetail)
            CommunicationDetailDiv.Visible = true;
        else
            CommunicationDetailDiv.Visible = false;
        if (IsDisplayBankDetail)
            BankDetailDiv.Visible = true;
        else
            BankDetailDiv.Visible = false;
        if (IsDisplayBoardDetail)
            BoardDetailDiv.Visible = true;
        else
            BoardDetailDiv.Visible = false;
        if (IsDisplayPassportDetail)
            PassportDetailDiv.Visible = true;
        else
            PassportDetailDiv.Visible = false;
        if (IsDisplaySSCResultDetail)
            SSCResultDetailDiv.Visible = true;
        else
            SSCResultDetailDiv.Visible = false;
        if (IsDisplayHSCResultDetail)
            HSCResultDetailDiv.Visible = true;
        else
            HSCResultDetailDiv.Visible = false;
        if (IsDisplayJEEDetail)
            JEEDetailDiv.Visible = true;
        else
            JEEDetailDiv.Visible = false;
        if (IsDisplayDiplomaDetail)
            DiplomaDetailDiv.Visible = true;
        else
            DiplomaDetailDiv.Visible = false;
        //if (IsDisplayStudentCustomFields)
        //    OnlineRegistrationCriteriaFormDiv.Visible = true;
        //else
        //    OnlineRegistrationCriteriaFormDiv.Visible = false;
        if (IsDisplayLocalAddress)
            LocalAddressDiv.Visible = true;
        else
            LocalAddressDiv.Visible = false;
        if (IsDisplayPermanentAddress)
            PermanentAddressDiv.Visible = true;
        else
            PermanentAddressDiv.Visible = false;
        if (IsDisplayEmergencyAddress)
            EmergencyAddressDiv.Visible = true;
        else
            EmergencyAddressDiv.Visible = false;

        string CheckOptionalSubject = "SELECT 1 FROM [sStudent].[tOnlineRegistrationCriteria] WHERE BatchId = " + BatchDropDownList.SelectedValue + " AND ClassId = " + ClassIdDropDownList.SelectedValue + " AND IsOptionalSubject = 1";
        CommonFunctions OptionalSubjectCF = new CommonFunctions();
        DataSet OptionalSubjectDS = OptionalSubjectCF.GetDataset(CheckOptionalSubject);
        if (OptionalSubjectDS != null && OptionalSubjectDS.Tables.Count > 0 && OptionalSubjectDS.Tables[0].Rows.Count > 0)
            OptionalSubjectDiv.Visible = true;
        else
            OptionalSubjectDiv.Visible = false;

    }
    protected void AddOptionSubjectLinkButton_CheckedChanged(object sender, EventArgs e)
    {
        try
        {

            if (AddOptionSubjectLinkButton.Checked == true)
            {

                DivClassCheckBoxList.Visible = true;

            }
            else
                DivClassCheckBoxList.Visible = false;


        }
        catch (Exception ex)
        {
            ExceptionHelper.HandleException(ex, ExceptionPolicyEnum.UI_Policy);
        }
    }
    protected void SubjectCheckBox_CheckedChanged(object sender, EventArgs e)
    {
        try
        {
            if (SubjectCheckBox.Checked == true)
            {
                for (int i = 0; i < SubjectCheckBoxList.Items.Count; i++)
                {
                    SubjectCheckBoxList.Items[i].Selected = true;
                }
            }
            else
            {
                for (int i = 0; i < SubjectCheckBoxList.Items.Count; i++)
                {
                    SubjectCheckBoxList.Items[i].Selected = false;
                }
            }
            SubjectCheckBox.Focus();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    protected void IsCertificateHolderCheckBox_CheckedChanged(object sender, EventArgs e)
    {
        try
        {
            if (IsCertificateHolderCheckBox.Checked)
            {
                CertificateNameTextBox.Enabled = true;
            }
            else
            {
                CertificateNameTextBox.Enabled = false;
            }
        }

        catch (Exception ex)
        {
            throw ex;
        }
    }
    protected void FillOrgDropDownList()
    {
        LoadDropDown LoadDropDownData = new LoadDropDown();
        CommonFunctions CommonFunctionsObject = new CommonFunctions();
        // Fills LoadDropDownData Object With Appropriate Values To Fill 
        LoadDropDownData.DropDownControlName = OrgDropDownList;
        LoadDropDownData.TableName = "[sSetup].[tOrganizationMaster]";
        LoadDropDownData.KeyFieldName = "Id";
        LoadDropDownData.FieldName = "DisplayTitle";
        //LoadDropDownData.DescriptionFieldName = "Remark";
        //LoadDropDownData.DelimiterCharacter = "-";

        //LoadDropDownData.Condition = "IsObsolete=0 AND OrgGroupId = " + Session["OnlineAdmissionOrgGroupId"].ToString();
        LoadDropDownData.Condition = "IsObsolete=0 AND OrgGroupId = " + Session["OnlineOrgGroupId"].ToString();
        LoadDropDownData.DisplayDefaultTextAsAll = false;
        LoadDropDownData.SortOrderObject = SortOrder.SortCustomAscending;
        LoadDropDownData.CustomSortField = "OrderIndex";
        LoadDropDownData.IsCacheEnabled = false;
        // Function To Load Drop Down List
        CommonFunctionsObject.LoadDropDownList(LoadDropDownData);
    }

    protected void StudentCriteriaFormGridView_RowDataBound(object sender, EventArgs e)
    {
        //OrgDropDownList.Focus();

        try
        {

        }

        catch (Exception ex)
        {
            throw ex;
        }
    }
    public bool convertFatherImage(byte[] imgBytes)
    {
        try
        {
            TypeConverter tc = TypeDescriptor.GetConverter(typeof(Bitmap));
            Bitmap MyBitmap = (Bitmap)tc.ConvertFrom(imgBytes);

            string imgString = Convert.ToBase64String(imgBytes);

            System.Drawing.Image convertToImage = System.Drawing.Image.FromStream(new MemoryStream(Convert.FromBase64String(imgString)));
            //Set the source with data:image/bmp
            FatherImage.Src = String.Format("data:image/Bmp;base64,{0}\"", imgString);
            return true;
        }
        catch
        {
            return false;
        }
    }
    public bool convertStudentImage(byte[] imgBytes)
    {
        try
        {
            TypeConverter tc = TypeDescriptor.GetConverter(typeof(Bitmap));
            Bitmap MyBitmap = (Bitmap)tc.ConvertFrom(imgBytes);

            string imgString = Convert.ToBase64String(imgBytes);

            System.Drawing.Image convertToImage = System.Drawing.Image.FromStream(new MemoryStream(Convert.FromBase64String(imgString)));
            //Set the source with data:image/bmp
            StudentImage.Src = String.Format("data:image/Bmp;base64,{0}\"", imgString);
            return true;
        }
        catch
        {
            return false;
        }
    }
    public bool convertMotherImage(byte[] imgBytes)
    {
        try
        {

            TypeConverter tc = TypeDescriptor.GetConverter(typeof(Bitmap));
            Bitmap MyBitmap = (Bitmap)tc.ConvertFrom(imgBytes);

            string imgString = Convert.ToBase64String(imgBytes);

            System.Drawing.Image convertToImage = System.Drawing.Image.FromStream(new MemoryStream(Convert.FromBase64String(imgString)));
            //Set the source with data:image/bmp
            MotherImage.Src = String.Format("data:image/Bmp;base64,{0}\"", imgString);
            return true;
        }
        catch
        {
            return false;
        }
    }
    public bool convertGuardianImage(byte[] imgBytes)
    {
        try
        {

            TypeConverter tc = TypeDescriptor.GetConverter(typeof(Bitmap));
            Bitmap MyBitmap = (Bitmap)tc.ConvertFrom(imgBytes);

            string imgString = Convert.ToBase64String(imgBytes);

            System.Drawing.Image convertToImage = System.Drawing.Image.FromStream(new MemoryStream(Convert.FromBase64String(imgString)));
            //Set the source with data:image/bmp
            RelativeImage.Src = String.Format("data:image/Bmp;base64,{0}\"", imgString);
            return true;
        }
        catch
        {
            return false;
        }
    }
    protected void RegisterButton_Click(object sender, EventArgs e)
    {
        //StudentImage in Session
        //if (StudentPhotoDiv.Visible == true)
        //{
        //    Stream StudentImageUpload = StudentFileUpload.PostedFile.InputStream;
        //    BinaryReader StudentImageBR = new BinaryReader(StudentImageUpload);
        //    Byte[] StudentImageByte = StudentImageBR.ReadBytes((Int32)StudentImageUpload.Length);
        //    if (StudentImageByte.Length > 0)
        //        Session["StudentImageBytes"] = StudentImageByte;
        //    if (Session["StudentImageBytes"] != null)
        //        convertStudentImage((byte[])Session["StudentImageBytes"]);
        //}
        Result Result = new Result();
        //StudentImage in Session
        if (StudentPhotoDiv.Visible == true)
        {
            Stream StudentImageUpload = StudentPhotoFileUpload.PostedFile.InputStream;
            BinaryReader StudentImageBR = new BinaryReader(StudentImageUpload);
            Byte[] StudentImageByte = StudentImageBR.ReadBytes((Int32)StudentImageUpload.Length);
            if (StudentImageByte.Length > 0)
                Session["StudentImageBytes"] = StudentImageByte;
            if (Session["StudentImageBytes"] != null)
                convertStudentImage((byte[])Session["StudentImageBytes"]);
        }


        ////FatherImage in Session
        if (FatherPhotoDiv.Visible == true)
        {
            Stream FatherImageUpload = FatherPhotoFileUpload.PostedFile.InputStream;
            BinaryReader FatherImageBR = new BinaryReader(FatherImageUpload);
            Byte[] FatherImageByte = FatherImageBR.ReadBytes((Int32)FatherImageUpload.Length);
            if (FatherImageByte.Length > 0)
                Session["FatherImageBytes"] = FatherImageByte;
            if (Session["FatherImageBytes"] != null)
                convertFatherImage((byte[])Session["FatherImageBytes"]);
        }


        ////MotherImage in Session
        if (MotherPhotoDiv.Visible == true)
        {
            Stream MotherImageUpload = MotherPhotoFileUpload.PostedFile.InputStream;
            BinaryReader MotherImageBR = new BinaryReader(MotherImageUpload);
            Byte[] MotherImageByte = MotherImageBR.ReadBytes((Int32)MotherImageUpload.Length);
            if (MotherImageByte.Length > 0)
                Session["MotherImageBytes"] = MotherImageByte;
            if (Session["MotherImageBytes"] != null)
                convertMotherImage((byte[])Session["MotherImageBytes"]);
        }


        ////GuardianImage in Session
        if (RelativePhotoDiv.Visible == true)
        {
            Stream GuardianImageUpload = RelativePhotoFileUpload.PostedFile.InputStream;
            BinaryReader GuardianImageBR = new BinaryReader(GuardianImageUpload);
            Byte[] GuardianImageByte = GuardianImageBR.ReadBytes((Int32)GuardianImageUpload.Length);
            if (GuardianImageByte.Length > 0)
                Session["GuardianImageBytes"] = GuardianImageByte;
            if (Session["GuardianImageBytes"] != null)
                convertGuardianImage((byte[])Session["GuardianImageBytes"]);
        }

        if (Validateforsave())
        {
            List<OnlineStudent> OnlineRegisterStudentListData = new List<OnlineStudent>();
            OnlineStudent OnlineRegisterStudentData = new OnlineStudent();

            //OnlineRegistrationStudentMaster
            OnlineRegisterStudentData.Id = StudentId;
            if (Session["StudentStatusId"] == null)
                OnlineRegisterStudentData.StudentStatusId = 0;
            else
                OnlineRegisterStudentData.StudentStatusId = Convert.ToInt32(Session["StudentStatusId"].ToString());
            OnlineRegisterStudentData.Code = IdNoTextBox.Text.ToString();
            //OnlineRegisterStudentData.Number = Convert.ToInt64(IdNoTextBox.Text.ToString());
            OnlineRegisterStudentData.FirstName = FirstNameTextBox.Text.ToString();
            if (!string.IsNullOrEmpty(MiddleNameTextBox.Text))
                OnlineRegisterStudentData.MiddleName = MiddleNameTextBox.Text.ToString();
            else
                OnlineRegisterStudentData.MiddleName = String.Empty;
            OnlineRegisterStudentData.LastName = SurnameTextBox.Text.ToString();
            OnlineRegisterStudentData.OrgId = int.Parse(OrgDropDownList.SelectedValue);
            OnlineRegisterStudentData.StatusId = 1;
            //if (StatusDropDownList.SelectedIndex > 0)
            OnlineRegisterStudentData.RecordStatusId = 502;
            //else
            //    OnlineRegisterStudentData.RecordStatusId = 0;
            FeesCategoryDropDownList.SelectedIndex = 1;
            if (FeesCategoryDropDownList.SelectedIndex > 0)
                OnlineRegisterStudentData.AdmissionCategoryId = Convert.ToInt32(FeesCategoryDropDownList.SelectedValue);
            else
                OnlineRegisterStudentData.AdmissionCategoryId = 0;
            if (!string.IsNullOrEmpty(RegistrationNumberTextBox.Text))
                OnlineRegisterStudentData.RegistrationNumber = RegistrationNumberTextBox.Text.ToString();
            else
                OnlineRegisterStudentData.RegistrationNumber = String.Empty;
            OnlineRegisterStudentData.ClassId = Convert.ToInt32(ClassIdDropDownList.SelectedValue);
            OnlineRegisterStudentData.DivisionId = Convert.ToInt32(DivisionIdDropDownList.SelectedValue.ToString());
            if (!string.IsNullOrEmpty(RollNoTextBox.Text))
                OnlineRegisterStudentData.RollNo = Convert.ToInt32(RollNoTextBox.Text.ToString());
            else
                OnlineRegisterStudentData.RollNo = 0;
            OnlineRegisterStudentData.BatchId = int.Parse(BatchDropDownList.SelectedValue);

            //OnlineRegistrationStudentFamily
            if (FamilyDetailFatherNameTextBox.Text.ToString() != "")
                OnlineRegisterStudentData.FatherName = FamilyDetailFatherNameTextBox.Text.ToString();
            else
                OnlineRegisterStudentData.FatherName = String.Empty;
            if (MotherDateofBirthDiv.Visible)
            {
                if (!string.IsNullOrEmpty(FatherDateofBirthDatePickerControl.Text))
                    OnlineRegisterStudentData.FatherDateOfBirth = DateTime.Parse(FatherDateofBirthDatePickerControl.Text.ToString());

            }
            if (FatherOccupationDiv.Visible)
                OnlineRegisterStudentData.FatherOccupation = FatherOccupationTextBox.Text.ToString();
            if (FatherQualificationDiv.Visible)
                OnlineRegisterStudentData.FatherQualification = FatherQualificationTextBox.Text.ToString();
            if (FatherContactNoDiv.Visible)
                OnlineRegisterStudentData.FatherContactNo = FatherContactNoTextBox.Text.ToString();
            if (FatherMailDiv.Visible)
                OnlineRegisterStudentData.FatherMail = FatherMailTextBox.Text.ToString();
            if (FatherOfficeAddressDiv.Visible)
                OnlineRegisterStudentData.FatherOfficeAddress = FatherOfficeAddressTextBox.Text.ToString();
            if (FatherIncomeDiv.Visible && FatherIncomeTextBox.Text.ToString() != "")
                OnlineRegisterStudentData.FatherIncome = Convert.ToInt32(FatherIncomeTextBox.Text.ToString());
            if (MotherNameDiv.Visible)
                OnlineRegisterStudentData.MotherName = MotherNameTextBox.Text.ToString();
            else
                OnlineRegisterStudentData.MotherName = String.Empty;
            if (MotherDateofBirthDiv.Visible)
            {
                if (!string.IsNullOrEmpty(MotherDateofBirthDatePickerControl.Text))
                    OnlineRegisterStudentData.MotherDateOfBirth = DateTime.Parse(MotherDateofBirthDatePickerControl.Text.ToString());
            }
            if (MotherOccupationDiv.Visible)
                OnlineRegisterStudentData.MotherOccupation = MotherOccupationTextBox.Text.ToString();
            if (MotherQualificationDiv.Visible)
                OnlineRegisterStudentData.MotherQualification = MotherQualificationTextBox.Text.ToString();
            if (MotherContactNoDiv.Visible)
                OnlineRegisterStudentData.MotherContactNo = MotherContactNoTextBox.Text.ToString();
            if (MotherMailDiv.Visible)
                OnlineRegisterStudentData.MotherMail = MotherMailTextBox.Text.ToString();
            if (MotherOfficeAddressDiv.Visible)
                OnlineRegisterStudentData.MotherOfficeAddress = MotherOfficeAddressTextBox.Text.ToString();
            if (MotherIncomeDiv.Visible && MotherIncomeTextBox.Text.ToString() != "")
                OnlineRegisterStudentData.MotherIncome = Convert.ToInt32(MotherIncomeTextBox.Text.ToString());
            if (RelativeNameTextBox.Text.ToString() != "")
                OnlineRegisterStudentData.RelativeName = RelativeNameTextBox.Text.ToString();
            else
                OnlineRegisterStudentData.RelativeName = String.Empty;
            if (RelativeDateofBirthDiv.Visible)
            {
                if (!string.IsNullOrEmpty(RelativeDateofBirthDatePickerControl.Text))
                    OnlineRegisterStudentData.RelativeDateOfBirth = DateTime.Parse(RelativeDateofBirthDatePickerControl.Text.ToString());
            }
            if (RelativeOccupationDiv.Visible)
                OnlineRegisterStudentData.RelativeOccupation = RelativeOccupationTextBox.Text.ToString();
            if (RelativeQualificationDiv.Visible)
                OnlineRegisterStudentData.RelativeQualification = RelativeQualificationTextBox.Text.ToString();
            if (RelativeContactNoDiv.Visible)
                OnlineRegisterStudentData.RelativeContactNo = RelativeContactNoTextBox.Text.ToString();
            if (RelativeMailDiv.Visible)
                OnlineRegisterStudentData.RelativeMail = RelativeMailTextBox.Text.ToString();
            if (RelativeOfficeAddressDiv.Visible)
                OnlineRegisterStudentData.RelativeOfficeAddress = RelativeOfficeAddressTextBox.Text.ToString();
            if (RelativeIncomeDiv.Visible && RelativeIncomeTextBox.Text.ToString() != "")
                OnlineRegisterStudentData.RelativeIncome = Convert.ToInt32(RelativeIncomeTextBox.Text.ToString());
            if (StudentPhotoDiv.Visible)
            {
                Byte[] OriginalStudentPhotoBytes = (byte[])Session["StudentImageBytes"];
                OnlineRegisterStudentData.StudentPhoto = OriginalStudentPhotoBytes;
            }
            if (FatherPhotoDiv.Visible)
            {
                Byte[] OriginalStudentPhotoBytes = (byte[])Session["FatherImageBytes"];
                OnlineRegisterStudentData.FatherPhoto = OriginalStudentPhotoBytes;
            }
            if (MotherPhotoDiv.Visible)
            {
                Byte[] OriginalStudentPhotoBytes = (byte[])Session["MotherImageBytes"];
                OnlineRegisterStudentData.MotherPhoto = OriginalStudentPhotoBytes;
            }
            if (RelativePhotoDiv.Visible)
            {
                Byte[] OriginalStudentPhotoBytes = (byte[])Session["GuardianImageBytes"];
                OnlineRegisterStudentData.RelativePhoto = OriginalStudentPhotoBytes;
            }
            if (MarriageAnniversaryDateDiv.Visible)
            {
                if (!string.IsNullOrEmpty(MarriageAnniversaryDateDatePickerControl.Text))
                    OnlineRegisterStudentData.MarriageAnniversaryDate = DateTime.Parse(MarriageAnniversaryDateDatePickerControl.Text.ToString());
            }
            // FeesCategoryDropDownList.SelectedIndex = 1;
            if (LiveWithDiv.Visible && LiveWithDropDownList.SelectedIndex > 0)
                OnlineRegisterStudentData.LiveWithId = Convert.ToInt16(LiveWithDropDownList.SelectedValue);
            if (ISFatherExStudentDiv.Visible)
                OnlineRegisterStudentData.IsSingleChild = IsSingleChildCheckBox.Checked;
            if (ISFatherExStudentDiv.Visible)
                OnlineRegisterStudentData.IsFatherExStudent = ISFatherExStudentCheckBox.Checked;
            if (FatherPassOutYearDiv.Visible)
                OnlineRegisterStudentData.FatherPassOutYear = FatherPassOutYearTextBox.Text.ToString();
            if (ISMotherExStudentDiv.Visible)
                OnlineRegisterStudentData.IsMotherExStudent = ISMotherExStudentCheckBox.Checked;
            if (MotherPassOutYearDiv.Visible)
                OnlineRegisterStudentData.MotherPassOutYear = MotherPassOutYearTextBox.Text.ToString();
            if (ISRelativeExStudentDiv.Visible)
                OnlineRegisterStudentData.IsRelativeExStudent = ISRelativeExStudentCheckBox.Checked;
            if (RelativePassOutYearDiv.Visible)
                OnlineRegisterStudentData.RelativePassOutYear = RelativePassOutYearTextBox.Text.ToString();
            if (FatherOrganizationDiv.Visible)
                OnlineRegisterStudentData.FatherOrganization = FatherOrganizationTextBox.Text.ToString();
            if (FatherDesignationDiv.Visible)
                OnlineRegisterStudentData.FatherDesignation = FatherDesignationTextBox.Text.ToString();
            if (MotherOrganizationDiv.Visible)
                OnlineRegisterStudentData.MotherOrganization = MotherOrganizationTextBox.Text.ToString();
            if (MotherDesignationDiv.Visible)
                OnlineRegisterStudentData.MotherDesignation = MotherDesignationTextBox.Text.ToString();
            if (RelativeOrganizationDiv.Visible)
                OnlineRegisterStudentData.RelativeOrganization = RelativeOrganizationTextBox.Text.ToString();
            if (RelativeDesignationDiv.Visible)
                OnlineRegisterStudentData.RelativeDesignation = RelativeDesignationTextBox.Text.ToString();
            if (MotherAadharNoDiv.Visible)
                OnlineRegisterStudentData.MotherAdhaarNumber = MotherAadharNoTextBox.Text.ToString();
            if (MotherAadharNoDiv.Visible)
                OnlineRegisterStudentData.MotherAdhaarNumber = MotherAadharNoTextBox.Text.ToString();
            if (FatherOfficeAddressDiv.Visible)
                OnlineRegisterStudentData.FatherOfficeAddress = FatherOfficeAddressTextBox.Text.ToString();
            if (MotherOfficeAddressDiv.Visible)
                OnlineRegisterStudentData.MotherOfficeAddress = MotherOfficeAddressTextBox.Text.ToString();


            //OnlineRegistrationStudentOther
            if (UIDNumberDiv.Visible)
                OnlineRegisterStudentData.UIDNumber = UIDNumberTextBox.Text.ToString();

            if (DateofBirthDiv.Visible && !string.IsNullOrEmpty(DateofBirthDatePickerControl.Text))
            {
                OnlineRegisterStudentData.DateOfBirth = DateTime.Parse(DateofBirthDatePickerControl.Text.ToString());
                OnlineRegisterStudentData.BirthDateInWord = ApplicationHelper.GetDateInWord(Convert.ToDateTime(DateofBirthDatePickerControl.Text));
            }
            if (TransportDiv.Visible && TransportDropDownList.SelectedIndex > 0)
                OnlineRegisterStudentData.TransportModeId = Convert.ToInt32(TransportDropDownList.SelectedValue);
            if (GenderType.ToUpper().Trim() == "MALE" && GenderTextBox.Visible)
            {
                OnlineRegisterStudentData.GenderId = 2;
            }
            else if (GenderType.ToUpper().Trim() == "FEMALE" && GenderTextBox.Visible)
            {
                OnlineRegisterStudentData.GenderId = 1;
            }
            else
            {
                if (GenderDiv.Visible && GenderDropDownList.SelectedIndex > 0)
                    OnlineRegisterStudentData.GenderId = Convert.ToInt32(GenderDropDownList.SelectedValue);
            }
            if (BloodGroupDiv.Visible && BloodGroupDropDownList.SelectedIndex > 0)
                OnlineRegisterStudentData.BloodGroupId = Convert.ToInt16(BloodGroupDropDownList.SelectedValue);
            if (BirthPlaceDiv.Visible)
                OnlineRegisterStudentData.BirthPlace = BirthPlaceTextBox.Text.ToString();
            if (BirthTalukaDiv.Visible)
                OnlineRegisterStudentData.BirthTaluka = BirthTalukaTextBox.Text.ToString();
            if (BirthDistrictDiv.Visible)
                OnlineRegisterStudentData.BirthDistrict = BirthDistrictTextBox.Text.ToString();
            if (FamilyCasteDiv.Visible)
                OnlineRegisterStudentData.FamilyCast = FamilyCasteTextBox.Text.ToString();
            if (FamilySubCasteDiv.Visible)
                OnlineRegisterStudentData.FamilySubCast = FamilySubCasteTextBox.Text.ToString();
            if (CasteCategoryDiv.Visible && CasteCategoryDropDownList.SelectedIndex > 0)
                OnlineRegisterStudentData.CastCategoryId = Convert.ToInt32(CasteCategoryDropDownList.SelectedValue);
            if (ReligionDiv.Visible && ReligionDropDownList.SelectedIndex > 0)
                OnlineRegisterStudentData.ReligionId = Convert.ToInt32(ReligionDropDownList.SelectedValue);
            if (HouseDiv.Visible && HouseDropDownList.SelectedIndex > 0)
                OnlineRegisterStudentData.HouseId = Convert.ToInt32(HouseDropDownList.SelectedValue);
            if (MotherTongueDiv.Visible && MotherTongueDropDownList.SelectedIndex > 0)
            {
                OnlineRegisterStudentData.MotherTongueId = Convert.ToInt32(MotherTongueDropDownList.SelectedValue);
                OnlineRegisterStudentData.MotherTongue = MotherTongueDropDownList.SelectedItem.Text;
            }
            if (NationalityDiv.Visible && NationalityDropDownList.SelectedIndex > 0)
                OnlineRegisterStudentData.NationalityId = Convert.ToInt32(NationalityDropDownList.SelectedValue);
            if (HobbyDiv.Visible)
                OnlineRegisterStudentData.Hobby = HobbyTextBox.Text.ToString();
            if (ReferenceRemarkDiv.Visible)
                OnlineRegisterStudentData.ReferenceRemark = ReferenceRemarkTextBox.Text.ToString();
            if (AadhaarNumberDiv.Visible)
                OnlineRegisterStudentData.AdhaarNumber = AadhaarNumberTextBox.Text.ToString();
            if (QuotaDiv.Visible && QuotaDropDownList.SelectedIndex > 0)
                OnlineRegisterStudentData.QuotaId = Convert.ToInt32(QuotaDropDownList.SelectedValue);
            if (BirthStateDiv.Visible)
                OnlineRegisterStudentData.BirthState = BirthStateTextBox.Text.ToString();
            if (BirthCountryDiv.Visible)
                OnlineRegisterStudentData.BirthCountry = BirthCountryTextBox.Text.ToString();
            if (BankAccountNumberDiv.Visible)
                OnlineRegisterStudentData.BankAccountNumber = BankAccountNumberTextBox.Text.ToString();
            if (BankNameDiv.Visible)
                OnlineRegisterStudentData.BankName = BankNameTextBox.Text.ToString();
            if (BankBranchDiv.Visible)
                OnlineRegisterStudentData.BankBranch = BankBranchTextBox.Text.ToString();
            if (BankIFSCCodeDiv.Visible)
                OnlineRegisterStudentData.BankIFSCCode = BankIFSCCodeTextBox.Text.ToString();
            if (Class9BoardRegistrationNumberDiv.Visible)
                OnlineRegisterStudentData.Class9BoardRegistrationNumber = Class9BoardRegistrationNumberTextBox.Text.ToString();
            if (Class11BoardRegistrationNumberDiv.Visible)
                OnlineRegisterStudentData.Class11BoardRegistrationNumber = Class11BoardRegistrationNumberTextBox.Text.ToString();
            if (PassportNumberDiv.Visible)
                OnlineRegisterStudentData.PassportNumber = PassportNumberTextBox.Text.ToString();
            if (PassportTypeDiv.Visible)
                OnlineRegisterStudentData.PassportType = PassportTypeTextBox.Text.ToString();
            if (PassportCountryCodeDiv.Visible)
                OnlineRegisterStudentData.PassportCountryCode = PassportCountryCodeTextBox.Text.ToString();
            if (PassportIssueDateDiv.Visible && !string.IsNullOrEmpty(PassportIssueDateDatePickerControl.Text))
            {
                OnlineRegisterStudentData.PassportIssueDate = DateTime.Parse(PassportIssueDateDatePickerControl.Text.ToString());
                //OnlineRegisterStudentData.BirthDateInWord = ApplicationHelper.GetDateInWord(Convert.ToDateTime(DateofBirthDatePickerControl.Text));
            }
            if (PassportExpiryDateDiv.Visible && !string.IsNullOrEmpty(PassportExpiryDateDatePickerControl.Text))
            {
                OnlineRegisterStudentData.PassportExpiryDate = DateTime.Parse(PassportExpiryDateDatePickerControl.Text.ToString());
                //OnlineRegisterStudentData.BirthDateInWord = ApplicationHelper.GetDateInWord(Convert.ToDateTime(DateofBirthDatePickerControl.Text));
            }
            if (BankAccountHolderNameDiv.Visible)
                OnlineRegisterStudentData.BankAccountHolderName = BankAccountHolderNameTextBox.Text.ToString();


            //OnlineRegistrationStudentCommunication
            if (LocalAddressAddress1Div.Visible)
                OnlineRegisterStudentData.PresentStreetOne = LocalAddressAddress1TextBox.Text.ToString();
            if (LocalAddressAddress2Div.Visible)
                OnlineRegisterStudentData.PresentStreetTwo = LocalAddressAddress2TextBox.Text.ToString();
            if (LocalAddressAddress3Div.Visible)
                OnlineRegisterStudentData.PresentStreetThree = LocalAddressAddress3TextBox.Text.ToString();
            if (LocalAddressCountryDiv.Visible)
                OnlineRegisterStudentData.PresentCountry = LocalAddressCountryTextBox.Text.ToString();
            if (LocalAddressStateDiv.Visible)
                OnlineRegisterStudentData.PresentState = LocalAddressStateTextBox.Text.ToString();
            if (LocalAddressCityDiv.Visible)
                OnlineRegisterStudentData.PresentCity = LocalAddressCityTextBox.Text.ToString();
            if (LocalAddressPINCodeDiv.Visible)
                OnlineRegisterStudentData.PresentZipCode = LocalAddressPINCodeTextBox.Text.ToString();
            if (LocalAddressContactNoDiv.Visible)
                OnlineRegisterStudentData.PresentContactNo = LocalAddressContactNoTextBox.Text.ToString();
            if (PermanentAddressAddress1Div.Visible)
                OnlineRegisterStudentData.PermanentStreetOne = PermanentAddressAddress1TextBox.Text.ToString();
            if (PermanentAddressAddress2Div.Visible)
                OnlineRegisterStudentData.PermanentStreetTwo = PermanentAddressAddress2TextBox.Text.ToString();
            if (PermanentAddressAddress3Div.Visible)
                OnlineRegisterStudentData.PermanentStreetThree = PermanentAddressAddress3TextBox.Text.ToString();
            if (PermanentAddressCountryDiv.Visible)
                OnlineRegisterStudentData.PermanentCountry = PermanentAddressCountryTextBox.Text.ToString();
            if (PermanentAddressStateDiv.Visible)
                OnlineRegisterStudentData.PermanentState = PermanentAddressStateTextBox.Text.ToString();
            if (PermanentAddressCityDiv.Visible)
                OnlineRegisterStudentData.PermanentCity = PermanentAddressCityTextBox.Text.ToString();
            if (PermanentAddressPINCodeDiv.Visible)
                OnlineRegisterStudentData.PermanentZipCode = PermanentAddressPINCodeTextBox.Text.ToString();
            if (PermanentAddressContactNoDiv.Visible)
                OnlineRegisterStudentData.PermanentContactNo = PermanentAddressContactNoTextBox.Text.ToString();
            if (EmergencyAddressAddress1Div.Visible)
                OnlineRegisterStudentData.EmergencyStreetOne = EmergencyAddressAddress1TextBox.Text.ToString();
            if (EmergencyAddressAddress2Div.Visible)
                OnlineRegisterStudentData.EmergencyStreetTwo = EmergencyAddressAddress2TextBox.Text.ToString();
            if (EmergencyAddressAddress3Div.Visible)
                OnlineRegisterStudentData.EmergencyStreetThree = EmergencyAddressAddress3TextBox.Text.ToString();
            if (EmergencyAddressCountryDiv.Visible)
                OnlineRegisterStudentData.EmergencyCountry = EmergencyAddressCountryTextBox.Text.ToString();
            if (EmergencyAddressStateDiv.Visible)
                OnlineRegisterStudentData.EmergencyState = EmergencyAddressStateTextBox.Text.ToString();
            if (EmergencyAddressCityDiv.Visible)
                OnlineRegisterStudentData.EmergencyCity = EmergencyAddressCityTextBox.Text.ToString();
            if (EmergencyAddressPINCodeDiv.Visible)
                OnlineRegisterStudentData.EmergencyZipCode = EmergencyAddressPINCodeTextBox.Text.ToString();
            if (EmergencyAddressContactNoDiv.Visible)
                OnlineRegisterStudentData.EmergencyContactNo = EmergencyAddressContactNoTextBox.Text.ToString();

            if (ParentEmailDiv.Visible)
                OnlineRegisterStudentData.ParentEmail = ParentEmailTextBox.Text.ToString();
            if (StudentContactNoDiv.Visible)
                OnlineRegisterStudentData.StudentContactNo = StudentContactNoTextBox.Text.ToString();
            if (StudentEmailDiv.Visible)
                OnlineRegisterStudentData.StudentEmail = StudentEmailTextBox.Text.ToString();
            if (DistanceFromSchoolDiv.Visible && !string.IsNullOrEmpty(DistanceFromSchoolTextBox.Text))
                OnlineRegisterStudentData.PresentDistanceFromSchool = decimal.Parse(DistanceFromSchoolTextBox.Text.ToString());
            if (StudentCustomAlertDiv.Visible)
                OnlineRegisterStudentData.StudentCustomAlert = StudentCustomAlertTextBox.Text.ToString();
            if (WhatsAppContactNoDiv.Visible)
                OnlineRegisterStudentData.WhatsAppContactNo = WhatsAppContactNoTextBox.Text.ToString();



            //OnlineRegistrationStudentCommunication
            if (PreviousSchoolDiv.Visible)
                OnlineRegisterStudentData.PreviousSchool = PreviousSchoolTextBox.Text.ToString();
            if (PreviousSchoolTypeDiv.Visible && PreviousSchoolTypeDropDownList.SelectedIndex > 0)
                OnlineRegisterStudentData.PreviousSchoolTypeId = Convert.ToInt32(PreviousSchoolTypeDropDownList.SelectedValue.ToString());
            else
                OnlineRegisterStudentData.PreviousSchoolTypeId = 0;
            if (PreviousStudentIdDiv.Visible)
                OnlineRegisterStudentData.PreviousStudentId = Convert.ToInt64(PreviousStudentIdTextBox.Text.ToString());
            if (AdmissionFormNumberDiv.Visible)
            {
                //OnlineRegisterStudentData.AdmissionFormId = Convert.ToInt64(AdmissionFormNumberTextBox.Text.ToString());
                OnlineRegisterStudentData.AdmissionFormNumber = AdmissionFormNumberTextBox.Text.ToString();
            }
            if (AdmissionStandardDiv.Visible && AdmissionStandardDropDownList.SelectedIndex > 0)
                OnlineRegisterStudentData.PreviousSchoolTypeId = Convert.ToInt32(AdmissionStandardDropDownList.SelectedValue.ToString());
            else
                OnlineRegisterStudentData.AdmissionStandardId = 0;
            if (AdmissionDateDiv.Visible && !string.IsNullOrEmpty(AdmissionDateDatePickerControl.Text))
            {
                OnlineRegisterStudentData.AdmissionDate = DateTime.Parse(AdmissionDateDatePickerControl.Text.ToString());

                //OnlineRegisterStudentData.BirthDateInWord = ApplicationHelper.GetDateInWord(Convert.ToDateTime(DateofBirthDatePickerControl.Text));
            }
            if (AdmissionYearDiv.Visible)
                OnlineRegisterStudentData.AdmissionYear = AdmissionYearTextBox.Text.ToString();
            if (LeftStandardDiv.Visible && LeftStandardIdDropDownList.SelectedIndex > 0)
                OnlineRegisterStudentData.LeftStandardId = Convert.ToInt32(LeftStandardIdDropDownList.SelectedValue.ToString());
            else
                OnlineRegisterStudentData.LeftStandardId = 0;
            if (LeftDatedDiv.Visible && !string.IsNullOrEmpty(LeftDateDatePickerControl.Text))
            {
                OnlineRegisterStudentData.LeftDate = DateTime.Parse(LeftDateDatePickerControl.Text.ToString());
                OnlineRegisterStudentData.LeftYear = DateTime.Parse(LeftDateDatePickerControl.Text.ToString()).ToString("yyyy");
                //OnlineRegisterStudentData.BirthDateInWord = ApplicationHelper.GetDateInWord(Convert.ToDateTime(DateofBirthDatePickerControl.Text));
            }
            if (LeftYearDiv.Visible)
                OnlineRegisterStudentData.LeftYear = LeftYearTextBox.Text.ToString();
            if (InActiveDateDiv.Visible && !string.IsNullOrEmpty(InActiveDateDatePickerControl.Text))
            {
                OnlineRegisterStudentData.InactiveDate = DateTime.Parse(InActiveDateDatePickerControl.Text.ToString());
                //OnlineRegisterStudentData.LeftYear = DateTime.Parse(LeftDateDatePickerControl.Text.ToString()).ToString("yyyy");
                //OnlineRegisterStudentData.BirthDateInWord = ApplicationHelper.GetDateInWord(Convert.ToDateTime(DateofBirthDatePickerControl.Text));
            }
            if (LeftReasonDiv.Visible)
                OnlineRegisterStudentData.LeftReason = LeftReasonTextBox.Text.ToString();
            if (InActiveReasonDiv.Visible)
                OnlineRegisterStudentData.InActiveReason = InActiveReasonTextBox.Text.ToString();

            if (LCProgressDiv.Visible)
                OnlineRegisterStudentData.LCProgress = LCProgressTextBox.Text.ToString();
            if (LCConductDiv.Visible)
                OnlineRegisterStudentData.LCConduct = LCConductTextBox.Text.ToString();
            if (LCBookDiv.Visible)
                OnlineRegisterStudentData.LCBook = LCBookTextBox.Text.ToString();
            if (LCNumberDiv.Visible)
                OnlineRegisterStudentData.LCNumber = LCNumberTextBox.Text.ToString();
            if (LCDateDiv.Visible && !string.IsNullOrEmpty(LCDateDatePickerControl.Text))
            {
                OnlineRegisterStudentData.LCDate = DateTime.Parse(LCDateDatePickerControl.Text.ToString());
                //OnlineRegisterStudentData.LeftYear = DateTime.Parse(LeftDateDatePickerControl.Text.ToString()).ToString("yyyy");
                //OnlineRegisterStudentData.BirthDateInWord = ApplicationHelper.GetDateInWord(Convert.ToDateTime(DateofBirthDatePickerControl.Text));
            }
            if (LCRemarkDiv.Visible)
                OnlineRegisterStudentData.LCRemark = LCRemarkTextBox.Text.ToString();

            if (LCCopyDiv.Visible && !string.IsNullOrEmpty(LCCopyText.Text))
                OnlineRegisterStudentData.LCCopy = Convert.ToInt16(LCCopyText.Text);
            else
                OnlineRegisterStudentData.LCCopy = 0;
            if (LcIdDiv.Visible && !string.IsNullOrEmpty(LcIdTextBox.Text))
                OnlineRegisterStudentData.LcId = Convert.ToInt64(LcIdTextBox.Text.ToString());
            if (ExamSeatNoDiv.Visible)
                OnlineRegisterStudentData.ExamSeatNo = ExamSeatNoTextBox.Text.ToString();
            if (AdmissionNumberDiv.Visible)
                OnlineRegisterStudentData.AdmissionNumber = AdmissionNumberTextBox.Text.ToString();

            if (IsTransferDiv.Visible)
                OnlineRegisterStudentData.IsTransfer = IsTransferCheckBox.Checked;
            if (TransferFromDiv.Visible && IsTransferCheckBox.Checked)
                OnlineRegisterStudentData.TransferFrom = TransferFromTextBox.Text.ToString();
            if (PassingYearDiv.Visible)
                OnlineRegisterStudentData.PassingYear = PassingYearTextBox.Text.ToString();
            if (IsTFWSDiv.Visible)
                OnlineRegisterStudentData.IsTFWS = IsTFWSCheckBox.Checked;
            if (IsCertificateHolderDiv.Visible)
                OnlineRegisterStudentData.IsCertificateHolder = IsCertificateHolderCheckBox.Checked;
            if (CertificateNameDiv.Visible && IsCertificateHolderCheckBox.Checked)
                OnlineRegisterStudentData.CertificateName = CertificateNameTextBox.Text.ToString();
            if (AdmissionQuotaDiv.Visible && AdmissionQuotaDropDownList.SelectedIndex > 0)
                OnlineRegisterStudentData.AdmissionQuotaId = Convert.ToInt32(AdmissionQuotaDropDownList.SelectedValue.ToString());
            else
                OnlineRegisterStudentData.AdmissionQuotaId = 0;
            if (PreviousStandardDiv.Visible)
                OnlineRegisterStudentData.PreviousStandard = PreviousStandardTextBox.Text.ToString();
            if (PreviousLCNumberDiv.Visible)
                OnlineRegisterStudentData.PreviousLCNumber = PreviousLCNumberTextBox.Text.ToString();
            if (PreviousLCDateDiv.Visible && !string.IsNullOrEmpty(PreviousLCDateDatePickerControl.Text))
            {
                OnlineRegisterStudentData.PreviousLCDate = DateTime.Parse(PreviousLCDateDatePickerControl.Text.ToString());
                //OnlineRegisterStudentData.LeftYear = DateTime.Parse(LeftDateDatePickerControl.Text.ToString()).ToString("yyyy");
                //OnlineRegisterStudentData.BirthDateInWord = ApplicationHelper.GetDateInWord(Convert.ToDateTime(DateofBirthDatePickerControl.Text));
            }
            if (PreviousResultDiv.Visible)
                OnlineRegisterStudentData.PreviousLCResult = PreviousResultTextBox.Text.ToString();
            if (ProofOfDOBDiv.Visible)
                OnlineRegisterStudentData.ProofOfDOB = ProofOfDOBTextBox.Text.ToString();

            //OnlineRegistrationStudentCollegeDetails
            if (SSCBoardDiv.Visible)
                OnlineRegisterStudentData.SSCBoard = SSCBoardTextBox.Text.ToString();
            if (SSCSchoolDiv.Visible)
                OnlineRegisterStudentData.SSCSchool = SSCSchoolTextBox.Text.ToString();
            if (SSCPassingYearDiv.Visible)
                OnlineRegisterStudentData.SSCPassingYear = SSCPassingYearTextBox.Text.ToString();
            if (SSCObtainMarksDiv.Visible && !string.IsNullOrEmpty(SSCObtainMarksTextBox.Text))
                OnlineRegisterStudentData.SSCObtainMarks = Convert.ToDecimal(SSCObtainMarksTextBox.Text.ToString());
            if (SSCOutOfMarksDiv.Visible && !string.IsNullOrEmpty(SSCOutOfMarksTextBox.Text))
                OnlineRegisterStudentData.SSCOutOfMarks = Convert.ToDecimal(SSCOutOfMarksTextBox.Text.ToString());
            if (SSCPercentageDiv.Visible && !string.IsNullOrEmpty(SSCPercentageTextBox.Text))
                OnlineRegisterStudentData.SSCPercentage = Convert.ToDecimal(SSCPercentageTextBox.Text.ToString());
            if (SSCMathMarksDiv.Visible && !string.IsNullOrEmpty(SSCMathMarksTextBox.Text))
                OnlineRegisterStudentData.SSCMathMarks = Convert.ToDecimal(SSCMathMarksTextBox.Text.ToString());
            if (SSCMathOutOfMarksDiv.Visible && !string.IsNullOrEmpty(SSCMathOutOfMarksTextBox.Text))
                OnlineRegisterStudentData.SSCMathOutOfMarks = Convert.ToDecimal(SSCMathOutOfMarksTextBox.Text.ToString());
            if (HSCBoardDiv.Visible)
                OnlineRegisterStudentData.HSCBoard = HSCBoardTextBox.Text.ToString();
            if (HSCSchoolDiv.Visible)
                OnlineRegisterStudentData.HSCSchool = HSCSchoolTextBox.Text.ToString();
            if (HSCPassingYearDiv.Visible)
                OnlineRegisterStudentData.HSCPassingYear = HSCPassingYearTextBox.Text.ToString();
            if (HSCObtainMarksDiv.Visible && !string.IsNullOrEmpty(HSCObtainMarksTextBox.Text))
                OnlineRegisterStudentData.HSCObtainMarks = Convert.ToDecimal(HSCObtainMarksTextBox.Text.ToString());
            if (HSCOutOfMarksDiv.Visible && !string.IsNullOrEmpty(HSCOutOfMarksTextBox.Text))
                OnlineRegisterStudentData.HSCOutOfMarks = Convert.ToDecimal(HSCOutOfMarksTextBox.Text.ToString());
            if (HSCPercentageDiv.Visible && !string.IsNullOrEmpty(HSCPercentageTextBox.Text))
                OnlineRegisterStudentData.HSCPercentage = Convert.ToDecimal(HSCPercentageTextBox.Text.ToString());
            if (HSCPhysicsMarksDiv.Visible && !string.IsNullOrEmpty(HSCPhysicsMarksTextBox.Text))
                OnlineRegisterStudentData.HSCPhysicsMarks = Convert.ToDecimal(HSCPhysicsMarksTextBox.Text.ToString());
            if (HSCPhysicsOutOfMarksDiv.Visible && !string.IsNullOrEmpty(HSCPhysicsOutOfMarksTextBox.Text))
                OnlineRegisterStudentData.HSCPhysicsOutOfMarks = Convert.ToDecimal(HSCPhysicsOutOfMarksTextBox.Text.ToString());
            if (HSCChemistryMarksDiv.Visible && !string.IsNullOrEmpty(HSCChemistryMarksTextBox.Text))
                OnlineRegisterStudentData.HSCChemistryMarks = Convert.ToDecimal(HSCChemistryMarksTextBox.Text.ToString());
            if (HSCChemistryOutOfMarksDiv.Visible && !string.IsNullOrEmpty(HSCChemistryOutOfMarksTextBox.Text))
                OnlineRegisterStudentData.HSCChemistryOutOfMarks = Convert.ToDecimal(HSCChemistryOutOfMarksTextBox.Text.ToString());
            if (HSCMathMarksDiv.Visible && !string.IsNullOrEmpty(HSCMathMarksTextBox.Text))
                OnlineRegisterStudentData.HSCMathMarks = Convert.ToDecimal(HSCMathMarksTextBox.Text.ToString());
            if (HSCMathOutOfMarksDiv.Visible && !string.IsNullOrEmpty(HSCMathOutOfMarksTextBox.Text))
                OnlineRegisterStudentData.HSCMathOutOfMarks = Convert.ToDecimal(HSCMathOutOfMarksTextBox.Text.ToString());
            if (HSCBiologyMarksDiv.Visible && !string.IsNullOrEmpty(HSCBiologyMarksTextBox.Text))
                OnlineRegisterStudentData.HSCBiologyMarks = Convert.ToDecimal(HSCBiologyMarksTextBox.Text.ToString());
            if (HSCBiologyOutOfMarksDiv.Visible && !string.IsNullOrEmpty(HSCBiologyOutOfMarksTextBox.Text))
                OnlineRegisterStudentData.HSCBiologyOutOfMarks = Convert.ToDecimal(HSCBiologyOutOfMarksTextBox.Text.ToString());
            if (PCMMarksDiv.Visible && !string.IsNullOrEmpty(PCMMarksTextBox.Text))
                OnlineRegisterStudentData.PCMMarks = Convert.ToDecimal(PCMMarksTextBox.Text.ToString());
            if (PCBMarksDiv.Visible && !string.IsNullOrEmpty(PCBMarksTextBox.Text))
                OnlineRegisterStudentData.PCBMarks = Convert.ToDecimal(PCBMarksTextBox.Text.ToString());
            if (JEERollNoDiv.Visible)
                OnlineRegisterStudentData.JEERollNo = JEERollNoTextBox.Text.ToString();
            if (JEEMeritNoDiv.Visible)
                OnlineRegisterStudentData.JEEMeritNo = JEEMeritNoTextBox.Text.ToString();
            if (JEEMeritMarksDiv.Visible && !string.IsNullOrEmpty(JEEMeritMarksTextBox.Text))
                OnlineRegisterStudentData.JEEMeritMarks = Convert.ToDecimal(JEEMeritMarksTextBox.Text.ToString());
            if (JEEOutOfMarksDiv.Visible && !string.IsNullOrEmpty(JEEOutOfMarksTextBox.Text))
                OnlineRegisterStudentData.JEEOutOfMarks = Convert.ToDecimal(JEEOutOfMarksTextBox.Text.ToString());
            if (DiplomaBoardDiv.Visible && !string.IsNullOrEmpty(DiplomaBoardTextBox.Text))
                OnlineRegisterStudentData.DiplomaBoard = DiplomaBoardTextBox.Text.ToString();
            if (DiplomaCollegeDiv.Visible)
                OnlineRegisterStudentData.DiplomaCollege = DiplomaCollegeTextBox.Text.ToString();
            if (DiplomaPassingYearDiv.Visible)
                OnlineRegisterStudentData.DiplomaPassingYear = DiplomaPassingYearTextBox.Text.ToString();
            if (DiplomaObtainMarksDiv.Visible && !string.IsNullOrEmpty(DiplomaObtainMarksTextBox.Text))
                OnlineRegisterStudentData.DiplomaObtainMarks = Convert.ToDecimal(DiplomaObtainMarksTextBox.Text.ToString());
            if (DiplomaOutOfMarksDiv.Visible && !string.IsNullOrEmpty(DiplomaOutOfMarksTextBox.Text))
                OnlineRegisterStudentData.DiplomaOutOfMarks = Convert.ToDecimal(DiplomaOutOfMarksTextBox.Text.ToString());
            if (DiplomaPercentageDiv.Visible && !string.IsNullOrEmpty(DiplomaPercentageTextBox.Text))
                OnlineRegisterStudentData.DiplomaPercentage = Convert.ToDecimal(DiplomaPercentageTextBox.Text.ToString());
            if (ApplicationIdDiv.Visible)
                OnlineRegisterStudentData.ApplicationNo = ApplicationIdTextBox.Text.ToString();
            if (AdmissionRoundDiv.Visible)
                OnlineRegisterStudentData.AdmissionRound = AdmissionRoundTextBox.Text.ToString();
            if (MaritalStatusDiv.Visible && AdmissionQuotaDropDownList.SelectedIndex > 0)
                OnlineRegisterStudentData.MaritalStatusId = Convert.ToInt32(MaritalStatusDropDownList.SelectedValue.ToString());
            else
                OnlineRegisterStudentData.MaritalStatusId = 0;
            if (SSCPercentileDiv.Visible && !string.IsNullOrEmpty(SSCPercentileTextBox.Text))
                OnlineRegisterStudentData.SSCPercentile = Convert.ToDecimal(SSCPercentileTextBox.Text.ToString());
            if (SSCGradeDiv.Visible)
                OnlineRegisterStudentData.SSCGrade = SSCGradeTextBox.Text.ToString();

            //--Added by dhananjay for mantis start - 33982

            //OnlineRegistrationStudentHealthDetails 
            if (ISPhysicalDeformityDiv.Visible)
            {
                if (ISPhysicalDeformityChkbox.Checked)
                {
                    OnlineRegisterStudentData.IsPysicalDeformity = ISPhysicalDeformityChkbox.Checked;
                    if (PhysicalDropDownList.SelectedIndex > 0)
                        OnlineRegisterStudentData.PhysicalDisabilityCategoryId = Convert.ToInt32(PhysicalDropDownList.SelectedValue);
                    else
                        OnlineRegisterStudentData.PhysicalDisabilityCategoryId = 0;
                    if (!string.IsNullOrEmpty(PhysicalDisabilityTextBox.Text))
                        OnlineRegisterStudentData.PysicalDeformityRemark = PhysicalDisabilityTextBox.Text;
                    else
                        OnlineRegisterStudentData.PysicalDeformityRemark = string.Empty;
                }
            }
            else
            {
                OnlineRegisterStudentData.IsPysicalDeformity = false;
                OnlineRegisterStudentData.PhysicalDisabilityCategoryId = 0;
                OnlineRegisterStudentData.PysicalDeformityRemark = string.Empty;
            }

            if (MajorIllnesschkDiv.Visible)
            {
                if (MajorIllnessCheckBox.Checked)
                {
                    OnlineRegisterStudentData.IsMajorIllness = MajorIllnessCheckBox.Checked;
                    if (!string.IsNullOrEmpty(MajorIllnessTextBox.Text))
                        OnlineRegisterStudentData.MajorIllnessRemark = MajorIllnessTextBox.Text;
                    else
                        OnlineRegisterStudentData.MajorIllnessRemark = string.Empty;
                }
            }
            else
            {
                OnlineRegisterStudentData.IsMajorIllness = false;
                OnlineRegisterStudentData.MajorIllnessRemark = string.Empty;

            }
            if (PastHistorychkDiv.Visible)
            {
                if (PastHistoryCheckBox.Checked)
                {
                    OnlineRegisterStudentData.IsPastHistory = PastHistoryCheckBox.Checked;
                    if (!string.IsNullOrEmpty(PastHistoryTextBox.Text))
                        OnlineRegisterStudentData.PastHistoryRemark = PastHistoryTextBox.Text;
                    else
                        OnlineRegisterStudentData.PastHistoryRemark = string.Empty;
                }
            }
            else
            {
                OnlineRegisterStudentData.IsPastHistory = false;
                OnlineRegisterStudentData.PastHistoryRemark = string.Empty;

            }

            if (AllergychkDiv.Visible)
            {
                if (AllergyCheckBox.Checked)
                {
                    OnlineRegisterStudentData.IsAllergy = AllergyCheckBox.Checked;
                    if (!string.IsNullOrEmpty(AllergyTextBox.Text))
                        OnlineRegisterStudentData.AllergyRemark = AllergyTextBox.Text;
                    else
                        OnlineRegisterStudentData.AllergyRemark = string.Empty;
                }
            }
            else
            {
                OnlineRegisterStudentData.IsAllergy = false;
                OnlineRegisterStudentData.AllergyRemark = string.Empty;

            }

            if (IdentificationMark1Div.Visible && !string.IsNullOrEmpty(IdentificationMark1TextBox.Text))
                OnlineRegisterStudentData.IdentificationMark1 = IdentificationMark1TextBox.Text.ToString();
            else
                OnlineRegisterStudentData.IdentificationMark1 = string.Empty;

            if (IdentificationMark2Div.Visible && !string.IsNullOrEmpty(IdentificationMark2TextBox.Text))
                OnlineRegisterStudentData.IdentificationMark2 = IdentificationMark2TextBox.Text.ToString();
            else
                OnlineRegisterStudentData.IdentificationMark2 = string.Empty;

            if (FamilyDoctorNameDiv.Visible && !string.IsNullOrEmpty(FamilyDoctorNameTextBox.Text))
                OnlineRegisterStudentData.FamilyDoctorName = FamilyDoctorNameTextBox.Text.ToString();
            else
                OnlineRegisterStudentData.FamilyDoctorName = string.Empty;

            if (FamilyDoctorContactNoDiv.Visible && !string.IsNullOrEmpty(FamilyDoctorContactNoTextBox.Text))
                OnlineRegisterStudentData.FamilyDoctorContactNo = FamilyDoctorContactNoTextBox.Text.ToString();
            else
                OnlineRegisterStudentData.FamilyDoctorContactNo = string.Empty;

            //--Added by dhananjay for mantis End - 33982

            OnlineRegisterStudentListData.Add(OnlineRegisterStudentData);

            Result = StudentServiceClient.CreateUpdateOnlineStudent(OnlineRegisterStudentListData);

            if (Result.Code == 1)
            {

                StringBuilder StrXmlDocAdmissionFormField = new StringBuilder();
                string AdmissionFormFieldXml = null;
                StrXmlDocAdmissionFormField.Append("<Table>" + "\r\n");

                foreach (GridViewRow dr in OnlineRegistrationCriteriaFormGridView.Rows)
                {
                    int Id = int.Parse(OnlineRegistrationCriteriaFormGridView.DataKeys[dr.RowIndex].Values[0].ToString());
                    int FieldTypeId = int.Parse(OnlineRegistrationCriteriaFormGridView.DataKeys[dr.RowIndex].Values[1].ToString());
                    bool IsFieldMandatory = bool.Parse(OnlineRegistrationCriteriaFormGridView.DataKeys[dr.RowIndex].Values[3].ToString());
                    DropDownList FieldTypeDropDownList = (DropDownList)(dr.FindControl("FieldTypeDropDownList"));
                    TextBox FieldTypeTextBox = (TextBox)(dr.FindControl("FieldTypeTextBox"));

                    string RootNode = "OnlineRegistrationCriteriaField";
                    StrXmlDocAdmissionFormField.Append("<" + RootNode + " ");
                    StrXmlDocAdmissionFormField.Append("OnlineRegistrationCriteriaFormId" + " = '" + Id + "' ");
                    if (FieldTypeId == 1 || FieldTypeId == 2)
                        StrXmlDocAdmissionFormField.Append("OnlineRegistrationFormFieldResponse" + " = '" + FieldTypeDropDownList.SelectedItem.Text + "' ");
                    else
                        StrXmlDocAdmissionFormField.Append("OnlineRegistrationFormFieldResponse" + " = '" + FieldTypeTextBox.Text.Replace("'", "&apos;") + "' ");
                    StrXmlDocAdmissionFormField.Append("/>" + "\r\n");
                }
                StrXmlDocAdmissionFormField.Append("</Table>");
                AdmissionFormFieldXml = StrXmlDocAdmissionFormField.ToString();

                List<DataParameter> dpAdmissionFormField = new List<DataParameter>();
                DataParameter dAdmissionFormField;

                dAdmissionFormField = new DataParameter { Name = "@rOnlineStdentId", Value = Result.Id, DataType = System.Data.DbType.Int64 };
                dpAdmissionFormField.Add(dAdmissionFormField);

                dAdmissionFormField = new DataParameter { Name = "@rStrXml", Value = AdmissionFormFieldXml, DataType = System.Data.DbType.String };
                dpAdmissionFormField.Add(dAdmissionFormField);

                CommonFunctions cfAdmissionFormField = new CommonFunctions();
                DataSet dsAdmissionFormField = cfAdmissionFormField.GetDatasetFromSp("sStudent.pOnlineRegistrationFormFieldAdd", dpAdmissionFormField);


                // Assign Optional Subject
                StringBuilder StrXmlDocOptionalSubject = new StringBuilder();
                StrXmlDocOptionalSubject.Append("<Table>" + "\r\n");
                for (int os = 0; os < AssignOptionalSubjectCheckBoxList.Items.Count; os++)
                {
                    if (AssignOptionalSubjectCheckBoxList.Items[os].Selected == true)
                    {
                        string RootNode = "OptionalSubject";
                        StrXmlDocOptionalSubject.Append("<" + RootNode + " ");
                        StrXmlDocOptionalSubject.Append("ClassSubjectId" + " = '" + AssignOptionalSubjectCheckBoxList.Items[os].Value.ToString() + "' ");
                        StrXmlDocOptionalSubject.Append("/>" + "\r\n");
                    }
                }
                StrXmlDocOptionalSubject.Append("</Table>");

                List<DataParameter> dpOptionalSubject = new List<DataParameter>();
                DataParameter dOptionalSubject;

                dOptionalSubject = new DataParameter { Name = "@rOnlineRegistrationStudentId", Value = Result.Id, DataType = System.Data.DbType.Int64 };
                dpOptionalSubject.Add(dOptionalSubject);

                dOptionalSubject = new DataParameter { Name = "@rStrXml", Value = StrXmlDocOptionalSubject.ToString(), DataType = System.Data.DbType.String };
                dpOptionalSubject.Add(dOptionalSubject);

                cfAdmissionFormField.GetDatasetFromSp("sStudent.pOnlineRegistrationOptionalSubjectAdd", dpOptionalSubject);


                //string SQL_QUERY = "Select AF.*,OM.Title AS SchoolName,BM.Title AS BatchName,CM.Title AS ClassName,GM.Title AS Gender from sAdmission.tAdmissionForm AF LEFT JOIN sSetup.tOrganizationMaster OM ON AF.OrgId = OM.Id LEFT JOIN sSetup.tBatchMaster BM ON AF.BatchId=BM.Id LEFT JOIN sSetup.tClassMaster CM ON AF.ForClassId = CM.Id LEFT JOIN sCommon.tGenderMaster GM ON AF.GenderId = GM.Id where AF.Id=" + Result;
                //DataSet ds1 = new DataSet();
                //CommonFunctions cf1 = new CommonFunctions();
                //ds1 = cf1.GetDataset(SQL_QUERY);
                //if (ds1.Tables.Count > 0)
                //{
                //if (ds1.Tables[0].Rows.Count > 0)
                //{
                //    //Session["AdmissionFormDetails"] = ds1;
                Session["OnlineOrgGroupId"] = OrgGroupId;
                Session["OnlineOrgId"] = OrgDropDownList.SelectedValue;
                // Session["OrgIdFilter"] = AdmissionFormData.OrgId; //For filtering the admission form by orgid for further process
                //  Session.Remove("Role");
                Session["OnlineStdentId"] = Result.Id;
                Session["OnlineBatchId"] = BatchDropDownList.SelectedValue;
                Response.Redirect("StudentOnlineRegistrationFormConfirmation.aspx", false);
                Context.ApplicationInstance.CompleteRequest();
                //}
                //}


            }
            else if (Result.Code == -100)
                BirthDateErrorLabel.Text = "Id No Exists";
            else if (Result.Code == -101)
                BirthDateErrorLabel.Text = "UID Number Exists";
            else if (Result.Code == -102)
                BirthDateErrorLabel.Text = "Adhaar Number Exists";

            else if (Result.Code == -200)
                BirthDateErrorLabel.Text = "Registration Number Exists";
            else if (Result.Code == -111)
                BirthDateErrorLabel.Text = "Error updating Record";
            if (BirthDateErrorLabel.Text != "")
                failurebdaymessage.Visible = true;
        }

        else if (Result.Code == -1)
        {
            failuremessage.Visible = true;
            failuremessage.Focus();

        }

    }
    protected void CancelButton_Click(object sender, EventArgs e)
    {
        ClearControls();
        //settabindex();
    }

    private bool Validateforsave()
    {
        GetDisplayField();
        StringBuilder builder = new StringBuilder();
        //if (IdNoTextBox.Text == "")
        //{
        //    if (builder.Length > 0) builder.Append(",");
        //    builder.Append("Id Number required  ");
        //}

        if (FirstNameTextBox.Text == "")
        {
            if (builder.Length > 0) builder.Append(",");
            builder.Append("Student Name required  ");
            //return false;
        }
        if (SurnameDiv.Visible == true)
        {
            if (Surnamelbl.Visible == true)
            {
                if (SurnameTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Surname required  ");
                    //return false;
                }
            }
        }
        //if (DepartmentDropDownList.SelectedIndex <= 0)
        //{
        //    if (builder.Length > 0) builder.Append(",");
        //    builder.Append("Department  required  ");
        //    //return false;
        //}
        if (ClassIdDropDownList.SelectedIndex <= 0)
        {
            if (builder.Length > 0) builder.Append(",");
            builder.Append("Class  required  ");
            //return false;
        }
        if (DivisionIdDropDownList.SelectedIndex <= 0)
        {
            if (builder.Length > 0) builder.Append(",");
            builder.Append("Division  required  ");
            //return false;
        }
        if (StatusDropDownList.SelectedIndex <= 0)
        {
            if (builder.Length > 0) builder.Append(",");
            builder.Append("Status required  ");
            //return false;
        }

        if (MiddleNameDiv.Visible == true)
        {
            if (MiddleNamelbl.Visible == true)
            {
                if (MiddleNameTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Father Name  required  ");
                    //return false;
                }
            }
        }
        if (RollNoDiv.Visible == true)
        {
            if (RollNolbl.Visible == true)
            {
                if (RollNoTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("RollNo required  ");
                    //return false;
                }
            }
        }
        if (RecordTagDiv.Visible == true)
        {
            if (RecordTaglbl.Visible == true)
            {
                if (RecordTagDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Record Tag required  ");
                    //return false;
                }
            }
        }
        if (FeesCategoryDiv.Visible == true)
        {
            if (FeesCategorylbl.Visible == true)
            {
                if (FeesCategoryDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Fees Category required  ");
                    //return false;
                }
            }
        }
        if (AdmissionStandardDiv.Visible == true)
        {
            if (AdmissionStandardlbl.Visible == true)
            {
                if (AdmissionStandardDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Admission Standard required  ");
                    //return false;
                }
            }
        }

        if (AdmissionDateDiv.Visible == true)
        {
            if (AdmissionDatelbl.Visible == true)
            {
                if (AdmissionDateDatePickerControl.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Admission Date required  ");
                    //return false;
                }
            }
        }
        if (AdmissionYearDiv.Visible == true)
        {
            if (AdmissionYearlbl.Visible == true)
            {
                if (AdmissionYearTextBox.Text == "" && AdmissionYearTextBox.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Admission Year required  ");
                    //return false;
                }
            }
        }
        if (InActiveDateDiv.Visible == true)
        {
            if (InActiveDatelbl.Visible == true)
            {
                if (InActiveDateDatePickerControl.Text == "" && InActiveDateDatePickerControl.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("InActive Date required  ");
                    //return false;
                }
            }
        }
        if (LeftStandardDiv.Visible == true)
        {
            if (LeftStandardlbl.Visible == true)
            {
                if (LeftStandardIdDropDownList.SelectedIndex <= 0 && LeftStandardIdDropDownList.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Left Standard required  ");
                    //return false;
                }
            }
        }
        if (LeftDatedDiv.Visible == true)
        {
            if (LeftDatedlbl.Visible == true)
            {
                if (LeftDateDatePickerControl.Text == "" && LeftDateDatePickerControl.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Left Date required  ");
                    //return false;
                }
            }
        }
        if (StudentGroupDiv.Visible == true)
        {
            if (StudentGrouplbl.Visible == true)
            {
                if (StudentGroupDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Student Group required  ");
                    //return false;
                }
            }
        }
        if (StudentOtherGroupDiv.Visible == true)
        {
            if (StudentOtherGrouplbl.Visible == true)
            {
                if (StudentOtherGroupDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Student Other Group required  ");
                    //return false;
                }
            }
        }
        if (PreviousStudentIdDiv.Visible == true)
        {
            if (PreviousStudentIdlbl.Visible == true)
            {
                if (PreviousStudentIdTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Previous Student Id required  ");
                    //return false;
                }
            }
        }
        if (PreviousSchoolDiv.Visible == true)
        {
            if (PreviousSchoollbl.Visible == true)
            {
                if (PreviousSchoolTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Previous School required  ");
                    //return false;
                }
            }
        }
        if (PreviousSchoolTypeDiv.Visible == true)
        {
            if (PreviousSchoolTypelbl.Visible == true)
            {
                if (PreviousSchoolTypeDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Previous School Type required  ");
                    //return false;
                }
            }
        }
        if (PreviousStandardDiv.Visible == true)
        {
            if (PreviousStandardlbl.Visible == true)
            {
                if (PreviousStandardTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Previous Standard required  ");
                    //return false;
                }
            }
        }
        if (PassingYearDiv.Visible == true)
        {
            if (PassingYearlbl.Visible == true)
            {
                if (PassingYearTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Passing Year required  ");
                    //return false;
                }
            }
        }
        if (AdmissionFormNumberDiv.Visible == true)
        {
            if (AdmissionFormNumberlbl.Visible == true)
            {
                if (AdmissionFormNumberTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Admission Form Number required  ");
                    //return false;
                }
            }
        }
        if (AdmissionQuotaDiv.Visible == true)
        {
            if (AdmissionQuotalbl.Visible == true)
            {
                if (AdmissionQuotaDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Admission Quota required  ");
                    //return false;
                }
            }
        }
        if (AdmissionNumberDiv.Visible == true)
        {
            if (AdmissionNumberlbl.Visible == true)
            {
                if (AdmissionNumberTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Admission Number required  ");
                    //return false;
                }
            }
        }
        if (InActiveReasonDiv.Visible == true)
        {
            if (InActiveReasonlbl.Visible == true)
            {
                if (InActiveReasonTextBox.Text == "" && InActiveReasonTextBox.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("InActive Reason required  ");
                    //return false;
                }
            }
        }
        if (LCBookDiv.Visible == true)
        {
            if (LCBooklbl.Visible == true)
            {
                if (LCBookTextBox.Text == "" && LCBookTextBox.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("LC Book required  ");
                    //return false;
                }
            }
        }
        if (LCNumberDiv.Visible == true)
        {
            if (LCNumberlbl.Visible == true)
            {
                if (LCNumberTextBox.Text == "" && LCNumberTextBox.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("LC Number required  ");
                    //return false;
                }
            }
        }
        if (LCDateDiv.Visible == true)
        {
            if (LCDatelbl.Visible == true)
            {
                if (LCDateDatePickerControl.Text == "" && LCDateDatePickerControl.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("LC Date required  ");
                    //return false;
                }
            }
        }
        if (LCCopyDiv.Visible == true)
        {
            if (LCCopylbl.Visible == true)
            {
                if (LCCopyText.Text == "" && LCDateDatePickerControl.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("LC Copy required  ");
                    //return false;
                }
            }
        }
        if (LcIdDiv.Visible == true)
        {
            if (LcIdlbl.Visible == true)
            {
                if (LcIdTextBox.Text == "" && LcIdTextBox.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("LcId required  ");
                    //return false;
                }
            }
        }
        if (ExamSeatNoDiv.Visible == true)
        {
            if (ExamSeatNolbl.Visible == true)
            {
                if (ExamSeatNoTextBox.Text == "" && ExamSeatNoTextBox.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Exam Seat No required  ");
                    //return false;
                }
            }
        }
        if (LeftReasonDiv.Visible == true)
        {
            if (LeftReasonlbl.Visible == true)
            {
                if (LeftReasonTextBox.Text == "" && LeftReasonTextBox.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Left Reason required  ");
                    //return false;
                }
            }
        }
        if (LCProgressDiv.Visible == true)
        {
            if (LCProgresslbl.Visible == true)
            {
                if (LCProgressTextBox.Text == "" && LCProgressTextBox.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("LC Progress required  ");
                    //return false;
                }
            }
        }
        if (LCConductDiv.Visible == true)
        {
            if (LCConductlbl.Visible == true)
            {
                if (LCConductTextBox.Text == "" && LCConductTextBox.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("LC Conduct required  ");
                    //return false;
                }
            }
        }
        if (LCRemarkDiv.Visible == true)
        {
            if (LCRemarklbl.Visible == true)
            {
                if (LCRemarkTextBox.Text == "" && LCRemarkTextBox.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("LC Remark required  ");
                    //return false;
                }
            }
        }
        if (PreviousLCNumberDiv.Visible == true)
        {
            if (PreviousLCNumberlbl.Visible == true)
            {
                if (PreviousLCNumberTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Previous LC Number required  ");
                    //return false;
                }
            }
        }
        if (PreviousLCDateDiv.Visible == true)
        {
            if (PreviousLCDatelbl.Visible == true)
            {
                if (PreviousLCDateDatePickerControl.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Previous LC Date required  ");
                    //return false;
                }
            }
        }
        if (LCNumberDiv.Visible == true)
        {
            if (LCNumberlbl.Visible == true)
            {
                if (LCNumberTextBox.Text == "" && LCNumberTextBox.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("LC Number required  ");
                    //return false;
                }
            }
        }
        if (PreviousResultDiv.Visible == true)
        {
            if (PreviousResultlbl.Visible == true)
            {
                if (PreviousResultTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Previous Result required  ");
                    //return false;
                }
            }
        }
        if (ProofOfDOBDiv.Visible == true)
        {
            if (ProofOfDOBlbl.Visible == true)
            {
                if (ProofOfDOBTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Proof Of DOB required  ");
                    //return false;
                }
            }
        }
        if (TransferFromDiv.Visible == true)
        {
            if (TransferFromlbl.Visible == true)
            {
                if (TransferFromTextBox.Text == "" && TransferFromTextBox.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Transfer From required  ");
                    //return false;
                }
            }
        }
        if (CertificateNameDiv.Visible == true)
        {
            if (CertificateNamelbl.Visible == true)
            {
                if (CertificateNameTextBox.Text == "" && CertificateNameTextBox.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Certificate Name required  ");
                    //return false;
                }
            }
        }
        if (MaritalStatusDiv.Visible == true)
        {
            if (MaritalStatuslbl.Visible == true)
            {
                if (MaritalStatusDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Marital Status required  ");
                    //return false;
                }
            }
        }
        if (UIDNumberDiv.Visible == true)
        {
            if (UIDNumberlbl.Visible == true)
            {
                if (UIDNumberTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("UID Number required  ");
                    //return false;
                }
            }
        }
        if (AadhaarNumberDiv.Visible == true)
        {
            if (AadhaarNumberlbl.Visible == true)
            {
                if (AadhaarNumberTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Aadhaar Number required  ");
                    //return false;
                }
            }
        }
        if (DateofBirthDiv.Visible == true)
        {
            if (DateofBirthlbl.Visible == true)
            {
                if (DateofBirthDatePickerControl.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("DateofBirth  required  ");
                    //return false;
                }
            }
        }
        if (StudentPhotoDiv.Visible == true)
        {
            if (StudentPhotolbl.Visible == true)
            {

                if (StudentPhotoFileUpload.PostedFile.FileName == "" && StudentImage.Src == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append(" Student Photo required ");
                }

            }
        }
        if (BirthdateinwordDiv.Visible == true)
        {
            if (Birthdateinwordlbl.Visible == true)
            {
                if (BirthdateinwordTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Birthdate in word required  ");
                    //return false;
                }
            }
        }
        if (GenderDiv.Visible == true)
        {
            if (Genderlbl.Visible == true)
            {
                if (GenderDropDownList.SelectedIndex <= 0 && GenderDropDownList.Visible)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Gender required  ");
                    //return false;
                }
            }
        }
        if (ReligionDiv.Visible == true)
        {
            if (Religionlbl.Visible == true)
            {
                if (ReligionDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Religion required  ");
                    //return false;
                }
            }
        }
        if (BloodGroupDiv.Visible == true)
        {
            if (BloodGrouplbl.Visible == true)
            {
                if (BloodGroupDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Blood Group required  ");
                    //return false;
                }
            }
        }
        if (HobbyDiv.Visible == true)
        {
            if (Hobbylbl.Visible == true)
            {
                if (HobbyTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Hobby required  ");
                    //return false;
                }
            }
        }
        if (BirthPlaceDiv.Visible == true)
        {
            if (BirthPlacelbl.Visible == true)
            {
                if (BirthPlaceTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Birth Place required  ");
                    //return false;
                }
            }
        }
        if (BirthTalukaDiv.Visible == true)
        {
            if (BirthTalukalbl.Visible == true)
            {
                if (BirthTalukaTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Birth Taluka required  ");
                    //return false;
                }
            }
        }
        if (BirthDistrictDiv.Visible == true)
        {
            if (BirthDistrictlbl.Visible == true)
            {
                if (BirthDistrictTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Birth District required  ");
                    //return false;
                }
            }
        }
        if (BirthStateDiv.Visible == true)
        {
            if (BirthStatelbl.Visible == true)
            {
                if (BirthStateTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Birth State required  ");
                    //return false;
                }
            }
        }
        if (BirthCountryDiv.Visible == true)
        {
            if (BirthCountrylbl.Visible == true)
            {
                if (BirthCountryTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Birth Country required  ");
                    //return false;
                }
            }
        }
        if (FamilyCasteDiv.Visible == true)
        {
            if (FamilyCastelbl.Visible == true)
            {
                if (FamilyCasteTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Family Caste required  ");
                    //return false;
                }
            }
        }
        if (FamilySubCasteDiv.Visible == true)
        {
            if (FamilySubCastelbl.Visible == true)
            {
                if (FamilySubCasteTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Family Sub Caste required  ");
                    //return false;
                }
            }
        }
        if (CasteCategoryDiv.Visible == true)
        {
            if (CasteCategorylbl.Visible == true)
            {
                if (CasteCategoryDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Caste Category required  ");
                    //return false;
                }
            }
        }
        if (HouseDiv.Visible == true)
        {
            if (Houselbl.Visible == true)
            {
                if (HouseDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("House required  ");
                    //return false;
                }
            }
        }
        if (MotherTongueDiv.Visible == true)
        {
            if (MotherTonguelbl.Visible == true)
            {
                if (MotherTongueDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Mother Tongue required  ");
                    //return false;
                }
            }
        }
        if (NationalityDiv.Visible == true)
        {
            if (Nationalitylbl.Visible == true)
            {
                if (NationalityDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Nationality required  ");
                    //return false;
                }
            }
        }
        if (ReferenceRemarkDiv.Visible == true)
        {
            if (ReferenceRemarklbl.Visible == true)
            {
                if (ReferenceRemarkTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Reference Remark Text required  ");
                    //return false;
                }
            }
        }
        if (TransportDiv.Visible == true)
        {
            if (Transportlbl.Visible == true)
            {
                if (TransportDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Transport required  ");
                    //return false;
                }
            }
        }
        if (QuotaDiv.Visible == true)
        {
            if (Quotalbl.Visible == true)
            {
                if (QuotaDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Quota required  ");
                    //return false;
                }
            }
        }
        if (ParentContactNoDiv.Visible == true)
        {
            if (ParentContactNolbl.Visible == true)
            {
                if (ParentContactNoTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Parent Contact No required  ");
                    //return false;
                }
            }
            if (!string.IsNullOrEmpty(ParentContactNoTextBox.Text) && (ParentContactNoTextBox.Text.Trim().Length != ContactNoDigitValidation))
            {
                builder.Append("Parent Contact Number should be atleast of " + ContactNoDigitValidation + " digits");
                ParentContactNoTextBox.Focus();
                // return false;
            }

        }
        if (ParentEmailDiv.Visible == true)
        {
            if (ParentEmaillbl.Visible == true)
            {
                if (ParentEmailTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Parent Email required  ");
                    //return false;
                }
            }
        }
        if (StudentContactNoDiv.Visible == true)
        {
            if (StudentContactNolbl.Visible == true)
            {
                if (StudentContactNoTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Student Contact No required  ");
                    //return false;
                }

            }

            if (!string.IsNullOrEmpty(StudentContactNoTextBox.Text) && (StudentContactNoTextBox.Text.Trim().Length != ContactNoDigitValidation))
            {
                builder.Append("Student Contact Number should be atleast of " + ContactNoDigitValidation + " digits");
                StudentContactNoTextBox.Focus();
                //  return false;
            }
        }
        if (StudentEmailDiv.Visible == true)
        {
            if (StudentEmaillbl.Visible == true)
            {
                if (StudentEmailTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Student Email required  ");
                    //return false;
                }
            }
        }
        if (DistanceFromSchoolDiv.Visible == true)
        {
            if (DistanceFromSchoollbl.Visible == true)
            {
                if (DistanceFromSchoolTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Distance From School required  ");
                    //return false;
                }
            }
        }
        if (WhatsAppContactNoDiv.Visible == true)
        {
            if (WhatsAppContactNolbl.Visible == true)
            {
                if (WhatsAppContactNoTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("WhatsApp Contact No required  ");
                    //return false;
                }
            }
            if (!string.IsNullOrEmpty(WhatsAppContactNoTextBox.Text) && (WhatsAppContactNoTextBox.Text.Trim().Length != ContactNoDigitValidation))
            {
                builder.Append("WhatsApp Contact Number should be atleast of " + ContactNoDigitValidation + " digits");
                WhatsAppContactNoTextBox.Focus();
                //return false;
            }
        }
        if (LocalAddressAddress1Div.Visible == true)
        {
            if (LocalAddressAddress1lbl.Visible == true)
            {
                if (LocalAddressAddress1TextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Local Address Address1 required  ");
                    //return false;
                }
            }
        }
        if (LocalAddressAddress2Div.Visible == true)
        {
            if (LocalAddressAddress2lbl.Visible == true)
            {
                if (LocalAddressAddress2TextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Local Address Address2 required  ");
                    //return false;
                }
            }
        }
        if (LocalAddressAddress3Div.Visible == true)
        {
            if (LocalAddressAddress3lbl.Visible == true)
            {
                if (LocalAddressAddress3TextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Local Address Address3 required  ");
                    //return false;
                }
            }
        }
        if (LocalAddressCityDiv.Visible == true)
        {
            if (LocalAddressCitylbl.Visible == true)
            {
                if (LocalAddressCityTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Local Address City required  ");
                    //return false;
                }
            }
        }
        if (LocalAddressStateDiv.Visible == true)
        {
            if (LocalAddressStatelbl.Visible == true)
            {
                if (LocalAddressStateTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Local Address State required  ");
                    //return false;
                }
            }
        }
        if (LocalAddressCountryDiv.Visible == true)
        {
            if (LocalAddressCountrylbl.Visible == true)
            {
                if (LocalAddressCountryTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Local Address Country required  ");
                    //return false;
                }
            }
        }
        if (LocalAddressPINCodeDiv.Visible == true)
        {
            if (LocalAddressPINCodelbl.Visible == true)
            {
                if (LocalAddressPINCodeTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Local Address PIN Code required  ");
                    //return false;
                }
            }
        }
        if (LocalAddressContactNoDiv.Visible == true)
        {
            if (LocalAddressContactNolbl.Visible == true)
            {
                if (LocalAddressContactNoTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Local Address Contact No required  ");
                    //return false;
                }
            }
            if (!string.IsNullOrEmpty(LocalAddressContactNoTextBox.Text) && (LocalAddressContactNoTextBox.Text.Trim().Length != ContactNoDigitValidation))
            {
                builder.Append("Contact Number should be atleast of " + ContactNoDigitValidation + " digits");
                LocalAddressContactNoTextBox.Focus();
                //return false;
            }
        }
        if (PermanentAddressAddress1Div.Visible == true)
        {
            if (PermanentAddressAddress1lbl.Visible == true)
            {
                if (PermanentAddressAddress1TextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Permanent Address Address1 required  ");
                    //return false;
                }
            }
        }
        if (PermanentAddressAddress2Div.Visible == true)
        {
            if (PermanentAddressAddress2lbl.Visible == true)
            {
                if (PermanentAddressAddress2TextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Permanent Address Address2 required  ");
                    //return false;
                }
            }
        }
        if (PermanentAddressAddress3Div.Visible == true)
        {
            if (PermanentAddressAddress3lbl.Visible == true)
            {
                if (PermanentAddressAddress3TextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Permanent Address Address3 required  ");
                    //return false;
                }
            }
        }
        if (PermanentAddressCityDiv.Visible == true)
        {
            if (PermanentAddressCitylbl.Visible == true)
            {
                if (PermanentAddressCityTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Permanent Address City required  ");
                    //return false;
                }
            }
        }
        if (PermanentAddressStateDiv.Visible == true)
        {
            if (PermanentAddressStatelbl.Visible == true)
            {
                if (PermanentAddressStateTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Permanent Address State required  ");
                    //return false;
                }
            }
        }
        if (PermanentAddressCountryDiv.Visible == true)
        {
            if (PermanentAddressCountrylbl.Visible == true)
            {
                if (PermanentAddressCountryTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Permanent Address Country required  ");
                    //return false;
                }
            }
        }
        if (PermanentAddressPINCodeDiv.Visible == true)
        {
            if (PermanentAddressPINCodelbl.Visible == true)
            {
                if (PermanentAddressPINCodeTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Permanent Address PINCode required  ");
                    //return false;
                }
            }
        }
        if (PermanentAddressContactNoDiv.Visible == true)
        {
            if (PermanentAddressContactNolbl.Visible == true)
            {
                if (PermanentAddressContactNoTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Permanent Address ContactNo required  ");
                    //return false;
                }
            }
            if (!string.IsNullOrEmpty(PermanentAddressContactNoTextBox.Text) && (PermanentAddressContactNoTextBox.Text.Trim().Length != ContactNoDigitValidation))
            {
                builder.Append("Contact Number should be atleast of " + ContactNoDigitValidation + " digits ");
                PermanentAddressContactNoTextBox.Focus();
                return false;
            }
        }
        if (EmergencyAddressAddress1Div.Visible == true)
        {
            if (EmergencyAddressAddress1lbl.Visible == true)
            {
                if (EmergencyAddressAddress1TextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Emergency Address Address1 required  ");
                    //return false;
                }
            }
        }
        if (EmergencyAddressAddress2Div.Visible == true)
        {
            if (EmergencyAddressAddress2lbl.Visible == true)
            {
                if (EmergencyAddressAddress2TextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Emergency Address Address2 required  ");
                    //return false;
                }
            }
        }
        if (EmergencyAddressAddress3Div.Visible == true)
        {
            if (EmergencyAddressAddress3lbl.Visible == true)
            {
                if (EmergencyAddressAddress3TextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Emergency Address Address3 required  ");
                    //return false;
                }
            }
        }
        if (EmergencyAddressCityDiv.Visible == true)
        {
            if (EmergencyAddressCitylbl.Visible == true)
            {
                if (EmergencyAddressCityTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Emergency Address City required  ");
                    //return false;
                }
            }
        }
        if (EmergencyAddressStateDiv.Visible == true)
        {
            if (EmergencyAddressStatelbl.Visible == true)
            {
                if (EmergencyAddressStateTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Emergency Address State required  ");
                    //return false;
                }
            }
        }
        if (EmergencyAddressCountryDiv.Visible == true)
        {
            if (EmergencyAddressCountrylbl.Visible == true)
            {
                if (EmergencyAddressCountryTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Emergency Address Country required  ");
                    //return false;
                }
            }
        }
        if (EmergencyAddressPINCodeDiv.Visible == true)
        {
            if (EmergencyAddressPINCodelbl.Visible == true)
            {
                if (EmergencyAddressPINCodeTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Emergency Address PINCode required  ");
                    //return false;
                }
            }
        }
        if (EmergencyAddressContactNoDiv.Visible == true)
        {
            if (EmergencyAddressContactNolbl.Visible == true)
            {
                if (EmergencyAddressContactNoTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Emergency Address ContactNo required  ");
                    //return false;
                }
            }
            if (!string.IsNullOrEmpty(EmergencyAddressContactNoTextBox.Text) && (EmergencyAddressContactNoTextBox.Text.Trim().Length != ContactNoDigitValidation))
            {
                builder.Append("Contact Number should be atleast of " + ContactNoDigitValidation + " digits");
                EmergencyAddressContactNoTextBox.Focus();
                //return false;
            }
        }

        if (StudentCustomAlertDiv.Visible == true)
        {
            if (StudentCustomAlertlbl.Visible == true)
            {
                if (StudentCustomAlertTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Student Custom Alert required  ");
                    //return false;
                }
            }
        }
        if (FamilyDetailFatherNameDiv.Visible == true)
        {
            if (FamilyDetailFatherNamelbl.Visible == true)
            {
                if (FamilyDetailFatherNameTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Father Name required  ");
                    //return false;
                }
            }
        }
        if (FatherDateofBirthDiv.Visible == true)
        {
            if (FatherDateofBirthlbl.Visible == true)
            {
                if (FatherDateofBirthDatePickerControl.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Father Date of Birth required  ");
                    //return false;
                }
            }
        }

        if (FatherOccupationDiv.Visible == true)
        {
            if (FatherOccupationlbl.Visible == true)
            {
                if (FatherOccupationTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Father Occupation required  ");
                    //return false;
                }
            }
        }
        if (FatherQualificationDiv.Visible == true)
        {
            if (FatherQualificationlbl.Visible == true)
            {
                if (FatherQualificationTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Father Qualification required  ");
                    //return false;
                }
            }
        }
        if (FatherContactNoDiv.Visible == true)
        {
            if (FatherContactNolbl.Visible == true)
            {
                if (FatherContactNoTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Father Contact No required  ");
                    //return false;
                }
            }
            if (!string.IsNullOrEmpty(FatherContactNoTextBox.Text) && (FatherContactNoTextBox.Text.Trim().Length != ContactNoDigitValidation))
            {
                if (builder.Length > 0) builder.Append(",");
                builder.Append("Father Contact Number should be atleast of " + ContactNoDigitValidation + " digits");
                //FatherContactNoTextBox.Focus();
                //return false;
            }
        }
        if (FatherMailDiv.Visible == true)
        {
            if (FatherMaillbl.Visible == true)
            {
                if (FatherMailTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Father Mail required  ");
                    //return false;
                }
            }
        }
        if (FatherDesignationDiv.Visible == true)
        {
            if (FatherDesignationlbl.Visible == true)
            {
                if (FatherDesignationTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Father Designation required  ");
                    //return false;
                }
            }
        }
        if (FatherOfficeContactNoDiv.Visible == true)
        {
            if (FatherOfficeContactNolbl.Visible == true)
            {
                if (FatherOfficeContactNoTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Father Office ContactNo required  ");
                    //return false;
                }
            }
            if (!string.IsNullOrEmpty(FatherOfficeContactNoTextBox.Text) && (FatherOfficeContactNoTextBox.Text.Trim().Length != ContactNoDigitValidation))
            {
                if (builder.Length > 0) builder.Append(",");
                builder.Append("Father Office Contact Number should be atleast of " + ContactNoDigitValidation + " digits");
                //FatherOfficeContactNoTextBox.Focus();
                // return false;
            }

        }
        if (FatherOfficeAddressDiv.Visible == true)
        {
            if (FatherOfficeAddresslbl.Visible == true)
            {
                if (FatherOfficeAddressTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Father Office Address required  ");
                    //return false;
                }
            }
        }
        if (FatherOrganizationDiv.Visible == true)
        {
            if (FatherOrganizationlbl.Visible == true)
            {
                if (FatherOrganizationTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Father Organization required  ");
                    //return false;
                }
            }
        }
        if (FatherAadharNoDiv.Visible == true)
        {
            if (FatherAadharNolbl.Visible == true)
            {
                if (FatherAadharNoTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Father Aadhar No required  ");
                    //return false;
                }
            }
        }
        if (FatherIncomeDiv.Visible == true)
        {
            if (FatherIncomelbl.Visible == true)
            {
                if (FatherIncomeTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Father Annual Income required  ");
                    //return false;
                }
            }
        }
        if (FatherPassOutYearDiv.Visible == true)
        {
            if (FatherPassOutYearlbl.Visible == true)
            {
                if (FatherPassOutYearTextBox.Text == "" && FatherPassOutYearTextBox.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("FatherPassOutYear required  ");
                    //return false;
                }
            }
        }
        if (FatherPhotoDiv.Visible == true)
        {
            if (FatherPhotolbl.Visible == true)
            {

                if (FatherPhotoFileUpload.PostedFile.FileName == "" && FatherImage.Src == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append(" Father Photo required ");
                }

            }
        }

        if (MotherNameDiv.Visible == true)
        {
            if (MotherNamelbl.Visible == true)
            {
                if (MotherNameTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Mother Name required  ");
                    //return false;
                }
            }
        }
        if (MotherDateofBirthDiv.Visible == true)
        {
            if (MotherDateofBirthlbl.Visible == true)
            {
                if (MotherDateofBirthDatePickerControl.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Mother Date of Birth required  ");
                    //return false;
                }
            }
        }

        if (MotherOccupationDiv.Visible == true)
        {
            if (MotherOccupationlbl.Visible == true)
            {
                if (MotherOccupationTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Mother Occupation required  ");
                    //return false;
                }
            }
        }
        if (MotherQualificationDiv.Visible == true)
        {
            if (MotherQualificationlbl.Visible == true)
            {
                if (MotherQualificationTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Mother Qualification required  ");
                    //return false;
                }
            }
        }
        if (MotherContactNoDiv.Visible == true)
        {
            if (MotherContactNolbl.Visible == true)
            {
                if (MotherContactNoTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Mother Contact No required  ");
                    //return false;
                }
            }

            if (!string.IsNullOrEmpty(MotherContactNoTextBox.Text) && (MotherContactNoTextBox.Text.Trim().Length != ContactNoDigitValidation))
            {
                if (builder.Length > 0) builder.Append(",");
                builder.Append("Mother Contact Number should be atleast of " + ContactNoDigitValidation + " digits");
                //MotherContactNoTextBox.Focus();
                //return false;
            }
        }
        if (MotherMailDiv.Visible == true)
        {
            if (MotherMaillbl.Visible == true)
            {
                if (MotherMailTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Mother Mail required  ");
                    //return false;
                }
            }
        }
        if (MotherDesignationDiv.Visible == true)
        {
            if (MotherDesignationlbl.Visible == true)
            {
                if (MotherDesignationTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Mother Designation required  ");
                    //return false;
                }
            }
        }
        if (MotherOfficeContactNoDiv.Visible == true)
        {
            if (MotherOfficeContactNolbl.Visible == true)
            {
                if (MotherOfficeContactNoTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Mother Office ContactNo required  ");
                    //return false;
                }
            }

            if (!string.IsNullOrEmpty(MotherOfficeContactNoTextBox.Text) && (MotherOfficeContactNoTextBox.Text.Trim().Length != ContactNoDigitValidation))
            {
                if (builder.Length > 0) builder.Append(",");
                builder.Append("Mother Office Contact Number should be atleast of " + ContactNoDigitValidation + " digits");
                //MotherOfficeContactNoTextBox.Focus();
                //  return false;
            }
        }
        if (MotherOfficeAddressDiv.Visible == true)
        {
            if (MotherOfficeAddresslbl.Visible == true)
            {
                if (MotherOfficeAddressTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Mother Office Address required  ");
                    //return false;
                }
            }
        }
        if (MotherOrganizationDiv.Visible == true)
        {
            if (MotherOrganizationlbl.Visible == true)
            {
                if (MotherOrganizationTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Mother Organization required  ");
                    //return false;
                }
            }
        }
        if (MotherAadharNoDiv.Visible == true)
        {
            if (MotherAadharNolbl.Visible == true)
            {
                if (MotherAadharNoTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Mother Aadhar No required  ");
                    //return false;
                }
            }
        }
        if (MarriageAnniversaryDateDiv.Visible == true)
        {
            if (MarriageAnniversaryDatelbl.Visible == true)
            {
                if (MarriageAnniversaryDateDatePickerControl.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Marriage Anniversary Date required  ");
                    //return false;
                }
            }
        }
        if (MotherIncomeDiv.Visible == true)
        {
            if (MotherIncomelbl.Visible == true)
            {
                if (MotherIncomeTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Mother Annual Income required  ");
                    //return false;
                }
            }
        }
        if (MotherPassOutYearDiv.Visible == true)
        {
            if (MotherPassOutYearlbl.Visible == true)
            {
                if (MotherPassOutYearTextBox.Text == "" && MotherPassOutYearTextBox.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("MotherPassOutYear required  ");
                    //return false;
                }
            }
        }
        if (MotherPhotoDiv.Visible == true)
        {
            if (MotherPhotolbl.Visible == true)
            {

                if (MotherPhotoFileUpload.PostedFile.FileName == "" && MotherImage.Src == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append(" Mother Photo required ");
                }

            }
        }
        if (RelationNameDiv.Visible == true)
        {
            if (RelationNamelbl.Visible == true)
            {
                if (RelationNameTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("RelationName required  ");
                    //return false;
                }
            }
        }
        if (RelativeNameDiv.Visible == true)
        {
            if (RelativeNamelbl.Visible == true)
            {
                if (RelativeNameTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Relative Name required  ");
                    //return false;
                }
            }
        }
        if (RelativeDateofBirthDiv.Visible == true)
        {
            if (RelativeDateofBirthlbl.Visible == true)
            {
                if (RelativeDateofBirthDatePickerControl.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Relative Date of Birth required  ");
                    //return false;
                }
            }
        }

        if (RelativeOccupationDiv.Visible == true)
        {
            if (RelativeOccupationlbl.Visible == true)
            {
                if (RelativeOccupationTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Relative Occupation required  ");
                    //return false;
                }
            }
        }
        if (RelativeQualificationDiv.Visible == true)
        {
            if (RelativeQualificationlbl.Visible == true)
            {
                if (RelativeQualificationTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Relative Qualification required  ");
                    //return false;
                }
            }
        }
        if (RelativeContactNoDiv.Visible == true)
        {
            if (RelativeContactNolbl.Visible == true)
            {
                if (RelativeContactNoTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Relative Contact No required  ");
                    //return false;
                }
            }
            if (!string.IsNullOrEmpty(RelativeContactNoTextBox.Text) && (RelativeContactNoTextBox.Text.Trim().Length != ContactNoDigitValidation))
            {
                if (builder.Length > 0) builder.Append(",");
                builder.Append("Relative Contact Number should be atleast of " + ContactNoDigitValidation + " digits");
                //RelativeContactNoTextBox.Focus();
                //return false;
            }


        }
        if (RelativeMailDiv.Visible == true)
        {
            if (RelativeMaillbl.Visible == true)
            {
                if (RelativeMailTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Relative Mail required  ");
                    //return false;
                }
            }
        }
        if (RelativeDesignationDiv.Visible == true)
        {
            if (RelativeDesignationlbl.Visible == true)
            {
                if (RelativeDesignationTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Relative Designation required  ");
                    //return false;
                }
            }
        }

        if (RelativeOfficeAddressDiv.Visible == true)
        {
            if (RelativeOfficeAddresslbl.Visible == true)
            {
                if (RelativeOfficeAddressTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Relative Office Address required  ");
                    //return false;
                }
            }
        }
        if (RelativeOrganizationDiv.Visible == true)
        {
            if (RelativeOrganizationlbl.Visible == true)
            {
                if (RelativeOrganizationTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Relative Organization required  ");
                    //return false;
                }
            }
        }

        if (RelativeIncomeDiv.Visible == true)
        {
            if (RelativeIncomelbl.Visible == true)
            {
                if (RelativeIncomeTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Relative Annual Income required  ");
                    //return false;
                }
            }
        }
        if (RelativePassOutYearDiv.Visible == true)
        {
            if (RelativePassOutYearlbl.Visible == true)
            {
                if (RelativePassOutYearTextBox.Text == "" && RelativePassOutYearTextBox.Enabled)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Relative PassOutYear required  ");
                    //return false;
                }
            }
        }
        if (RelativePhotoDiv.Visible == true)
        {
            if (RelativePhotolbl.Visible == true)
            {

                if (RelativePhotoFileUpload.PostedFile.FileName == "" && RelativeImage.Src == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append(" Relative Photo required ");
                }

            }
        }
        if (LiveWithDiv.Visible == true)
        {
            if (LiveWithlbl.Visible == true)
            {
                if (LiveWithDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("LiveWith required  ");
                    //return false;
                }
            }
        }

        if (BankAccountNumberDiv.Visible == true)
        {
            if (BankAccountNumberlbl.Visible == true)
            {
                if (BankAccountNumberTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Bank AccountNumber required  ");
                    //return false;
                }
            }
        }
        if (BankNameDiv.Visible == true)
        {
            if (BankNamelbl.Visible == true)
            {
                if (BankNameTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Bank Name required  ");
                    //return false;
                }
            }
        }
        if (BankBranchDiv.Visible == true)
        {
            if (BankBranchlbl.Visible == true)
            {
                if (BankBranchTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Bank Branch required  ");
                    //return false;
                }
            }
        }
        if (BankIFSCCodeDiv.Visible == true)
        {
            if (BankIFSCCodelbl.Visible == true)
            {
                if (BankIFSCCodeTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Bank IFSC Code required  ");
                    //return false;
                }
            }
        }
        if (BankAccountHolderNameDiv.Visible == true)
        {
            if (BankAccountHolderNamelbl.Visible == true)
            {
                if (BankAccountHolderNameTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("BankAccount HolderName required  ");
                    //return false;
                }
            }
        }
        if (Class9BoardRegistrationNumberDiv.Visible == true)
        {
            if (Class9BoardRegistrationNumberlbl.Visible == true)
            {
                if (Class9BoardRegistrationNumberTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Class9 Board RegistrationNumber required  ");
                    //return false;
                }
            }
        }
        if (Class11BoardRegistrationNumberDiv.Visible == true)
        {
            if (Class11BoardRegistrationNumberlbl.Visible == true)
            {
                if (Class11BoardRegistrationNumberTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Class11 Board RegistrationNumber required  ");
                    //return false;
                }
            }
        }
        if (PassportNumberDiv.Visible == true)
        {
            if (PassportNumberlbl.Visible == true)
            {
                if (PassportNumberTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Passport Number required  ");
                    //return false;
                }
            }
        }
        if (PassportTypeDiv.Visible == true)
        {
            if (PassportTypelbl.Visible == true)
            {
                if (PassportTypeTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Passport Type required  ");
                    //return false;
                }
            }
        }
        if (PassportCountryCodeDiv.Visible == true)
        {
            if (PassportCountryCodelbl.Visible == true)
            {
                if (PassportCountryCodeTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Passport Country Code required  ");
                    //return false;
                }
            }
        }
        if (PassportIssueDateDiv.Visible == true)
        {
            if (PassportIssueDatelbl.Visible == true)
            {
                if (PassportIssueDateDatePickerControl.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Passport Issue Date required  ");
                    //return false;
                }
            }
        }
        if (PassportExpiryDateDiv.Visible == true)
        {
            if (PassportExpiryDatelbl.Visible == true)
            {
                if (PassportExpiryDateDatePickerControl.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Passport Expiry Date required  ");
                    //return false;
                }
            }
        }
        if (SSCBoardDiv.Visible == true)
        {
            if (SSCBoardlbl.Visible == true)
            {
                if (SSCBoardTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("SSC Board required  ");
                    //return false;
                }
            }
        }
        if (SSCSchoolDiv.Visible == true)
        {
            if (SSCSchoollbl.Visible == true)
            {
                if (SSCSchoolTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("SSC School required  ");
                    //return false;
                }
            }
        }
        if (SSCPassingYearDiv.Visible == true)
        {
            if (SSCPassingYearlbl.Visible == true)
            {
                if (SSCPassingYearTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("SSC Passing Year required  ");
                    //return false;
                }
            }
        }
        if (SSCObtainMarksDiv.Visible == true)
        {
            if (SSCObtainMarkslbl.Visible == true)
            {
                if (SSCObtainMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("SSC Obtain Marks required  ");
                    //return false;
                }
            }
        }
        if (SSCOutOfMarksDiv.Visible == true)
        {
            if (SSCOutOfMarkslbl.Visible == true)
            {
                if (SSCOutOfMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("SSC OutOfMarks required  ");
                    //return false;
                }
            }
        }
        if (SSCPercentageDiv.Visible == true)
        {
            if (SSCPercentagelbl.Visible == true)
            {
                if (SSCPercentageTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("SSC Percentage required  ");
                    //return false;
                }
            }
        }
        if (SSCMathMarksDiv.Visible == true)
        {
            if (SSCMathMarkslbl.Visible == true)
            {
                if (SSCMathMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("SSC Math Marks required  ");
                    //return false;
                }
            }
        }
        if (SSCMathOutOfMarksDiv.Visible == true)
        {
            if (SSCMathOutOfMarkslbl.Visible == true)
            {
                if (SSCMathOutOfMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("SSC Math OutOfMarks required  ");
                    //return false;
                }
            }
        }
        if (SSCPercentileDiv.Visible == true)
        {
            if (SSCPercentilelbl.Visible == true)
            {
                if (SSCPercentileTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("SSC Percentile required  ");
                    //return false;
                }
            }
        }
        if (SSCGradeDiv.Visible == true)
        {
            if (SSCGradelbl.Visible == true)
            {
                if (SSCGradeTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("SSC Grade required  ");
                    //return false;
                }
            }
        }
        if (HSCBoardDiv.Visible == true)
        {
            if (HSCBoardlbl.Visible == true)
            {
                if (HSCBoardTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("HSC Board required  ");
                    //return false;
                }
            }
        }
        if (HSCSchoolDiv.Visible == true)
        {
            if (HSCSchoollbl.Visible == true)
            {
                if (HSCSchoolTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("HSC School required  ");
                    //return false;
                }
            }
        }
        if (HSCPassingYearDiv.Visible == true)
        {
            if (HSCPassingYearlbl.Visible == true)
            {
                if (HSCPassingYearTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("HSC Passing Year required  ");
                    //return false;
                }
            }
        }
        if (HSCObtainMarksDiv.Visible == true)
        {
            if (HSCObtainMarkslbl.Visible == true)
            {
                if (HSCObtainMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("HSC Obtain Marks required  ");
                    //return false;
                }
            }
        }
        if (HSCOutOfMarksDiv.Visible == true)
        {
            if (HSCOutOfMarkslbl.Visible == true)
            {
                if (HSCOutOfMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("HSC OutOfMarks required  ");
                    //return false;
                }
            }
        }
        if (HSCPercentageDiv.Visible == true)
        {
            if (HSCPercentagelbl.Visible == true)
            {
                if (HSCPercentageTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("HSC Percentage required  ");
                    //return false;
                }
            }
        }
        if (HSCPhysicsMarksDiv.Visible == true)
        {
            if (HSCPhysicsMarkslbl.Visible == true)
            {
                if (HSCPhysicsMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("HSC Physics Marks required  ");
                    //return false;
                }
            }
        }
        if (HSCPhysicsOutOfMarksDiv.Visible == true)
        {
            if (HSCPhysicsOutOfMarkslbl.Visible == true)
            {
                if (HSCPhysicsOutOfMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("HSC Physics OutOf Marks required  ");
                    //return false;
                }
            }
        }
        if (HSCChemistryMarksDiv.Visible == true)
        {
            if (HSCChemistryMarkslbl.Visible == true)
            {
                if (HSCChemistryMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("HSC Chemistry Marks required  ");
                    //return false;
                }
            }
        }
        if (HSCChemistryOutOfMarksDiv.Visible == true)
        {
            if (HSCChemistryOutOfMarkslbl.Visible == true)
            {
                if (HSCChemistryOutOfMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("HSC Chemistry OutOf Marks required  ");
                    //return false;
                }
            }
        }
        if (HSCMathMarksDiv.Visible == true)
        {
            if (HSCMathMarkslbl.Visible == true)
            {
                if (HSCMathMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("HSC Math Marks required  ");
                    //return false;
                }
            }
        }
        if (HSCMathOutOfMarksDiv.Visible == true)
        {
            if (HSCMathOutOfMarkslbl.Visible == true)
            {
                if (HSCMathOutOfMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("HSC Math OutOf Marks required  ");
                    //return false;
                }
            }
        }
        if (HSCBiologyMarksDiv.Visible == true)
        {
            if (HSCBiologyMarkslbl.Visible == true)
            {
                if (HSCBiologyMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("HSC Biology Marks required  ");
                    //return false;
                }
            }
        }
        if (HSCBiologyOutOfMarksDiv.Visible == true)
        {
            if (HSCBiologyOutOfMarkslbl.Visible == true)
            {
                if (HSCBiologyOutOfMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("HSC Biology OutOf Marks required  ");
                    //return false;
                }
            }
        }
        if (PCMMarksDiv.Visible == true)
        {
            if (PCMMarkslbl.Visible == true)
            {
                if (PCMMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("PCM Marks required  ");
                    //return false;
                }
            }
        }
        if (PCBMarksDiv.Visible == true)
        {
            if (PCBMarkslbl.Visible == true)
            {
                if (PCBMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("PCB Marks required  ");
                    //return false;
                }
            }
        }
        if (JEERollNoDiv.Visible == true)
        {
            if (JEERollNolbl.Visible == true)
            {
                if (JEERollNoTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("JEE RollNo required  ");
                    //return false;
                }
            }
        }
        if (JEEMeritNoDiv.Visible == true)
        {
            if (JEEMeritNolbl.Visible == true)
            {
                if (JEEMeritNoTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("JEE Merit No required  ");
                    //return false;
                }
            }
        }
        if (JEEMeritMarksDiv.Visible == true)
        {
            if (JEEMeritMarkslbl.Visible == true)
            {
                if (JEEMeritMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("JEE Merit Marks required  ");
                    //return false;
                }
            }
        }
        if (JEEOutOfMarksDiv.Visible == true)
        {
            if (JEEOutOfMarkslbl.Visible == true)
            {
                if (JEEOutOfMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("JEE OutOf Marks required  ");
                    //return false;
                }
            }
        }

        if (DiplomaBoardDiv.Visible == true)
        {
            if (DiplomaBoardlbl.Visible == true)
            {
                if (DiplomaBoardTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Diploma Board required  ");
                    //return false;
                }
            }
        }
        if (DiplomaCollegeDiv.Visible == true)
        {
            if (DiplomaCollegelbl.Visible == true)
            {
                if (DiplomaCollegeTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Diploma College required  ");
                    //return false;
                }
            }
        }
        if (DiplomaPassingYearDiv.Visible == true)
        {
            if (DiplomaPassingYearlbl.Visible == true)
            {
                if (DiplomaPassingYearTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Diploma Passing Year required  ");
                    //return false;
                }
            }
        }
        if (DiplomaObtainMarksDiv.Visible == true)
        {
            if (DiplomaObtainMarkslbl.Visible == true)
            {
                if (DiplomaObtainMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Diploma Obtain Marks required  ");
                    //return false;
                }
            }
        }
        if (DiplomaOutOfMarksDiv.Visible == true)
        {
            if (DiplomaOutOfMarkslbl.Visible == true)
            {
                if (DiplomaOutOfMarksTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Diploma OutOfMarks required  ");
                    //return false;
                }
            }
        }
        if (DiplomaPercentageDiv.Visible == true)
        {
            if (DiplomaPercentagelbl.Visible == true)
            {
                if (DiplomaPercentageTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Diploma Percentage required  ");
                    //return false;
                }
            }
        }
        if (ApplicationIdDiv.Visible == true)
        {
            if (ApplicationIdlbl.Visible == true)
            {
                if (ApplicationIdTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("ApplicationId required  ");
                    //return false;
                }
            }
        }
        if (AdmissionRoundDiv.Visible == true)
        {
            if (AdmissionRoundlbl.Visible == true)
            {
                if (AdmissionRoundTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Admission Round required  ");
                    //return false;
                }
            }
        }
        if (OptionalSubjectDiv.Visible)
        {
            string selectedItems = String.Join(",", AssignOptionalSubjectCheckBoxList.Items.OfType<ListItem>().Where(r => r.Selected).Select(r => r.Text));
            if (string.IsNullOrEmpty(selectedItems))
            {
                if (builder.Length > 0) builder.Append(",");
                builder.Append("Select optional subject");
            }
        }

        if (UIDNumberDiv.Visible == true)
        {
            if (!string.IsNullOrEmpty(UIDNumberTextBox.Text) && (UIDNumberTextBox.Text.Trim().Length != StudentUIDNumberDigitValidation))
            {
                builder.Append("UID Number should be atleast of " + StudentUIDNumberDigitValidation + " digits");
            }
        }
        //Addded By Dhananjay for Mantis Start- 0033982 
        if (PhysicalDropDownListDiv.Visible == true)
        {
            if (Physicallbl.Visible == true)
            {
                if (PhysicalDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Select Physical Disability  ");
                    //return false;
                }
            }
        }
        if (PhysicalDisabilityDiv.Visible == true)
        {
            if (PhysicalDisabilitylbl.Visible == true)
            {
                if (PhysicalDisabilityTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Physical Disability Remark required  ");
                    //return false;
                }
            }
        }
        if (MajorIllnessDiv.Visible == true)
        {
            if (MajorIllnesslbl.Visible == true)
            {
                if (MajorIllnessTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("MajorIllness Remark required  ");
                    //return false;
                }
            }
        }
        if (PastHistoryDiv.Visible == true)
        {
            if (PastHistorylbl.Visible == true)
            {
                if (PastHistoryTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("PastHistory Remark required  ");
                    //return false;
                }
            }
        }
        if (AllergyDiv.Visible == true)
        {
            if (Allergylbl.Visible == true)
            {
                if (AllergyTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Allergy Remark required  ");
                    //return false;
                }
            }
        }
        if (IdentificationMark1Div.Visible == true)
        {
            if (IdentificationMark1lbl.Visible == true)
            {
                if (IdentificationMark1TextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("IdentificationMark1 required  ");
                    //return false;
                }
            }
        }
        if (IdentificationMark2Div.Visible == true)
        {
            if (IdentificationMark2lbl.Visible == true)
            {
                if (IdentificationMark2TextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("IdentificationMark2 required  ");
                    //return false;
                }
            }
        }
        if (FamilyDoctorNameDiv.Visible == true)
        {
            if (FamilyDoctorNamelbl.Visible == true)
            {
                if (FamilyDoctorNameTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("FamilyDoctorName required  ");
                    //return false;
                }
            }
        }
        if (FamilyDoctorContactNoDiv.Visible == true)
        {
            if (FamilyDoctorContactNolbl.Visible == true)
            {
                if (FamilyDoctorContactNoTextBox.Text == "")
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("FamilyDoctorContactNo  required  ");
                    //return false;
                }
            }
            if (!string.IsNullOrEmpty(FamilyDoctorContactNoTextBox.Text) && (FamilyDoctorContactNoTextBox.Text.Trim().Length != ContactNoDigitValidation))
            {
                builder.Append("FamilyDoctorContactNo should be atleast of " + ContactNoDigitValidation + "digits");
                FamilyDoctorContactNoTextBox.Focus();
            }
        }

        //Addded By Dhananjay for Mantis End- 0033982 


        foreach (GridViewRow dr in OnlineRegistrationCriteriaFormGridView.Rows)
        {

            string FieldRemark = OnlineRegistrationCriteriaFormGridView.Rows[dr.RowIndex].Cells[1].Text;


            int FieldTypeId = int.Parse(OnlineRegistrationCriteriaFormGridView.DataKeys[dr.RowIndex].Values[1].ToString());
            bool IsFieldMandatory = bool.Parse(OnlineRegistrationCriteriaFormGridView.DataKeys[dr.RowIndex].Values[3].ToString());
            DropDownList FieldTypeDropDownList = (DropDownList)(dr.FindControl("FieldTypeDropDownList"));
            TextBox FieldTypeTextBox = (TextBox)(dr.FindControl("FieldTypeTextBox"));

            if (FieldTypeId == 1 || FieldTypeId == 2)
            {
                if (IsFieldMandatory == true && FieldTypeDropDownList.SelectedIndex <= 0)
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Select Values of " + FieldRemark + "  ");
                }

            }
            else
            {
                if (IsFieldMandatory == true && string.IsNullOrEmpty(FieldTypeTextBox.Text))
                {
                    if (builder.Length > 0) builder.Append(",");
                    builder.Append("Enter Values of " + FieldRemark + "  ");
                }
            }
        }



        //if (MCustomField1AnswerLabel.Visible == true && CustomField1DropDownList.SelectedIndex <= 0 && (string.IsNullOrEmpty(CustomField1AnswerTextBox.Text)))
        //{
        //    builder.Append("Select / Enter " + CustomField1AnswerLabel.Text);
        //}

        //if (MCustomField2AnswerLabel.Visible == true && CustomField2DropDownList.SelectedIndex <= 0 && (string.IsNullOrEmpty(CustomField2AnswerTextBox.Text)))
        //{
        //    builder.Append("Select / Enter " + CustomField2AnswerLabel.Text);
        //}

        //if (MCustomField3AnswerLabel.Visible == true && CustomField3DropDownList.SelectedIndex <= 0 && (string.IsNullOrEmpty(CustomField3AnswerTextBox.Text)))
        //{
        //    builder.Append("Select / Enter " + CustomField3AnswerLabel.Text);
        //}

        if (!string.IsNullOrEmpty(builder.ToString()))
        {
            failurebdaymessage.Visible = true;
            BirthDateErrorLabel.Text = builder.ToString();
            failurebdaymessage.Focus();
            // Response.Write("* fields are required");
            return false;
        }

        return true;


    }
    private void PageLoadActivities()
    {
        // Function To Set Screen State

        SetScreenState(ScreenState.New);

        // Function To Load DropDownLists        
        LoadDropdowns();
        LoadDropdownList();
        //OnlineRegistrationCriteriaFormGridViewDisplay();
        //IsDefaultGenderId = ((ConfigurationHelper.GetUserConfigurationValue("Common.SchoolGenderType")));
        //if (IsDefaultGenderId == "Boys")
        //    GenderDropDownList.SelectedIndex = 1;
        //else if (IsDefaultGenderId == "Girls")
        //    GenderDropDownList.SelectedIndex = 2;
        //else
        //    GenderDropDownList.SelectedIndex = 0;
        //if (Convert.ToBoolean(ConfigurationHelper.GetUserConfigurationValue("Student.IsNewAdmissionTempRegistration")) == true)
        //    RecordStatusDropDownList.SelectedIndex = 2;
        //else
        //    RecordStatusDropDownList.SelectedIndex = 1;
    }
    protected void OTPButton_Click(object sender, EventArgs e)
    {
        if (ValidateForOTP())
        {
            string SMSTemplate = string.Empty, WhatsAppTemplate = string.Empty;

            EventTemplate EventTemplateData = new EventTemplate();
            List<EventTemplate> EventTemplateList = new List<EventTemplate>();
            EventTemplateData.OrgId = int.Parse(OrgDropDownList.SelectedValue);
            EventTemplateData.EventId = 104;
            EventTemplateList = AlertServiceClient.CheckEventTemplate(EventTemplateData);

            if (EventTemplateList != null && EventTemplateList.Count > 0)
            {
                for (int i = 0; i < EventTemplateList.Count; i++)
                {
                    if (EventTemplateList[i].AlertModeId == 2 && EventTemplateList[i].IsAutoSend == true)
                    {
                        SMSTemplate = EventTemplateList[i].Template.ToString();
                    }

                    //Add WhatsApp Alert while send Otp By Hemali for Mantis Id :0026446
                    if (EventTemplateList[i].AlertModeId == 4 && EventTemplateList[i].IsAutoSend == true)
                    {
                        WhatsAppTemplate = EventTemplateList[i].Template.ToString();
                    }
                }
            }

            if (string.IsNullOrEmpty(SMSTemplate))
                SMSTemplate = "The One Time Password  is [OTP].";
            if (string.IsNullOrEmpty(WhatsAppTemplate))
                WhatsAppTemplate = "The One Time Password  is [OTP].";

            OTPTextBox.Enabled = true;
            VerifyOTPButton.Enabled = true;
            AlertNotification objAlertNotification = new AlertNotification();

            Random r = new Random();
            string OTP = r.Next(1000, 9999).ToString();
            Session["otp"] = null;
            SMSHelper SMSHelperObject = new SMSHelper();
            DataTable dt = new DataTable();
            dt.Columns.Add("MobileNo");
            //dt.Columns.Add("EmailId");
            dt.Columns.Add("MsgText");
            dt.Columns.Add("Subject");
            dt.Columns.Add("ReceiverSourceTypeId");
            dt.Columns.Add("ReceiverSourceId");
            dt.Columns.Add("WhatsAppContactNo");
            DataRow dr = dt.NewRow();
            dr[0] = MobileNoTextBox.Text;
            //dr[1] = EmailIdTextBox.Text;
            dr[1] = SMSTemplate.Replace("[OTP]", OTP);
            dr[2] = "Online Student Registration";
            dr[3] = 0;
            dr[4] = 0;
            dr[5] = MobileNoTextBox.Text;
            dt.Rows.Add(dr);
            DataSet ds = new DataSet();
            ds.Tables.Add(dt);

            DataTable dt1 = dt.Clone();
            dt1.Rows.Add(new object[] { MobileNoTextBox.Text, WhatsAppTemplate.Replace("[OTP]", "" + OTP + ""), "", 0, 0, MobileNoTextBox.Text });
            DataSet DS = new DataSet();
            DS.Tables.Add(dt1);

            List<SMSConfiguration> objSMSConfigurationList = new List<SMSConfiguration>();
            SMSConfiguration SMSConfigurationListData = new SMSConfiguration();

            SMSConfigurationListData.OrgId = int.Parse(OrgDropDownList.SelectedValue);
            objSMSConfigurationList = SMSConfigurationServiceClient.GetSMSConfigurationList(SMSConfigurationListData);

            if (objSMSConfigurationList != null && objSMSConfigurationList.Count > 0)
            {
                StatusInfo StatusInfoData1 = objAlertNotification.SendSMS(ds, "Custom", 29, int.Parse(OrgDropDownList.SelectedValue), 0, OrgGroupId);
                Session["otp"] = OTP;
            }

            //Changes for Mantis Id : 0033634 By Hemali
            List<DataParameter> dp = new List<DataParameter>();
            DataParameter d = new DataParameter();
            d = new DataParameter { Name = "@rOrgId", Value = int.Parse(OrgDropDownList.SelectedValue), DataType = System.Data.DbType.Int32 };
            dp.Add(d);

            DataSet WhatsappDS = CommonFunctionsServiceClient.GetDatasetFromSp("[sAlert].[pWhatsAppConfigurationGet]", dp);
            if (WhatsappDS != null && WhatsappDS.Tables.Count > 0 && WhatsappDS.Tables[0].Rows.Count > 0)
            {
                StatusInfo StatusInfo = new StatusInfo();
                StatusInfo.StatusId = objAlertNotification.SendWhatsAppAlertWithoutTemplate(DS, "Custom", 29, int.Parse(OrgDropDownList.SelectedValue), 0, OrgGroupId, "");
                Session["otp"] = OTP;
            }

            if (Session["otp"] == null)
            {
                failurebdaymessage.Visible = true;
                BirthDateErrorLabel.Text = "Please Contact your School Administration";
                return;
            }
            if (Session["otp"] != null)
            {
                successmessageDiv.Visible = true;
                SuccessLabel.Text = "Your otp sent in your mobile";
            }
        }
    }
    protected void VerifyOTPButton_Click(object sender, EventArgs e)
    {
        successmessageDiv.Visible = false;
        SuccessLabel.Text = " ";
        if (OTPTextBox.Text == "")
        {
            failurebdaymessage.Visible = true;
            BirthDateErrorLabel.Text = "Enter OTP";
            failurebdaymessage.Focus();
            return;
        }
        if (Session["otp"] != null)
        {
            if (OTPTextBox.Text != Session["otp"].ToString())
            {
                failurebdaymessage.Visible = true;
                BirthDateErrorLabel.Text = "OTP not Match";
                failurebdaymessage.Focus();

                return;
            }
            else
            {
                failurebdaymessage.Visible = false;
                MobileNoDiv.Visible = false;
                OTPDiv1.Visible = false;
                OTPDiv2.Visible = false;
                OTPDiv3.Visible = false;

                //IdNoDiv.Visible = true;
                //DivisionDiv.Visible = true;
                //StatusDiv.Visible = true;
                //SurnameDiv.Visible = true;
                RegisterButton.Visible = true;
                CancelButton.Visible = true;
                StudentDetailDiv.Visible = true;
                GetDisplayField();
                OnlineRegistrationCriteriaFormGridViewDisplay();
                OrgDropDownList.Enabled = false;
                BatchDropDownList.Enabled = false;
                ClassIdDropDownList.Enabled = false;


                if (OptionalSubjectDiv.Visible)
                {
                    CommonFunctions cf = new CommonFunctions();
                    AssignOptionalSubjectCheckBoxList.Items.Clear();
                    AssignOptionalSubjectCheckBoxList.Items.Clear();
                    string AssignOptionalSubject = "SELECT CS.Id,SM.Title FROM [sStudent].[tOnlineRegistrationCriteriaOptionalSubject] COS INNER JOIN sSetup.tClassSubject CS ON COS.ClassSubjectId = CS.Id " +
                        " INNER JOIN sSetup.tSubjectMaster SM ON SM.Id = CS.SubjectId WHERE COS.ClassId = " + ClassIdDropDownList.SelectedValue + " AND COS.BatchId = " + BatchDropDownList.SelectedValue;

                    DataSet OptionalSubjectDS = cf.GetDataset(AssignOptionalSubject);
                    if (OptionalSubjectDS != null && OptionalSubjectDS.Tables.Count > 0 && OptionalSubjectDS.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < OptionalSubjectDS.Tables[0].Rows.Count; i++)
                            AssignOptionalSubjectCheckBoxList.Items.Add(new ListItem(OptionalSubjectDS.Tables[0].Rows[i]["Title"].ToString(), OptionalSubjectDS.Tables[0].Rows[i]["Id"].ToString()));
                    }
                }
                //NameDiv.Visible = true;
            }
        }
    }
    private bool ValidateForOTP()
    {
        if (MobileNoTextBox.Text == "")
        {
            failurebdaymessage.Visible = true;
            BirthDateErrorLabel.Text = "Enter Mobile No";
            failurebdaymessage.Focus();
            return false;
        }
        if (OrgDropDownList.SelectedIndex <= 0)
        {
            failurebdaymessage.Visible = true;
            BirthDateErrorLabel.Text = "Select School Name";
            failurebdaymessage.Focus();
            return false;
        }
        if (BatchDropDownList.SelectedIndex <= 0)
        {
            failurebdaymessage.Visible = true;
            BirthDateErrorLabel.Text = "Select Batch";
            failurebdaymessage.Focus();
            return false;
        }
        if (ClassIdDropDownList.SelectedIndex <= 0)
        {
            failurebdaymessage.Visible = true;
            BirthDateErrorLabel.Text = "Select Class";
            failurebdaymessage.Focus();
            return false;
        }
        return true;
    }
    private void SetScreenState(ScreenState currentScreenState)
    {
        switch (currentScreenState)
        {
            case ScreenState.New:

                ClearControls();
                //EnableDisableControls(true);
                //GetStudentMaxIdNumber();
                //if (IsActivateUniqueId == true)
                //    GetStudentMaxSUIdNumber();
                //NumberTextBox.Enabled = true;
                //FormNumberTextBox.Enabled = true;
                //GetStudentNameFormatId();
                //CodeFindTextBox.Enabled = true;
                break;

            case ScreenState.Edit:

                //EnableDisableControls(true);
                //CodeFindTextBox.Enabled = false;
                //DepartmentDropDownList.Enabled = false;
                //ClassIdDropDownList.Enabled = false;
                //DivisionIdDropDownList.Enabled = false;

                //if (StatusDropDownList.SelectedValue != "2")
                //{
                //    InactiveDateDatePickerControl.Enabled = false;
                //}

                //if (StatusDropDownList.SelectedValue != "3")
                //{
                //    LeftStandardIdDropDownList.Enabled = false;
                //    LeftDateDatePickerControl.Enabled = false;
                //}

                //EnablingDisablingControl.SetInputBoxEnable(RollNoTextBox, false);
                //if (Convert.ToBoolean((ConfigurationHelper.GetUserConfigurationValue("Student.IsEnableChangeLog"))) == true)
                //    DivForChangeLog.Visible = true;

                //base.EditButton.Enabled = false;
                //base.DeleteButton.Enabled = false;
                //base.DeclineButton.Enabled = false;

                //base.SaveButton.Enabled = AllowCreate;
                //Session["AllowCreate"] = AllowCreate;
                //NumberTextBox.Enabled = false;
                //FormNumberTextBox.Enabled = false;

                //HostelDropDownList.Enabled = false;
                //HostelRoomDropDownList.Enabled = false;
                //TransportDropDownList.Enabled = false;
                //BusRouteDropDownList.Enabled = false;
                //BusRouteDestinationDropDownList.Enabled = false;
                break;
            case ScreenState.ViewFromGrid:

                //EnableDisableControls(false);

                //base.SaveButton.Enabled = false;
                //base.EditButton.Enabled = AllowEdit;
                //base.DeleteButton.Enabled = AllowDelete;
                //base.DeclineButton.Enabled = AllowDelete;
                //EditButton.Focus();
                //NumberTextBox.Enabled = false;
                //FormNumberTextBox.Enabled = false;

                break;
            case ScreenState.ViewFromCode:

                //EnableDisableControls(false);

                //SaveButton.Enabled = false;
                //base.EditButton.Enabled = AllowEdit;
                //base.DeleteButton.Enabled = AllowDelete;
                //base.DeclineButton.Enabled = AllowDelete;
                //NumberTextBox.Enabled = false;
                //FormNumberTextBox.Enabled = false;
                break;
        }
    }
    private void ClearControls()
    {

        // Student Details
        IdNoTextBox.Text = string.Empty;
        //NameLabel.Text = string.Empty;

        //IdHiddenField.Value = string.Empty;
        //AcademicHiddenField.Value = string.Empty;
        //SUIdTextBox.Text = string.Empty;
        //CodeFindTextBox.Text = string.Empty;

        RegistrationNumberTextBox.Text = string.Empty;
        FirstNameTextBox.Text = string.Empty;
        MiddleNameTextBox.Text = string.Empty;
        SurnameTextBox.Text = string.Empty;
        //FirstNameTextBox1.Text = string.Empty;
        //MiddleNameTextBox1.Text = string.Empty;
        //LastNameTextBox1.Text = string.Empty;
        AdmissionStandardDropDownList.SelectedIndex = 0;
        AdmissionDateDatePickerControl.Text = string.Empty;
        PreviousResultTextBox.Text = string.Empty;
        ProofOfDOBTextBox.Text = string.Empty;
        PreviousLCNumberTextBox.Text = string.Empty;
        PreviousLCDateDatePickerControl.Text = string.Empty;

        if (FeesCategoryDropDownList.Items.Count > 1)

            FeesCategoryDropDownList.SelectedIndex = 1;
        else
            FeesCategoryDropDownList.SelectedIndex = 0;
        LeftDateDatePickerControl.Text = string.Empty;
        LeftStandardIdDropDownList.SelectedIndex = 0;
        if (StudentGroupDropDownList.Items.Count > 1)
            StudentGroupDropDownList.SelectedIndex = 0;
        if (StudentOtherGroupDropDownList.Items.Count > 1)
            StudentOtherGroupDropDownList.SelectedIndex = 0;

        InActiveDateDatePickerControl.Text = string.Empty;
        StatusDropDownList.SelectedIndex = 1;
        //ClassStatusDropDownList.SelectedIndex = 1;

        //if (Convert.ToBoolean(ConfigurationHelper.GetUserConfigurationValue("Student.IsNewAdmissionTempRegistration")) == true)
        RecordTagDropDownList.SelectedIndex = 2;
        //else
        //    RecordTagDropDownList.SelectedIndex = 1;

        ////if (AdmissionCategoryId > 0)
        ////    AdmissionCategoryDropDownList.SelectedValue = AdmissionCategoryId.ToString();
        ////else if (AdmissionCategoryDropDownList.Items.Count > 1)
        ////    AdmissionCategoryDropDownList.SelectedIndex = 1;

        //FeesCategoryDropDownList.SelectedIndex = 0;

        // ClassIdDropDownList.SelectedIndex = 0;
        DivisionIdDropDownList.SelectedIndex = 0;
        RollNoTextBox.Text = string.Empty;
        //StudentImage.ImageUrl = string.Empty;
        //SkipEventHiddenFiled.Value = string.Empty;
        //IsAdmissionCategoryChangeHiddenField.Value = null;

        //// Admission Details
        PreviousSchoolTextBox.Text = string.Empty;
        PreviousStandardTextBox.Text = "";
        PreviousStudentIdTextBox.Text = string.Empty;
        //AdmissionFormIdHiddenField.Value = null;
        AdmissionFormNumberTextBox.Text = string.Empty;
        if (AdmissionDateDefault == true)
            AdmissionDateDatePickerControl.Text = DateTime.Now.ToString();
        else
            AdmissionDateDatePickerControl.Text = string.Empty;
        AdmissionYearTextBox.Text = string.Empty;
        LeftDateDatePickerControl.Text = string.Empty;
        LeftYearTextBox.Text = string.Empty;
        LeftReasonTextBox.Text = string.Empty;
        InActiveDateDatePickerControl.Text = string.Empty;
        InActiveReasonTextBox.Text = string.Empty;
        LCProgressTextBox.Text = string.Empty;
        LCConductTextBox.Text = string.Empty;
        LCBookTextBox.Text = string.Empty;
        LCNumberTextBox.Text = string.Empty;
        LCDateDatePickerControl.Text = string.Empty;
        LCRemarkTextBox.Text = string.Empty;
        LcIdTextBox.Text = string.Empty;
        if (AdmissionQuotaDropDownList.Items.Count > 1)
            AdmissionQuotaDropDownList.SelectedIndex = 0;
        AdmissionNumberTextBox.Text = string.Empty;
        IsTransferCheckBox.Checked = false;
        TransferFromTextBox.Text = string.Empty;
        //PassingYearTextBox.Text = string.Empty;
        IsTFWSCheckBox.Checked = false;
        IsCertificateHolderCheckBox.Checked = false;
        CertificateNameTextBox.Text = string.Empty;
        if (MaritalStatusDropDownList.Items.Count > 1)
            MaritalStatusDropDownList.SelectedIndex = 0;

        // Demographic Details
        UIDNumberTextBox.Text = string.Empty;
        AadhaarNumberTextBox.Text = string.Empty;
        //DateOfBirthTextBox.Text = string.Empty;
        BirthdateinwordTextBox.Text = string.Empty;
        if (GenderDropDownList.Items.Count > 1)
            GenderDropDownList.SelectedIndex = 0;
        GenderTextBox.Text = string.Empty;
        GenderDropDownList.Visible = true;
        GenderTextBox.Visible = false;
        if (ReligionDropDownList.Items.Count > 1)
            ReligionDropDownList.SelectedIndex = 0;
        if (BloodGroupDropDownList.Items.Count > 1)
            BloodGroupDropDownList.SelectedIndex = 0;
        BirthPlaceTextBox.Text = string.Empty;
        BirthTalukaTextBox.Text = string.Empty;
        BirthDistrictTextBox.Text = string.Empty;
        FamilyCasteTextBox.Text = string.Empty;
        FamilySubCasteTextBox.Text = string.Empty;
        if (CasteCategoryDropDownList.Items.Count > 1)
            CasteCategoryDropDownList.SelectedIndex = 0;
        if (HouseDropDownList.Items.Count > 1)
            HouseDropDownList.SelectedIndex = 0;

        //   MotherTongueDropDownList.SelectedIndex = 0;
        if (NationalityDropDownList.Items.Count > 1)
            NationalityDropDownList.SelectedIndex = 0;
        ReferenceRemarkTextBox.Text = string.Empty;
        CustomTagCheckBox.Checked = false;
        CustomTagCheckBoxList.Items.Clear();
        if (QuotaDropDownList.Items.Count > 1)
        {
            QuotaDropDownList.SelectedIndex = 0;
        }
        MotherTongueDropDownList.SelectedIndex = 0;

        // Communication Detail
        ParentContactNoTextBox.Text = string.Empty;
        ParentEmailTextBox.Text = string.Empty;
        StudentContactNoTextBox.Text = string.Empty;
        StudentEmailTextBox.Text = string.Empty;
        DistanceFromSchoolTextBox.Text = string.Empty;
        LocalAddressAddress1TextBox.Text = string.Empty;
        LocalAddressAddress2TextBox.Text = string.Empty;
        LocalAddressAddress3TextBox.Text = string.Empty;
        LocalAddressCountryTextBox.Text = string.Empty;
        LocalAddressCountryTextBox.Text = string.Empty;
        LocalAddressStateTextBox.Text = string.Empty;
        LocalAddressStateTextBox.Text = string.Empty;
        LocalAddressStateTextBox.Text = string.Empty;
        LocalAddressStateTextBox.Text = string.Empty;
        LocalAddressPINCodeTextBox.Text = string.Empty;
        LocalAddressContactNoTextBox.Text = string.Empty;
        PermanentAddressAddress1TextBox.Text = string.Empty;
        PermanentAddressAddress2TextBox.Text = string.Empty;
        PermanentAddressAddress3TextBox.Text = string.Empty;
        PermanentAddressCountryTextBox.Text = string.Empty;
        PermanentAddressCountryTextBox.Text = string.Empty;
        PermanentAddressCityTextBox.Text = string.Empty;
        PermanentAddressCityTextBox.Text = string.Empty;
        PermanentAddressStateTextBox.Text = string.Empty;
        PermanentAddressStateTextBox.Text = string.Empty;
        PermanentAddressPINCodeTextBox.Text = string.Empty;
        PermanentAddressContactNoTextBox.Text = string.Empty;
        EmergencyAddressAddress1TextBox.Text = string.Empty;
        EmergencyAddressAddress2TextBox.Text = string.Empty;
        EmergencyAddressAddress3TextBox.Text = string.Empty;
        EmergencyAddressCountryTextBox.Text = string.Empty;
        EmergencyAddressCountryTextBox.Text = string.Empty;
        EmergencyAddressCityTextBox.Text = string.Empty;
        EmergencyAddressCityTextBox.Text = string.Empty;
        EmergencyAddressStateTextBox.Text = string.Empty;
        EmergencyAddressStateTextBox.Text = string.Empty;
        EmergencyAddressPINCodeTextBox.Text = string.Empty;
        EmergencyAddressContactNoTextBox.Text = string.Empty;
        WhatsAppContactNoTextBox.Text = string.Empty;

        // Family Details
        FamilyDetailFatherNameTextBox.Text = string.Empty;
        FatherDateofBirthDatePickerControl.Text = string.Empty;
        FatherOccupationTextBox.Text = string.Empty;
        FatherQualificationTextBox.Text = string.Empty;
        FatherContactNoTextBox.Text = string.Empty;
        FatherMailTextBox.Text = string.Empty;
        FatherOfficeAddressTextBox.Text = string.Empty;
        FatherOrganizationTextBox.Text = string.Empty;
        FatherDesignationTextBox.Text = string.Empty;
        FatherIncomeTextBox.Text = string.Empty;
        MotherNameTextBox.Text = string.Empty;
        MotherDateofBirthDatePickerControl.Text = string.Empty;
        MotherOccupationTextBox.Text = string.Empty;
        MotherQualificationTextBox.Text = string.Empty;
        MotherContactNoTextBox.Text = string.Empty;
        MotherMailTextBox.Text = string.Empty;
        MotherOfficeAddressTextBox.Text = string.Empty;
        MotherDesignationTextBox.Text = string.Empty;
        MotherOrganizationTextBox.Text = string.Empty;
        MotherIncomeTextBox.Text = string.Empty;
        RelationNameTextBox.Text = string.Empty;
        RelativeNameTextBox.Text = string.Empty;
        RelativeDateofBirthDatePickerControl.Text = string.Empty;
        RelativeOccupationTextBox.Text = string.Empty;
        RelativeQualificationTextBox.Text = string.Empty;
        RelativeContactNoTextBox.Text = string.Empty;
        RelativeMailTextBox.Text = string.Empty;
        RelativeOfficeAddressTextBox.Text = string.Empty;
        RelativeDesignationTextBox.Text = string.Empty;
        RelativeOrganizationTextBox.Text = string.Empty;
        RelativeIncomeTextBox.Text = string.Empty;
        MarriageAnniversaryDateDatePickerControl.Text = string.Empty;
        FatherAadharNoTextBox.Text = string.Empty;
        MotherAadharNoTextBox.Text = string.Empty;
        FatherOfficeContactNoTextBox.Text = string.Empty;
        MotherOfficeContactNoTextBox.Text = string.Empty;

        // Health Details

        IsSingleChildCheckBox.Checked = false;
        // Bank Deatil 
        BankAccountNumberTextBox.Text = string.Empty;
        BankNameTextBox.Text = string.Empty;
        BankBranchTextBox.Text = string.Empty;
        BankIFSCCodeTextBox.Text = string.Empty;
        BankAccountHolderNameTextBox.Text = string.Empty;

        //Board Deatil
        Class9BoardRegistrationNumberTextBox.Text = string.Empty;
        Class11BoardRegistrationNumberTextBox.Text = string.Empty;

        //Passport Deatil
        PassportNumberTextBox.Text = string.Empty;
        PassportTypeTextBox.Text = string.Empty;
        PassportCountryCodeTextBox.Text = string.Empty;
        PassportIssueDateDatePickerControl.Text = string.Empty;
        PassportIssueDateDatePickerControl.Text = string.Empty;


        SSCBoardTextBox.Text = string.Empty;
        SSCSchoolTextBox.Text = string.Empty;

        SSCPassingYearTextBox.Text = string.Empty;


        SSCObtainMarksTextBox.Text = string.Empty;



        SSCOutOfMarksTextBox.Text = string.Empty;

        SSCPercentageTextBox.Text = string.Empty;

        SSCMathMarksTextBox.Text = string.Empty;
        SSCMathOutOfMarksTextBox.Text = string.Empty;

        SSCPercentileTextBox.Text = string.Empty;

        SSCGradeTextBox.Text = string.Empty;

        HSCBoardTextBox.Text = string.Empty;

        HSCSchoolTextBox.Text = string.Empty;
        HSCPassingYearTextBox.Text = string.Empty;
        HSCObtainMarksTextBox.Text = string.Empty;
        HSCOutOfMarksTextBox.Text = string.Empty;
        HSCPercentageTextBox.Text = string.Empty;
        HSCPhysicsMarksTextBox.Text = string.Empty;
        HSCPhysicsOutOfMarksTextBox.Text = string.Empty;
        HSCChemistryMarksTextBox.Text = string.Empty;
        HSCChemistryOutOfMarksTextBox.Text = string.Empty;
        HSCMathMarksTextBox.Text = string.Empty;
        HSCMathOutOfMarksTextBox.Text = string.Empty;
        HSCBiologyMarksTextBox.Text = string.Empty;
        HSCBiologyOutOfMarksTextBox.Text = string.Empty;
        PCMMarksTextBox.Text = string.Empty;


        PCBMarksTextBox.Text = string.Empty;
        JEERollNoTextBox.Text = string.Empty;
        JEEMeritNoTextBox.Text = string.Empty;
        JEEMeritMarksTextBox.Text = string.Empty;
        JEEOutOfMarksTextBox.Text = string.Empty;
        DiplomaBoardTextBox.Text = string.Empty;
        DiplomaCollegeTextBox.Text = string.Empty;
        DiplomaPassingYearTextBox.Text = string.Empty;
        DiplomaObtainMarksTextBox.Text = string.Empty;
        DiplomaOutOfMarksTextBox.Text = string.Empty;
        DiplomaPercentageTextBox.Text = string.Empty;
        ApplicationIdTextBox.Text = string.Empty;
        AdmissionRoundTextBox.Text = string.Empty;



        //OPTIONAL SUBJECT  
        //SubjectCheckBoxList.SelectedIndex = 0;
        SubjectCheckBoxList.Items.Clear();
        AddOptionSubjectLinkButton.Checked = false;
        DivClassCheckBoxList.Visible = false;
        FatherPassOutYearTextBox.Text = string.Empty;
        MotherPassOutYearTextBox.Text = string.Empty;
        RelativePassOutYearTextBox.Text = string.Empty;
        RelativeIncomeTextBox.Text = string.Empty;
        ISFatherExStudentCheckBox.Checked = false;
        ISMotherExStudentCheckBox.Checked = false;
        ISRelativeExStudentCheckBox.Checked = false;
        BlockAllAlertCheckBox.Checked = false;

        AssignOptionalSubjectCheckBoxList.Items.Clear();
        OptionalSubjectDiv.Visible = false;
        // StudentCriteriaFormGridView.Enabled = true;

        //if (StudentManagementSession.StudentData == null)
        //{
        //    GetStudentCriteriaFormDetails(1, 0);
        //}
        //else
        //{
        //    GetStudentCriteriaFormDetails(1, StudentManagementSession.StudentData.Id);
        //}

        //IsChangeRemark = true; //added by Devisharan 23.08.2019
    }
    private void LoadDropdowns()
    {
        string SQL_String = "SELECT Distinct Id,DisplayTitle FROM sSetup.tOrganizationMaster where OrgGroupId =  " + OrgGroupId + "AND IsObsolete = 0";
        ControllHelperObject.LoadDropDownList(OrgDropDownList, SQL_String, "Id", "DisplayTitle", false);

        ListItem li = new ListItem("-Select-", "-1");

        BatchDropDownList.Items.Clear();
        BatchDropDownList.Items.Insert(0, li);

        ClassIdDropDownList.Items.Clear();
        ClassIdDropDownList.Items.Insert(0, li);

        RegisterButton.Visible = false;
        CancelButton.Visible = false;
    }
    private void LoadDropdownList()
    {
        StaticDataHelper StaticDataHelperObject = new StaticDataHelper();
        StaticDataHelperObject.FillStudentStatusDropDownList(StatusDropDownList, false);
        //StaticDataHelperObject.FillStudentStatusDropDownList(ClassStatusDropDownList, false);

        ListItem li = new ListItem("-Select-", "-1");

        DivisionIdDropDownList.Items.Clear();
        DivisionIdDropDownList.Items.Insert(0, li);
        string SQL_String = string.Empty;
        SQL_String = string.Empty;
        SQL_String = "SELECT Id, Title FROM sSetup.tDepartmentMaster WHERE IsObsolete = 0  AND OrgId=" + OrgDropDownList.SelectedValue + " ORDER BY Title";
        ControllHelperObject.LoadDropDownList(DepartmentDropDownList, SQL_String, "Id", "Title", false);


        StatusDropDownList.SelectedIndex = 1;

        RecordTagDropDownList.Items.Clear();
        RecordTagDropDownList.Items.Insert(0, li);
        SQL_String = "SELECT Id,Title FROM sCommon.tStatusMaster WHERE IsObsolete = 0  AND StatusTypeId=102 ";
        ControllHelperObject.LoadDropDownList(RecordTagDropDownList, SQL_String, "Id", "Title", false);
        RecordTagDropDownList.SelectedIndex = 1;

        SQL_String = "SELECT Id,Title FROM sSetup.tDivisionMaster WHERE IsObsolete = 0 AND ClassId=" + ClassIdDropDownList.SelectedValue + "order by OrderIndex";
        ControllHelperObject.LoadDropDownList(DivisionIdDropDownList, SQL_String, "Id", "Title", false);

        FeesCategoryDropDownList.SelectedIndex = -1;
        SQL_String = "SELECT Id,Title FROM sStudent.tAdmissionCategoryMaster WHERE IsObsolete = 0 AND OrgGroupId= " + OrgGroupId;
        ControllHelperObject.LoadDropDownList(FeesCategoryDropDownList, SQL_String, "Id", "Title", false);
        FeesCategoryDropDownList.SelectedIndex = 1;

        SQL_String = "SELECT Id,Title FROM sSetup.tClassMaster WHERE IsObsolete = 0 AND OrgId= " + OrgDropDownList.SelectedValue + " ORDER BY OrderIndex";
        ControllHelperObject.LoadDropDownList(AdmissionStandardDropDownList, SQL_String, "Id", "Title", false);

        SQL_String = "SELECT Id,Title FROM sStudent.tStudentOtherGroupMaster WHERE IsObsolete = 0 AND OrgGroupId= " + OrgGroupId;
        ControllHelperObject.LoadDropDownList(StudentOtherGroupDropDownList, SQL_String, "Id", "Title", false);

        StudentGroupDropDownList.Items.Clear();
        StudentGroupDropDownList.Items.Insert(0, li);
        SQL_String = "SELECT Id,Title FROM sStudent.tStudentGroupMaster WHERE IsObsolete = 0 AND OrgGroupId= " + OrgGroupId;
        ControllHelperObject.LoadDropDownList(StudentGroupDropDownList, SQL_String, "Id", "Title", false);

        SQL_String = "SELECT Id,Title FROM sCommon.tAdmissionQuotaMaster WHERE IsObsolete = 0 AND OrgGroupId=" + OrgGroupId;
        ControllHelperObject.LoadDropDownList(AdmissionQuotaDropDownList, SQL_String, "Id", "Title", false);

        //LCCopyText.Enabled = false;
        SQL_String = "SELECT Id,Title FROM sCommon.tMaritalStatusMaster WHERE IsObsolete = 0 ";
        ControllHelperObject.LoadDropDownList(MaritalStatusDropDownList, SQL_String, "Id", "Title", false);

        //SQL_String = "SELECT Id,Title FROM sCommon.tGenderMaster WHERE IsObsolete = 0";
        //ControllHelperObject.LoadDropDownList(GenderDropDownList, SQL_String, "Id", "Title", false);
        if (OrgDropDownList.SelectedIndex > 0)
        {
            ControllHelperObject.LoadDropDownListForGender(GenderDropDownList, Convert.ToInt32(Session["OnlineOrgGroupId"].ToString()), Convert.ToInt32(OrgDropDownList.SelectedValue), false);
        }
        else
        {
            GenderDropDownList.Items.Clear();
            GenderDropDownList.Items.Insert(0, li);
        }

        SQL_String = "SELECT Id,Title FROM sCommon.tReligionMaster WHERE IsObsolete = 0 AND OrgGroupId=" + OrgGroupId;
        ControllHelperObject.LoadDropDownList(ReligionDropDownList, SQL_String, "Id", "Title", false);

        SQL_String = "SELECT Id,Title FROM sCommon.tBloodGroupMaster WHERE IsObsolete = 0";
        ControllHelperObject.LoadDropDownList(BloodGroupDropDownList, SQL_String, "Id", "Title", false);

        SQL_String = "SELECT Id,Title FROM sCommon.tMotherTongueMaster WHERE IsObsolete = 0 AND OrgGroupId=" + OrgGroupId;
        ControllHelperObject.LoadDropDownList(MotherTongueDropDownList, SQL_String, "Id", "Title", false);

        PreviousSchoolTypeDropDownList.Items.Clear();
        PreviousSchoolTypeDropDownList.Items.Insert(0, li);
        SQL_String = "SELECT Id,Title FROM sCommon.tPreviousSchoolMaster WHERE IsObsolete = 0 AND OrgGroupId=" + OrgGroupId;
        ControllHelperObject.LoadDropDownList(PreviousSchoolTypeDropDownList, SQL_String, "Id", "Title", false);

        SQL_String = "SELECT Id,Title FROM sCommon.tCastCategoryMaster WHERE IsObsolete = 0 AND OrgGroupId =" + OrgGroupId + " ORDER BY OrderIndex";
        ControllHelperObject.LoadDropDownList(CasteCategoryDropDownList, SQL_String, "Id", "Title", false);

        HouseDropDownList.Items.Clear();
        HouseDropDownList.Items.Insert(0, li);
        SQL_String = "SELECT Id,Title FROM sActivity.tHouseMaster WHERE IsObsolete = 0 AND OrgId=" + OrgDropDownList.SelectedValue;
        ControllHelperObject.LoadDropDownList(HouseDropDownList, SQL_String, "Id", "Title", false);

        SQL_String = "SELECT Id,Nationality FROM sCommon.tCountryMaster WHERE IsObsolete = 0 AND OrgGroupId=" + OrgGroupId;
        ControllHelperObject.LoadDropDownList(NationalityDropDownList, SQL_String, "Id", "Nationality", false);

        SQL_String = "Select Id,Title FROM sCommon.tQuotaMaster WHERE IsObsolete = 0 AND OrgGroupId=" + OrgGroupId + " Order By Id";
        ControllHelperObject.LoadDropDownList(QuotaDropDownList, SQL_String, "Id", "Title", false);

        SQL_String = string.Empty;
        SQL_String = "Select Id,Title FROM sCommon.tTransportModeMaster WHERE IsObsolete = 0 Order By ID";
        ControllHelperObject.LoadDropDownList(TransportDropDownList, SQL_String, "Id", "Title", false);
        TransportDropDownList.SelectedIndex = -1;

        SQL_String = "SELECT Id,Title FROM sCommon.tLiveWithMaster WHERE IsObsolete = 0 ";
        ControllHelperObject.LoadDropDownList(LiveWithDropDownList, SQL_String, "Id", "Title", false);
        SQL_String = "SELECT Id,Title FROM sSetup.tClassMaster WHERE IsObsolete = 0 AND OrgId= " + OrgDropDownList.SelectedValue + " ORDER BY OrderIndex";
        ControllHelperObject.LoadDropDownList(LeftStandardIdDropDownList, SQL_String, "Id", "Title", false);
        // Addded By Dhananjay for Mantis Start- 0033982  
        SQL_String = string.Empty;
        SQL_String = "SELECT Id,Title FROM sCommon.tPhysicalDisabilityCategoryMaster WHERE IsObsolete = 0 AND OrgGroupId =" + OrgGroupId + " ORDER BY Id";
        ControllHelperObject.LoadDropDownList(PhysicalDropDownList, SQL_String, "Id", "Title", false);
        // Addded By Dhananjay for Mantis Start- 0033982  


        //if (StatusDropDownList.SelectedIndex > 0)
        //{
        //    if (StatusDropDownList.SelectedValue == "1")
        //    {
        //        InActiveDateDatePickerControl.Text = string.Empty;
        //        InActiveDateDatePickerControl.Enabled = false;
        //        LeftStandardIdDropDownList.SelectedIndex = 0;
        //        LeftStandardIdDropDownList.Enabled = false;
        //        LeftDateDatePickerControl.Text = string.Empty;
        //        LeftDateDatePickerControl.Enabled = false;
        //        InActiveReasonTextBox.Enabled = false;
        //        LCBookTextBox.Enabled = false;
        //        LCNumberTextBox.Enabled = false;
        //        LeftReasonTextBox.Enabled = false;
        //        LCProgressTextBox.Enabled = false;
        //        LCConductTextBox.Enabled = false;
        //        LCRemarkTextBox.Enabled = false;
        //        //EnablingDisablingControl.SetInputBoxEnable(InActiveReasonTextBox, false);
        //        //EnablingDisablingControl.SetInputBoxEnable(LCBookTextBox, false);
        //        //EnablingDisablingControl.SetInputBoxEnable(LCNumberTextBox, false);
        //        LCDateDatePickerControl.Enabled = false;
        //        //LCCopyText.Enabled = false;

        //        //EnablingDisablingControl.SetInputBoxEnable(LeftReasonTextBox, false);
        //        //EnablingDisablingControl.SetInputBoxEnable(LCProgressTextBox, false);
        //        //EnablingDisablingControl.SetInputBoxEnable(LCConductTextBox, false);
        //        //EnablingDisablingControl.SetInputBoxEnable(LCRemarkTextBox, false);
        //    }
        //}

    }
    private void OnlineRegistrationCriteriaFormGridViewDisplay()
    {
        string SQLString = "SELECT Id, FieldRemark,FieldTypeId,FieldList,IsFieldMandatory,FieldGroup,FieldOrder,ISNULL(FieldData,'') AS OnlineRegistrationFormFieldResponse " +
                                                "FROM [sStudent].[tOnlineRegistrationCriteriaForm] ORC LEFT JOIN [sStudent].[tOnlineRegistrationStudentCustomFieldData] ORSC ON ORC.Id= ORSC.StudentCustomFieldId  AND ORSC.StudentId=" + StudentId +
                                                " WHERE ClassId =" + ClassIdDropDownList.SelectedValue + " AND BatchId = " + BatchDropDownList.SelectedValue + " ORDER BY FieldOrder";
        DataSet DS = new DataSet();
        CommonFunctions CF = new CommonFunctions();
        DS = CF.GetDataset(SQLString);
        if (DS != null && DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
        {
            OnlineRegistrationCriteriaFormDiv.Visible = true;
            OnlineRegistrationCriteriaFormGridView.DataSource = DS;
            OnlineRegistrationCriteriaFormGridView.DataBind();
            MergeRows(OnlineRegistrationCriteriaFormGridView);

        }
        else
        {
            OnlineRegistrationCriteriaFormGridView.DataSource = null;
            OnlineRegistrationCriteriaFormGridView.DataBind();
            OnlineRegistrationCriteriaFormDiv.Visible = false;
        }
    }
    protected void ClassIdDropDownList_SelectedIndexChanged(object sender, EventArgs e)
    {
        //GetDisplayField();

        if (ClassIdDropDownList.SelectedIndex > 0)
        {
            DivisionIdDropDownList.SelectedIndex = -1;
            int ClassId = int.Parse(ClassIdDropDownList.SelectedValue.ToString());
            string SQL_String = "SELECT Id,Title FROM sSetup.tDivisionMaster WHERE IsObsolete = 0 AND ClassId=" + ClassIdDropDownList.SelectedValue + "order by OrderIndex";
            ControllHelperObject.LoadDropDownList(DivisionIdDropDownList, SQL_String, "Id", "Title", false);

            if (DivisionIdDropDownList.Items.Count == 2)
                DivisionIdDropDownList.SelectedIndex = 1;
            else
                DivisionIdDropDownList.SelectedIndex = 0;

            ClassIdDropDownList.Focus();
        }


        else
        {
            DivisionIdDropDownList.Items.Clear();
            DivisionIdDropDownList.Items.Insert(0, "- Select -");

        }


    }
    protected void BatchDropDownList_OnSelectedIndexChanged(object sender, EventArgs e)
    {
        if (BatchDropDownList.SelectedIndex > 0)
        {
            string SQL_String = "SELECT ClassId,ClassName FROM sSetup.vBatchClass WHERE IsObsolete = 0 AND BatchId= " + BatchDropDownList.SelectedValue + "  ORDER BY OrderIndex";
            ControllHelperObject.LoadDropDownList(ClassIdDropDownList, SQL_String, "ClassId", "ClassName", false);

            BatchDropDownList.Focus();
        }
        else
        {
            ClassIdDropDownList.Items.Clear();
            ClassIdDropDownList.Items.Insert(0, "- Select -");
        }
    }
    protected void OnlineRegistrationCriteriaFormGridView_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        try
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                DropDownList FieldTypeDropDownList = (DropDownList)e.Row.FindControl("FieldTypeDropDownList");
                TextBox FieldTypeTextBox = (TextBox)e.Row.FindControl("FieldTypeTextBox");

                int FieldTypeId = Convert.ToInt32(OnlineRegistrationCriteriaFormGridView.DataKeys[e.Row.RowIndex].Values[1]);
                string FieldList = OnlineRegistrationCriteriaFormGridView.DataKeys[e.Row.RowIndex].Values[2].ToString();
                string AdmissionFormFieldResponse = OnlineRegistrationCriteriaFormGridView.DataKeys[e.Row.RowIndex].Values[4].ToString();

                if (FieldTypeId == 1 || FieldTypeId == 2)
                {
                    FieldTypeDropDownList.Visible = true;
                    FieldTypeDropDownList.Items.Clear();
                    FieldTypeDropDownList.Items.Add(new ListItem("- Select -", "0"));

                    if (FieldTypeId == 1)
                    {
                        FieldTypeDropDownList.Items.Add(new ListItem("Yes", "1"));
                        FieldTypeDropDownList.Items.Add(new ListItem("No", "2"));
                    }

                    else if (FieldTypeId == 2)
                    {
                        string[] strArray = FieldList.Split(',');

                        for (int i = 0; i < strArray.Length; i++)
                        {
                            FieldTypeDropDownList.Items.Add(new ListItem(strArray[i].ToString(), (i + 1).ToString()));
                        }
                    }

                    if (!string.IsNullOrEmpty(AdmissionFormFieldResponse))
                        FieldTypeDropDownList.SelectedIndex = FieldTypeDropDownList.Items.IndexOf(FieldTypeDropDownList.Items.FindByText(AdmissionFormFieldResponse));

                }
                else
                {
                    if (FieldTypeId == 3)
                    {
                        FieldTypeTextBox.Visible = true;
                        FieldTypeTextBox.Text = AdmissionFormFieldResponse;
                        FieldTypeTextBox.TextMode = TextBoxMode.MultiLine;
                    }
                    if (FieldTypeId == 4)
                    {
                        FieldTypeTextBox.Visible = true;
                        FieldTypeTextBox.Text = AdmissionFormFieldResponse;
                        FieldTypeTextBox.Attributes.Add("onkeypress", "return isNumberKey(event)");
                        //FieldTypeTextBox.TextMode = TextBoxMode.Number;
                    }
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
    private void MergeRows(GridView gridView)
    {
        for (int rowIndex = gridView.Rows.Count - 2; rowIndex >= 0; rowIndex--)
        {
            GridViewRow row = gridView.Rows[rowIndex];
            GridViewRow previousRow = gridView.Rows[rowIndex + 1];

            for (int i = 0; i < row.Cells.Count; i++)
            {
                if (row.Cells[0].Text == previousRow.Cells[0].Text)
                {
                    row.Cells[0].RowSpan = previousRow.Cells[0].RowSpan < 2 ? 2 : previousRow.Cells[0].RowSpan + 1;
                    previousRow.Cells[0].Visible = false;
                }
            }
        }
    }

    //protected void StatusDropDownList_SelectedIndexChanged(object sender, EventArgs e)
    //{
    //    if (StatusDropDownList.SelectedIndex == 0)
    //    {
    //        LeftStandardlbl.Visible = false;
    //        LeftDatedlbl.Visible = false;
    //    }
    //    if (StatusDropDownList.SelectedIndex > 0)
    //    {
    //        if (StatusDropDownList.SelectedValue == "1")
    //        {
    //            InActiveDateDatePickerControl.Text = string.Empty;
    //            InActiveDateDatePickerControl.Enabled = false;
    //            LeftStandardIdDropDownList.SelectedIndex = 0;
    //            LeftStandardIdDropDownList.Enabled = false;
    //            LeftDateDatePickerControl.Text = string.Empty;
    //            LeftDateDatePickerControl.Enabled = false;
    //            LCDateDatePickerControl.Enabled = false;
    //            LCCopyText.Enabled = false;
    //            LcIdTextBox.Enabled = false;
    //            InActiveReasonTextBox.Enabled = false;

    //            LCBookTextBox.Enabled = false;

    //            LCNumberTextBox.Enabled = false;

    //            LeftReasonTextBox.Enabled = false;

    //            LCProgressTextBox.Enabled = false;

    //            LCConductTextBox.Enabled = false;

    //            LCRemarkTextBox.Enabled = false;
    //            LeftYearTextBox.Enabled = false;
    //        }
    //        else if (StatusDropDownList.SelectedValue == "2")
    //        {
    //            LeftStandardlbl.Visible = false;
    //            LeftDatedlbl.Visible = false;
    //            InActiveDateDatePickerControl.Enabled = true;
    //            LeftStandardIdDropDownList.SelectedIndex = 0;
    //            LeftStandardIdDropDownList.Enabled = false;
    //            LeftDateDatePickerControl.Text = string.Empty;
    //            LeftDateDatePickerControl.Enabled = false;
    //            LeftYearTextBox.Enabled = false;
    //            InActiveReasonTextBox.Enabled = true;
    //           // InActiveReasonTextBox.ReadOnly = false;
    //            LCBookTextBox.Enabled = false;

    //            LCNumberTextBox.Enabled = false;

    //            LeftReasonTextBox.Enabled = false;

    //            LCProgressTextBox.Enabled = false;

    //            LCConductTextBox.Enabled = false;

    //            LCRemarkTextBox.Enabled = false;

    //            LCCopyText.Enabled = false;
    //            LcIdTextBox.Enabled = false;

    //            StatusDropDownList.Focus();
    //        }
    //        else if (StatusDropDownList.SelectedValue == "3")
    //        {
    //            LeftStandardlbl.Visible = true;
    //            LeftDatedlbl.Visible = true;
    //            InActiveDateDatePickerControl.Enabled = true;

    //            LeftStandardIdDropDownList.Enabled = true;
    //            LeftDateDatePickerControl.Enabled = true;
    //            LeftYearTextBox.Enabled = true;
    //            InActiveReasonTextBox.Enabled = true;
    //           // InActiveReasonTextBox.ReadOnly = true;
    //            LCBookTextBox.Enabled = true;
    //           // LCBookTextBox.ReadOnly = false;
    //            LCNumberTextBox.Enabled = true;
    //           // LCNumberTextBox.ReadOnly = false;
    //            LeftReasonTextBox.Enabled = true;
    //           // LeftReasonTextBox.ReadOnly = false;
    //            LCProgressTextBox.Enabled = true;
    //           // LCProgressTextBox.ReadOnly = false;
    //            LCConductTextBox.Enabled = true;
    //            //LCConductTextBox.ReadOnly = false;
    //            LCRemarkTextBox.Enabled = true;
    //           // LCRemarkTextBox.ReadOnly = false;
    //            LCCopyText.Enabled = true;
    //            LcIdTextBox.Enabled = true;
    //            LCDateDatePickerControl.Enabled = true;
    //            InActiveDateDatePickerControl.Enabled = false;
    //            StatusDropDownList.Focus();
    //        }
    //        InActiveReasonTextBox.CssClass = "form-control";
    //        LCBookTextBox.CssClass = "form-control";
    //        LCNumberTextBox.CssClass = "form-control";
    //        LCConductTextBox.CssClass = "form-control";
    //        LeftReasonTextBox.CssClass = "form-control";
    //        LCProgressTextBox.CssClass = "form-control";
    //        LCRemarkTextBox.CssClass = "form-control";
    //    }
    //}

    protected void IsTransferCheckBox_CheckedChanged(object sender, EventArgs e)
    {
        try
        {
            if (IsTransferCheckBox.Checked)
            {
                TransferFromTextBox.Enabled = true;
            }
            else
            {
                TransferFromTextBox.Enabled = false;
            }
        }

        catch (Exception ex)
        {
            throw ex;
        }
    }
}