var URL = window.location.href;
function isValidDate2(inputText) {
    if (inputText.value != '') {
        var dateformat = /^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/;
        if (inputText.value.match(dateformat)) {
            var opera1 = inputText.value.split('/');
            var opera2 = inputText.value.split('-');
            lopera1 = opera1.length;
            lopera2 = opera2.length;
            if (lopera1 > 1) {
                var pdate = inputText.value.split('/');
            }
            else if (lopera2 > 1) {
                var pdate = inputText.value.split('-');
            }
            var dd = parseInt(pdate[0]);
            var mm = parseInt(pdate[1]);
            var yy = parseInt(pdate[2]);
            if (yy <= 1752) {
                alert('Invalid date!');
                inputText.value = '';
                return false;
            }
            var ListofDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
            if (mm == 1 || mm > 2) {
                if (dd > ListofDays[mm - 1]) {
                    alert('Invalid date!');
                    inputText.value = '';
                    return false;
                }
            }
            if (mm == 2) {

                var lyear = false;
                if ((!(yy % 4) && yy % 100) || !(yy % 400)) {
                    lyear = true;
                }
                if ((lyear == false) && (dd >= 29)) {
                    alert('Invalid date!');
                    inputText.value = '';
                    return false;
                }
                if ((lyear == true) && (dd > 29)) {
                    alert('Invalid date!');
                    inputText.value = '';
                    return false;
                }
            }
        }
        else {
            alert('Invalid date!');
            inputText.value = '';
            return false;
        }
    }
}

function FormatIt(obj) {
    if (obj.value.length == 2) // Day
        obj.value = obj.value + "/";
    if (obj.value.length == 5) // month
        obj.value = obj.value + "/";
}
function LoadingMessage(msg1, msg2) {
    $('#dvLoadingmsg').show();
    $('#spn1msg').html(msg1);
    $('#spn2msg').html(msg2);
    $('.hls-bg').show();
}
function CloseHlsPopup() {
    $('.hls-bg').hide();
    $('.hls-wrap').hide();
    $('.hls-wrap1').hide();
}
function OpenProductTab(_this, tab) {
    $('a[group=ProductTab]').each(function () {
        $(this).removeClass('active');
    });
    $(_this).addClass('active');
    $('div[group=ProudctTabDiv]').each(function () {
        $(this).css('display', 'none');
    });
    $('#div' + tab + 'Tab').css('display', '');
}

function BindDropDowns() {
    $.ajax({
        type: "POST",
        url: URL + "/GetSession",
        data: '{}',
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function (dt) {
            if (dt.d > 0) {
                $.ajax({
                    type: "POST",
                    url: URL + "/BindDropDowns",
                    data: '{}',
                    contentType: "application/json;charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        //  debugger;
                        var dt = $.parseJSON(data.d);
                        $('#drpGroupBatch').html(dt.OrgGroupRes);
                        $('#drpOrganization').html(dt.OrganizationRes);
                        $('#drpBatch').html(dt.BatchRes);
                        $('#drpDepartment').html(dt.DepartmentRes);
                        $('#drpClass').html(dt.ClassRes);
                        $('#drpStudentBatchStatus').html(dt.EnrollStatusRes);
                        $('#drpStudentNotAssigned').html(dt.StudentNotAssigned);
                        //$('#ddlMonth').html(dt.DateOfMonth);
                        $('#drpStatus').html(dt.StatusRes);
                        $('#drpDivision').html(dt.DivisionRes);
                        $('#drpAvailableFields').html(dt.AvailableRes + dt.AvailableStudentCustomRes);
                        $('#drpAvailableFieldsO').html(dt.AvailableRes + dt.AvailableStudentCustomRes);
                        //$('#classchkdropdown').html(dt.classChechboxlist);

                        $('#Statuschkdropdown').html(dt.statusChechboxlist);
                        $('#Genderchkdropdown').html(dt.Gendercheckboxlist);
                        $('#Religionchkdropdown').html(dt.Religionchklist);
                        $('#castecategorychkdropdown').html(dt.castcategorychklist);
                        //$('#citychkdropdown').html(dt.Citychklist);
                        //$('#Areachkdropdown').html(dt.Areachklist);
                        $('#nationalitychkdropdown').html(dt.Nationalitychklist);
                        $('#transportmodechkdropdown').html(dt.Transportmodechklist);
                        $('#Busroutechkdropdown').html(dt.busroutechklist);
                        $('#Routedestinationchkdropdown').html(dt.Busroutedestinationchklist);
                        $('#bloodgroupchkdropdown').html(dt.bloodgrpchklist);
                        //$('#HOusechkdropdown').html(dt.Housechklist);
                        $('#mothertoungechkdropdown').html(dt.Mothertoungechklist);
                        $('#Priviosschoolchkdropdown').html(dt.priviousschoolchklist);
                        //$('#Fatherqulificationchkdropdown').html(dt.fatherqachklist);
                        //$('#Motherqulificationchkdropdown').html(dt.motherqachklist);
                        //$('#FatherOccupationchkdropdown').html(dt.fatherocuupationchklist);
                        //$('#MotherOccupationchkdropdown').html(dt.motherocuupationchklist);
                        $('#Feescatrefgorychkdropdown').html(dt.feescategorychklist);
                        $('#customtagchkdropdown').html(dt.customtaghklist);
                        $('#Customgroupchkdropdown').html(dt.customgroupchklist);
                        $('#Clubchkdropdown').html(dt.clubchklist);
                        $('#Hostelchkdropdown').html(dt.Hostelchklist);
                        $('#Studentgroupchkdropdown').html(dt.studentgroupchklist);
                        $('#studentothergroupchkdropdown').html(dt.studentothergroupchklist);
                        $('#excemptiontypechkdropdown').html(dt.ExaminationTypechklist);
                        $('#drpSavedReport').html(dt.SavedReportList);
                        $('#recordtagchkdropdown').html(dt.recordtaghklist);


                        //$("#classchkdropdown").multiSelect();
                        $("#Statuschkdropdown").multiSelect();
                        $("#Genderchkdropdown").multiSelect();
                        $("#Religionchkdropdown").multiSelect();
                        $("#castecategorychkdropdown").multiSelect();
                        //$("#citychkdropdown").multiSelect();
                        //$("#Areachkdropdown").multiSelect();
                        $("#nationalitychkdropdown").multiSelect();
                        $("#transportmodechkdropdown").multiSelect();
                        $("#Busroutechkdropdown").multiSelect();
                        $("#Routedestinationchkdropdown").multiSelect();
                        $("#bloodgroupchkdropdown").multiSelect();
                        //$("#HOusechkdropdown").multiSelect();
                        $("#mothertoungechkdropdown").multiSelect();
                        $("#Priviosschoolchkdropdown").multiSelect();
                        //$("#Fatherqulificationchkdropdown").multiSelect();
                        //$("#Motherqulificationchkdropdown").multiSelect();
                        //$("#FatherOccupationchkdropdown").multiSelect();
                        //$("#MotherOccupationchkdropdown").multiSelect();
                        $("#Feescatrefgorychkdropdown").multiSelect();
                        $("#customtagchkdropdown").multiSelect();
                        $("#Customgroupchkdropdown").multiSelect();
                        $("#Clubchkdropdown").multiSelect();
                        $("#Hostelchkdropdown").multiSelect();
                        $("#Studentgroupchkdropdown").multiSelect();
                        $("#studentothergroupchkdropdown").multiSelect();
                        $("#excemptiontypechkdropdown").multiSelect();
                        $("#recordtagchkdropdown").multiSelect();
                        //$("#drpSavedReport").multiSelect();
                        // $(".StudentCustom").text($(".StudentCustom").text().replace("|", "[").replace("||", "]"));

                        $("#classchkdropdown").removeAttr("multiple");
                        $("#citychkdropdown").removeAttr("multiple");
                        $("#Areachkdropdown").removeAttr("multiple");
                        $("#Fatherqulificationchkdropdown").removeAttr("multiple");
                        $("#Motherqulificationchkdropdown").removeAttr("multiple");
                        $("#FatherOccupationchkdropdown").removeAttr("multiple");
                        $("#MotherOccupationchkdropdown").removeAttr("multiple");
                        $("#HOusechkdropdown").removeAttr("multiple");

                        $('#drpAvailableFields option').each(function (i, selected) {
                            //debugger;
                            $(this).text($(this).text().replace("|", "[").replace("||", "]"));
                            $(this).val($(this).text().replace("|", "[").replace("||", "]"));
                        });
                        $('#drpAvailableFieldsO option').each(function (i, selected) {
                            //debugger;
                            $(this).text($(this).text().replace("|", "[").replace("||", "]"));
                            $(this).val($(this).text().replace("|", "[").replace("||", "]"));
                        });

                        if (dt.ReportList != '')
                            $('#tblReportList').html(dt.ReportList);
                        else
                            $('#tblReportList').html('<tr><td colspan="5">No Records Available</td></tr>');
                        window.setTimeout(function () { CloseHlsPopup(); }, 500);

                        //alert(dt.statusChechboxlist);

                        var mhtml = "";
                        for (var i = 0; i < $(dt.statusChechboxlist).length; ++i) {
                            mhtml = mhtml + $($(dt.statusChechboxlist)[i]).html() + ", ";
                        }
                        //alert(mhtml)
                        var mFhtml = mhtml.substring(0, mhtml.length - 2);
                        //alert(mFhtml);
                        $("#Statuschkdropdown").next().find(".multi-select-button").html(mFhtml);

                        $("#Statuschkdropdown").next().find(".multi-select-menuitems").children().each(function (index, element) {
                            //alert("h");
                            //alert("his");
                            $(this).find('input[type=checkbox]').attr("checked", "true");
                            $(this).find('input[type=checkbox]').val(1).change();
                            //$(this).children("option:selected").val();

                        });
                        $("#Statuschkdropdown").next().find(".multi-select-button").html();
                        LoadClassAndDepartment();
                    },
                    error: function (xhr, status, error) {
                        var err = eval("(" + xhr.responseText + ")");
                        console.log(err.Message);
                    }
                });
            }
            else {
                CloseHlsPopup();
                LoadingMessage('Your session has expired, we are redirecting to login page', '<b>Please Wait ...</b>');
                window.setTimeout(function () { window.location = '/Pages/BaseFramework/Security/Login.aspx'; }, 2000);
            }
        },
        error: function (xhr, status, error) {
            var err = eval("(" + xhr.responseText + ")");
            console.log(err.Message);
        }
    });
}
function LoadClassAndDepartment() {
    //if ($('#drpGroupBatch').val() > 0 && $('#drpOrganization').val() > 0) {
    $.ajax({
        type: "POST",
        url: URL + "/GetSession",
        data: '{}',
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function (dt) {
            if (dt.d > 0) {
                var obj = {
                    "OrgGroupBatchId": $('#drpGroupBatch').val(),
                    "OrganizationId": $('#drpOrganization').val()
                };
                $.ajax({
                    type: "POST",
                    url: URL + "/LoadClassAndDepartment",
                    data: JSON.stringify(obj),
                    contentType: "application/json;charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        var dt = $.parseJSON(data.d);

                        $('#drpDepartment').html(dt.DepratmentRes);
                        $('#drpClass').html(dt.ClassRes);

                        $("#classchkdropdown").next().remove();
                        $("#citychkdropdown").next().remove();
                        $("#Areachkdropdown").next().remove();
                        $("#Fatherqulificationchkdropdown").next().remove();
                        $("#Motherqulificationchkdropdown").next().remove();
                        $("#FatherOccupationchkdropdown").next().remove();
                        $("#MotherOccupationchkdropdown").next().remove();
                        $("#HOusechkdropdown").next().remove();

                        $("#classchkdropdown").removeAttr("style");
                        $("#citychkdropdown").removeAttr("style");
                        $("#Areachkdropdown").removeAttr("style");
                        $("#Fatherqulificationchkdropdown").removeAttr("style");
                        $("#Motherqulificationchkdropdown").removeAttr("style");
                        $("#FatherOccupationchkdropdown").removeAttr("style");
                        $("#MotherOccupationchkdropdown").removeAttr("style");
                        $("#HOusechkdropdown").removeAttr("style");

                        $("#classchkdropdown").removeAttr("multiple");
                        $("#citychkdropdown").removeAttr("multiple");
                        $("#Areachkdropdown").removeAttr("multiple");
                        $("#Fatherqulificationchkdropdown").removeAttr("multiple");
                        $("#Motherqulificationchkdropdown").removeAttr("multiple");
                        $("#FatherOccupationchkdropdown").removeAttr("multiple");
                        $("#MotherOccupationchkdropdown").removeAttr("multiple");
                        $("#HOusechkdropdown").removeAttr("multiple");

                        $("#classchkdropdown").attr("multiple", "multiple");
                        $("#citychkdropdown").attr("multiple", "multiple");
                        $("#Areachkdropdown").attr("multiple", "multiple");
                        $("#Fatherqulificationchkdropdown").attr("multiple", "multiple");
                        $("#Motherqulificationchkdropdown").attr("multiple", "multiple");
                        $("#FatherOccupationchkdropdown").attr("multiple", "multiple");
                        $("#MotherOccupationchkdropdown").attr("multiple", "multiple");
                        $("#HOusechkdropdown").attr("multiple", "multiple");


                        $("#classchkdropdown").html(dt.ClassCheckBoxList);
                        $("#citychkdropdown").html(dt.CityDropDown);
                        $("#Areachkdropdown").html(dt.AreaDropDown);
                        $("#Fatherqulificationchkdropdown").html(dt.FatherQualification);
                        $("#Motherqulificationchkdropdown").html(dt.MotherQualification);
                        $("#FatherOccupationchkdropdown").html(dt.FatherOccupation);
                        $("#MotherOccupationchkdropdown").html(dt.MotherOccupation);
                        $("#HOusechkdropdown").html(dt.HouseDropDown);

                        $("#classchkdropdown").removeData();
                        $("#citychkdropdown").removeData();
                        $("#Areachkdropdown").removeData();
                        $("#Fatherqulificationchkdropdown").removeData();
                        $("#Motherqulificationchkdropdown").removeData();
                        $("#FatherOccupationchkdropdown").removeData();
                        $("#MotherOccupationchkdropdown").removeData();
                        $("#HOusechkdropdown").removeData();

                        $('#classchkdropdown').multiSelect();
                        $("#citychkdropdown").multiSelect();
                        $("#Areachkdropdown").multiSelect();
                        $("#Fatherqulificationchkdropdown").multiSelect();
                        $("#Motherqulificationchkdropdown").multiSelect();
                        $("#FatherOccupationchkdropdown").multiSelect();
                        $("#MotherOccupationchkdropdown").multiSelect();
                        $("#HOusechkdropdown").multiSelect();

                    },
                    error: function (xhr, status, error) {
                        var err = eval("(" + xhr.responseText + ")");
                        console.log(err.Message);
                    }
                });
            }
            else {
                CloseHlsPopup();
                LoadingMessage('Your session has expired, we are redirecting to login page', '<b>Please Wait ...</b>');
                window.setTimeout(function () { window.location = '/Pages/BaseFramework/Security/Login.aspx'; }, 2000);
            }
        },
        error: function (xhr, status, error) {
            var err = eval("(" + xhr.responseText + ")");
            console.log(err.Message);
        }
    });
    //}
}

//add for mantis: 35508, start
function LoadClass(cobj) {
    $.ajax({
        type: "POST",
        url: URL + "/GetSession",
        data: '{}',
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function (dt) {
            if (dt.d > 0) {
                var obj = {
                    "OrgGroupBatchId": $('#drpGroupBatch').val(),
                    "OrganizationId": $('#drpOrganization').val(),
                    "DepartmentId": $(cobj).val()
                };
                $.ajax({
                    type: "POST",
                    url: URL + "/LoadClass",
                    data: JSON.stringify(obj),
                    contentType: "application/json;charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        var dt = $.parseJSON(data.d);
                        $('#drpClass').html(dt.ClassRes);
                    },
                    error: function (xhr, status, error) {
                        var err = eval("(" + xhr.responseText + ")");
                        console.log(err.Message);
                    }
                });
            }
            else {
                CloseHlsPopup();
                LoadingMessage('Your session has expired, we are redirecting to login page', '<b>Please Wait ...</b>');
                window.setTimeout(function () { window.location = '/Pages/BaseFramework/Security/Login.aspx'; }, 2000);
            }
        },
        error: function (xhr, status, error) {
            var err = eval("(" + xhr.responseText + ")");
            console.log(err.Message);
        }
    });
}
//add for mantis: 35508, end

function LoadDivision(cobj) {
    $.ajax({
        type: "POST",
        url: URL + "/GetSession",
        data: '{}',
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function (dt) {
            if (dt.d > 0) {
                var obj = {
                    "ClassId": $(cobj).val()
                };
                $.ajax({
                    type: "POST",
                    url: URL + "/LoadDivision",
                    data: JSON.stringify(obj),
                    contentType: "application/json;charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        var dt = $.parseJSON(data.d);
                        $('#drpDivision').html(dt.DivisionRes);
                    },
                    error: function (xhr, status, error) {
                        var err = eval("(" + xhr.responseText + ")");
                        console.log(err.Message);
                    }
                });
            }
            else {
                CloseHlsPopup();
                LoadingMessage('Your session has expired, we are redirecting to login page', '<b>Please Wait ...</b>');
                window.setTimeout(function () { window.location = '/Pages/BaseFramework/Security/Login.aspx'; }, 2000);
            }
        },
        error: function (xhr, status, error) {
            var err = eval("(" + xhr.responseText + ")");
            console.log(err.Message);
        }
    });
}
function ShowHideAndBind(cobj, flag) {
    if ($(cobj).is(':checked')) {
        $(cobj).parent().next('div').show();
        $(cobj).parent().next('div').html('&nbsp;<img src="../../Images/loading-ajax.gif" />' + '&nbsp; Loading....');
        BindValues(cobj, flag);
    }
    else {
        $(cobj).parent().next('div').hide();
        $(cobj).parent().next('div').html('');
    }
}
function BindValues(cobj, flag) {
    $.ajax({
        type: "POST",
        url: URL + "/GetSession",
        data: '{}',
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function (dt) {
            if (dt.d > 0) {
                var obj = {
                    "flag": flag
                };
                $.ajax({
                    type: "POST",
                    url: URL + "/BindValues",
                    data: JSON.stringify(obj),
                    contentType: "application/json;charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        var datas = $.parseJSON(data.d);
                        if (datas.Result != '') {
                            $(cobj).parent().next('div').html(datas.Result);
                            $(cobj).parent().next('div').css('border', '1px solid Silver');
                            $(cobj).parent().next('div').slimScroll({ height: '100px' });
                        }
                        else {
                            $(cobj).parent().next('div').html('&nbsp;No Data');
                        }
                    },
                    error: function (xhr, status, error) {
                        var err = eval("(" + xhr.responseText + ")");
                        console.log(err.Message);
                    }
                });
            }
            else {
                CloseHlsPopup();
                LoadingMessage('Your session has expired, we are redirecting to login page', '<b>Please Wait ...</b>');
                window.setTimeout(function () { window.location = '/Pages/BaseFramework/Security/Login.aspx'; }, 2000);
            }
        },
        error: function (xhr, status, error) {
            var err = eval("(" + xhr.responseText + ")");
            console.log(err.Message);
        }
    });
}
function fnValidateDecimal(textbox, lengthOfIntegral, lengthOfMantisa) {
    var str = textbox.value;
    if (str.length == 0) {
        return true;
    }
    var integerRegExp = /^\d*[0-9]$/;
    str = textbox.value;
    if (str.length == 0) {
        return true;
    }
    var newStr = "";
    var parts = str.split('.');
    if (parts.length >= 2) {
        if ((parts[0].length > 0) && (integerRegExp.test(parts[0]) != true)) {
            textbox.value = "";
            return true;
        }
        if ((parts[1].length > 0) && (integerRegExp.test(parts[1]) != true)) {
            textbox.value = "";
            return true;
        }
        if (parts[0].length > lengthOfIntegral) {
            newStr = parts[0].substring(0, lengthOfIntegral);
        }
        else { newStr = parts[0]; }
        if (parts[1].length > lengthOfMantisa) {
            newStr = newStr + '.' + parts[1].substring(0, lengthOfMantisa);
        }
        else { newStr = newStr + '.' + parts[1]; }
    }
    else {
        if ((parts[0].length > 0) && (integerRegExp.test(parts[0]) != true)) {
            textbox.value = "";
            return true;
        }
        if (str.indexOf('.') >= 0) {
            if (str.length > lengthOfMantisa + 1) {
                newStr = str.substring(0, lengthOfMantisa + 1);
            }
            else { newStr = str; }
        }
        else {
            if (str.length > lengthOfIntegral) {
                newStr = str.substring(0, lengthOfIntegral);
            }
            else { newStr = str; }
        }
    }
    if (newStr.length > 0) {
        str = newStr;
    }
    textbox.value = str;
}
function MaskDecimal(evt, lengthOfIntegral, lengthOfMantisa) {
    var unicode = evt.charCode ? evt.charCode : evt.keyCode;
    if (unicode < 8 || unicode > 9) {
        if (!(unicode == 46 || (unicode >= 48 && unicode <= 57))) return false;
        var parts = evt.srcElement.value.split('.');
        if (parts.length > 2) return false;
        if (unicode == 46) return (parts.length == 1);
        if (evt.srcElement.value.length >= (lengthOfIntegral + lengthOfMantisa + 1)) return false;
        if (parts[0].length == lengthOfIntegral && parts.length == 1) return false;
    }
}
function validateEmail(emailField) {
    var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;

    if (reg.test(emailField.value) == false) {
        alert('Invalid Email Address');
        emailField.value = "";
        return false;
    }

    return true;

}
function isNumber(evt) {
    evt = (evt) ? evt : window.event;
    var charCode = (evt.which) ? evt.which : evt.keyCode;
    if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        return false;
    }
    return true;
}
var tablename = "";
var fieldname = "";
var controltype = "";
var mastertablename = "";
var IsManditory = "";
var IsEnabledDisabled = "";


function GetStudentList() {
    //debugger
    if ($("#tblStudentList").children().length == "0") {
        alert("No record found");
        $("#exampleModal").removeAttr("Id");
        return false;
    }

    //LoadingMessage('Loading Details', '<b>Please Wait ...</b>');
    //$('#dvLoadingmsg').show();
    //$(".modal").hide();
    //  $('.hls-bg').show();
    $(".previous").hide();
    $(".next").hide();
    $("#divStudentLoading").html("Please wait while data is fetching...");
    $("#divStudentLoading").show();
    $(".clsSave").hide();
    //var start = $("#drpCustomUpdatePaging").children("option:selected").attr("start");
    var start = $('#drpCustomUpdatePaging > option:selected').attr("start");
    //var end = $("#drpCustomUpdatePaging").children("option:selected").attr("end");
    var end = $('#drpCustomUpdatePaging > option:selected').attr("end");

    //OrganizationWiseSearch


    $.ajax({
        type: "POST",
        url: URL + "/GetSession",
        data: '{}',
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function (dt) {
            if (dt.d > 0) {
                var obj = {
                    "tablename": tablename,
                    "fieldname": fieldname,
                    "controltype": controltype,
                    "mastertablename": mastertablename,
                    "IsManditory": IsManditory,
                    "IsEnabledDisabled": IsEnabledDisabled,
                    "start": start,
                    "end": end,
                    "OrgGroupBatchId": $('#drpGroupBatch').val(),
                    "OrgId": $('#drpOrganization').val()
                };
                $.ajax({
                    type: "POST",
                    url: URL + "/GetStudentList",
                    data: JSON.stringify(obj),
                    contentType: "application/json;charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        //$('#dvLoadingmsg').hide();
                        //$(".modal").show();
                        // alert(data.d);
                        //var datas = $.parseJSON(data.d);
                        //tlbStudentData = datas;
                        //var tlbStudentData = "";
                        //if (datas.Result != '') {
                        //    //alert(datas.Result);
                        //    //tlbStudentData =datas.Result;
                        //    //$(cobj).parent().next('div').html(datas.Result);
                        //    //$(cobj).parent().next('div').css('border', '1px solid Silver');
                        //    //$(cobj).parent().next('div').slimScroll({ height: '100px' });
                        //}
                        //else {
                        //    $(cobj).parent().next('div').html('&nbsp;No Data');
                        //}
                        //$('#tlbStudentData').html('');

                        if ($(data.d).find(".ClsNoRecord").length > 0) {
                            $(".clsSave").hide();
                            $("#divStudentLoading").hide();
                            $(".previous").hide();
                            $(".next").hide();
                            document.getElementById("tlbStudentData").innerHTML = data.d;


                        }
                        else {
                            $(".clsSave").show();
                            $("#divStudentLoading").hide();
                            if ($("#drpCustomUpdatePaging").children().length == "1") {
                                $(".previous").hide();
                                $(".next").hide();
                            }
                            else {
                                $(".previous").show();
                                $(".next").show();
                            }
                            document.getElementById("tlbStudentData").innerHTML = data.d;
                        }
                    },
                    error: function (xhr, status, error) {
                        $(".clsSave").hide();
                        // $('#tlbStudentData').html('<tr><td colspan="5">No Records Available</td></tr>');
                        var err = eval("(" + xhr.responseText + ")");
                        console.log(err.Message);
                    }
                });
            }
            else {
                CloseHlsPopup();
                LoadingMessage('Your session has expired, we are redirecting to login page', '<b>Please Wait ...</b>');
                window.setTimeout(function () { window.location = '/Pages/BaseFramework/Security/Login.aspx'; }, 2000);
            }
        },
        error: function (xhr, status, error) {
            var err = eval("(" + xhr.responseText + ")");
            console.log(err.Message);
        }
    });
}
//$('.chkHeader').click(function (e) {
//    alert("hi");
//    if ($(this).prop("checked") == true) {
//        $(".chkRow").attr('checked', 'checked')
//    }
//    else {
//        $(".chkRow").removeAttr("checked");
//    }

//});

$('.next').click(function (e) {
    //debugger;
    var nextElement = $('#drpCustomUpdatePaging > option:selected').next('option');
    if (nextElement.length > 0) {
        $('#drpCustomUpdatePaging > option:selected').removeAttr('selected').next('option').prop('selected', 'selected').change();
    }
    GetData();
});
$('.previous').click(function (e) {

    //debugger;
    var nextElement = $('#drpCustomUpdatePaging > option:selected').prev('option');
    if (nextElement.length > 0) {
        $('#drpCustomUpdatePaging > option:selected').removeAttr('selected').prev('option').prop('selected', 'selected').change();
    }
    GetData();
});

//$(".next,.previous").click(function () {
//    $("#drpCustomUpdatePaging :selected")[this.id]().prop("selected", true);
//    GetData();
//});
//$(".next").click(function () {
//    $("#drpCustomUpdatePaging").val($("#drpCustomUpdatePaging > option:selected").next().val());
//})

//$(".previous").click(function () {
//    $("#drpCustomUpdatePaging").val($("#drpCustomUpdatePaging > option:selected").prev().val());
//})

$('#tlbStudentData').on('click', '.chkHeader', function () {
    if ($(this).prop("checked") == true) {
        $(".chkRow").prop('checked', this.checked);
    }
    else {
        $(".chkRow").prop('checked', false);
    }
});
var validationFields = "";
var validationTr = "";
var fname = "";
var sid = "";
function validationForBulkStudentData() {
    $(".clsValidation").html('');
    $(".clsValidation").removeClass("clsVal");
    validationTr = "";
    var codeTitle = "";
    $('#tlbStudentData .chkRowOuter').find("input:checked").each(function () {
        $(this).closest("tr").find("td:not(:first)").each(function () {
            var controlType = $(this).attr("control-type");
            var ismanditory = '';

            if ($(this).hasClass("ClsF") == true) {
                codeTitle = $(this).text();
            }
            debugger;
            if (controlType == 'T') {
                ismanditory = $(this).find("input").attr("is-manditory");
                fname = $(this).find("input").attr("field-name");
                sid = $(this).find("input").attr("student-id");

                if (ismanditory == 'T' && $(this).find("input").val() == '') {
                    //alert(ismanditory);
                    //validationFields += fname + ",";
                    validationFields += fname;
                    //validationTr += "Please Insert/Select " + validationFields + " for " + sid + "</br>"
                    validationTr += "Please Insert/Select " + validationFields + " for " + codeTitle + "</br>"
                }
            }
            if (controlType == 'D') {
                ismanditory = $(this).find(".DropdownValue").attr("is-manditory");
                sid = $(this).find(".DropdownValue").attr("student-id");

                fname = $(this).find(".DropdownValue").attr("field-name");
                if (ismanditory == 'T' && $(this).find(".DropdownValue :selected").val() == '0') {
                    // alert(fname);
                    //validationFields += fname + ",";
                    validationFields += fname;
                    //validationTr += "Please Insert/Select " + validationFields + " for " + sid + "</br>"
                    validationTr += "Please Insert/Select " + validationFields + " for " + codeTitle + "</br>"
                }
            }
            if (controlType == 'DP') {
                ismanditory = $(this).find("input").attr("is-manditory");
                sid = $(this).find("input").attr("student-id");

                fname = $(this).find("input").attr("field-name");
                if (ismanditory == 'T' && $(this).find("input").val() == '') {
                    //validationFields += fname + ",";
                    validationFields += fname;
                    // validationTr += "Please Insert/Select " + validationFields + " for " + sid + "</br>"
                    validationTr += "Please Insert/Select " + validationFields + " for " + codeTitle + "</br>"
                }
            }


            validationFields = "";

        });
    });
    $(".clsValidation").html(validationTr)
    $(".clsValidation").addClass("clsVal");

    // alert(validationTr);
}

$('.clsSave').click(function (e) {
    validationForBulkStudentData();

    if ($.trim($(".clsValidation").html()) == '') {
        //alert("hi");

        var studentid = "";
        var tablename = "";
        var fieldname = "";
        var fieldvalue = "";
        var fieldtext = "";
        var isenabled = "";
        var StudentData = [];

        if ($('#tlbStudentData .chkRowOuter').find("input:checked").length == 0) {
            alert("Please select atleast one checkbox.");
            return false;
        }
        $('#tlbStudentData .chkRowOuter').find("input:checked").each(function () {
            // alert($(this).prop("checked"));
            //this is the current checkbox
            debugger;
            //alert($(this).closest("tr td").length);

            // $(this).closest("tr").find("td:not(:first)").each(function () {
            $(this).closest("tr").find("td:not('.ClsF')").each(function () {
                var controlType = $(this).attr("control-type");
                if (controlType == 'T') {

                    studentid = $(this).find("input").attr("student-id");
                    tablename = $(this).find("input").attr("table-name");
                    fieldname = $(this).find("input").attr("field-name");
                    isenabled = $(this).find("input").prop('disabled');


                    fieldvalue = $(this).find("input").val().replace("'", "");
                }
                if (controlType == 'D') {
                    studentid = $(this).find(".DropdownValue").attr("student-id");
                    tablename = $(this).find(".DropdownValue").attr("table-name");
                    fieldname = $(this).find(".DropdownValue").attr("field-name");
                    isenabled = $(this).find(".DropdownValue").prop('disabled');

                    if (fieldname == "MotherTongue") {
                        //alert($(this).find(".DropdownValue :selected").text());
                        fieldvalue = $(this).find(".DropdownValue :selected").text().replace("'", "");
                    }
                    else {
                        fieldvalue = $(this).find(".DropdownValue :selected").val().replace("'", "");
                    }

                    //fieldvalue = $(this).find(".DropdownValue :selected").val().replace("'", "");
                }
                if (controlType == 'DP') {
                    studentid = $(this).find("input").attr("student-id");
                    tablename = $(this).find("input").attr("table-name");
                    fieldname = $(this).find("input").attr("field-name");
                    isenabled = $(this).find("input").prop('disabled');

                    fieldvalue = $(this).find("input").val().replace("'", "");
                }
                if (controlType == 'C') {
                    // debugger;
                    studentid = $(this).find("input").attr("student-id");
                    tablename = $(this).find("input").attr("table-name");
                    fieldname = $(this).find("input").attr("field-name");
                    isenabled = $(this).find("input").prop('disabled');
                    if ($(this).find("input").prop("checked") == true) {
                        fieldvalue = 1;
                    }
                    else {
                        fieldvalue = 0;
                    }
                }
                //alert(studentid);
                //alert(tablename);
                //alert(fieldname);
                //alert(isenabled);
                if (isenabled == false) {
                    StudentData.push({
                        studentid: studentid,
                        tablename: tablename,
                        fieldname: fieldname,
                        fieldvalue: fieldvalue
                    });
                }

            });


            //var controlType = $(this).closest("tr").attr("control-type");
            //if (controlType == 'T') {
            //    studentid = $(this).closest("tr").find(".inputValue").attr("student-id");
            //    tablename = $(this).closest("tr").find(".inputValue").attr("table-name");
            //    fieldname = $(this).closest("tr").find(".inputValue").attr("field-name");

            //    fieldvalue = $(this).closest("tr").find(".inputValue").val();

            //}
            //debugger;
            //if (controlType == 'D') {
            //    studentid = $(this).closest("tr").find(".DropdownValue").attr("student-id");
            //    tablename = $(this).closest("tr").find(".DropdownValue").attr("table-name");
            //    fieldname = $(this).closest("tr").find(".DropdownValue").attr("field-name");

            //    fieldvalue = $(this).closest("tr").find(".DropdownValue :selected").val();
            //    fieldtext = $(this).closest("tr").find(".DropdownValue :selected").text();
            //}

            //StudentData.push({
            //    studentid: studentid,
            //    tablename: tablename,
            //    fieldname: fieldname,
            //    fieldvalue: fieldvalue
            //});
            //alert("StudentData---" + JSON.stringify(StudentData));
            //alert(studentid);
            //alert(tablename);
            //alert(fieldname);
            //alert(fieldvalue);

        });
        SendData(StudentData);
    }
});

function SendData(StudentData) {
    $("#divStudentLoading").html("Please Wait - Saving...");
    $("#divStudentLoading").show();
    $(".clsValidation").removeClass("clsVal");
    var jsonObjects = {
        "Students": StudentData,
        "OrgGroupBatchId": $('#drpGroupBatch').val(),
        "OrgId": $('#drpOrganization').val()
    };
    // alert(JSON.stringify(jsonObjects));
    $.ajax({
        type: "POST",
        url: URL + "/GetSession",
        data: '{}',
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function (dt) {
            if (dt.d > 0) {

                $.ajax({
                    type: "POST",
                    url: URL + "/SaveStudentData",
                    data: JSON.stringify(jsonObjects),
                    contentType: "application/json;charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        var datas = $.parseJSON(data.d);
                        //alert(datas.Result);
                        //alert(datas.Result);
                        if (datas.Result != '') {
                            //GetData();
                            //alert(datas);
                            if (datas.Result == "1") {
                                $("#divStudentLoading").hide();
                                alert("Record Save successfully.");
                            }
                            else {
                                //$(".clsValidation").show();
                                $("#divStudentLoading").html(datas.Result);
                            }
                        }
                        else {
                            alert("Error has occured.");
                        }
                    },
                    error: function (xhr, status, error) {
                        var err = eval("(" + xhr.responseText + ")");
                        console.log(err.Message);
                    }
                });
            }
            else {
                CloseHlsPopup();
                LoadingMessage('Your session has expired, we are redirecting to login page', '<b>Please Wait ...</b>');
                window.setTimeout(function () { window.location = '/Pages/BaseFramework/Security/Login.aspx'; }, 2000);
            }
        },
        error: function (xhr, status, error) {
            var err = eval("(" + xhr.responseText + ")");
            console.log(err.Message);
        }


    });
}

function GetData() {
    debugger;

    //if ($('#drpSelectedFields').find("[field-name='DivisionOrder']").length > 0) {

    //    document.getElementById("tlbStudentData").innerHTML = "";
    //    alert("Can not update DivisionOrder.");

    //    return false;
    //}
    //if ($('#drpSelectedFields').find("[field-name='ClassOrderIndex']").length > 0) {

    //    document.getElementById("tlbStudentData").innerHTML = "";
    //    alert("Can not update ClassOrderIndex.");

    //    return false;
    //}
    //if ($('#drpSelectedFields').find("[field-name='TransportModeId']").length > 0) {

    //    document.getElementById("tlbStudentData").innerHTML = "";
    //    alert("Can not update TransportModeId.");

    //    return false;
    //}
    //if ($('#drpSelectedFields').find("[field-name='BirthDateInWord']").length > 0) {

    //    document.getElementById("tlbStudentData").innerHTML = "";
    //    alert("Can not update BirthDateInWord.");

    //    return false;
    //}
    //debugger;

    if ($('#drpSelectedFields').text().indexOf("]") != "-1") {
        document.getElementById("tlbStudentData").innerHTML = "";
        alert("Can not update custom fields.");
        $("#exampleModal").removeAttr("Id");
        return false;
    }

    if ($("#tblStudentList").children().length == 0) {
        document.getElementById("tlbStudentData").innerHTML = "";
        alert("No Record found.");
        $("#exampleModal").removeAttr("Id");
        return false;
    }



    if ($('#drpSelectedFields').children().length > 25) {
        document.getElementById("tlbStudentData").innerHTML = "";
        alert("Maximum field limit are 25.");
        $("#exampleModal").removeAttr("Id");
        return false;
    }

    if ($('#drpSelectedFields').find("[field-name='Code']").length > 0) {

        document.getElementById("tlbStudentData").innerHTML = "";
        alert("Can not update ID No.");
        $("#exampleModal").removeAttr("Id");
        return false;
    }
    if ($('#drpSelectedFields').find("[field-name='Number']").length > 0) {

        document.getElementById("tlbStudentData").innerHTML = "";
        alert("Can not update Number.");
        $("#exampleModal").removeAttr("Id");
        return false;
    }
    if ($('#drpSelectedFields').find("[field-name='StudentBatchStatus']").length > 0) {

        document.getElementById("tlbStudentData").innerHTML = "";
        alert("Can not update Student Batch Status.");
        $("#exampleModal").removeAttr("Id");
        return false;
    }
    if ($('#drpSelectedFields').find("[field-name='PresentAddress']").length > 0) {

        document.getElementById("tlbStudentData").innerHTML = "";
        alert("Can not update Present Address.");
        $("#exampleModal").removeAttr("Id");
        return false;
    }
    if ($('#drpSelectedFields').find("[field-name='PermanentAddress']").length > 0) {

        document.getElementById("tlbStudentData").innerHTML = "";
        alert("Can not update Permanent Address.");
        $("#exampleModal").removeAttr("Id");
        return false;
    }
    if ($('#drpSelectedFields').find("[field-name='EmergencyAddress']").length > 0) {

        document.getElementById("tlbStudentData").innerHTML = "";
        alert("Can not update Emergency Address.");
        $("#exampleModal").removeAttr("Id");
        return false;
    }
    if ($('#drpSelectedFields').find("[field-name='LeftDate']").length > 0) {

        document.getElementById("tlbStudentData").innerHTML = "";
        alert("Can not update Left Date.");
        $("#exampleModal").removeAttr("Id");
        return false;
    }
    if ($('#drpSelectedFields').find("[field-name='InactiveDate']").length > 0) {

        document.getElementById("tlbStudentData").innerHTML = "";
        alert("Can not update Inactive Date.");
        $("#exampleModal").removeAttr("Id");
        return false;
    }
    else {
        $(".popup-data").attr('Id', 'exampleModal');
        GetFinalData();
    }

}


function GetFinalData() {
    tablename = "";
    fieldname = "";
    controltype = "";
    mastertablename = "";
    IsManditory = "";
    IsEnabledDisabled = "";
    document.getElementById("tlbStudentData").innerHTML = "";
    $(".clsValidation").html('');
    $(".clsValidation").removeClass("clsVal");
    if ($('#drpSelectedFields option').length > 0) {
        $('#drpSelectedFields option').each(function (i, selected) {
            //alert($(selected).attr('table-name'));
            //if (!($(selected).attr('field-name') == 'DivisionOrder' || $(selected).attr('field-name') == 'ClassOrderIndex')) {
            if (!($(selected).attr('field-name') == 'Code')) {
                tablename = tablename + $(selected).attr('table-name') + ",";
                fieldname = fieldname + $(selected).attr('field-name') + ",";
                controltype = controltype + $(selected).attr('control-type') + ",";
                mastertablename = mastertablename + $(selected).attr('master-table-name') + ",";
                IsManditory = IsManditory + $(selected).attr('IsManditory') + ",";
                IsEnabledDisabled = IsEnabledDisabled + $(selected).attr('IsEnabled') + ",";
            }

        });

        var lastChar = tablename.slice(-1);
        if (lastChar == ',') {
            tablename = tablename.slice(0, -1);
        }
        var lastChar1 = fieldname.slice(-1);
        if (lastChar1 == ',') {
            fieldname = fieldname.slice(0, -1);
        }
        var lastChar2 = controltype.slice(-1);
        if (lastChar2 == ',') {
            controltype = controltype.slice(0, -1);
        }
        var lastChar3 = mastertablename.slice(-1);
        if (lastChar3 == ',') {
            mastertablename = mastertablename.slice(0, -1);
        }
        var lastChar4 = IsManditory.slice(-1);
        if (lastChar4 == ',') {
            IsManditory = IsManditory.slice(0, -1);
        }
        var lastChar5 = IsEnabledDisabled.slice(-1);
        if (lastChar5 == ',') {
            IsEnabledDisabled = IsEnabledDisabled.slice(0, -1);
        }
        // $(".modal").show();
        GetStudentList();
    }
    else {
        $(".modal").hide();
        $("#exampleModal").removeAttr("Id");
        alert("Atleast select one field.");
        //$("#exampleModal").removeClass("in");
        return false;
    }
}


function ShowHideSaveReport(obj) {
    if ($(obj).is(':checked')) {
        $('div[group=dvreportgroup]').show();
    }
    else {
        $('div[group=dvreportgroup]').hide();
    }
}



//function AppendSelected(flag) {

//    if (flag == 1) {

//        if ($("#drpAvailableFields option:selected").length > 0) {
//            if ($("#drpAvailableFields option:selected").length == 1) {
//                var option = new Option($('#drpAvailableFields').val(), "value");
//                var dup = false;
//                var sTexts = $(this).val();
//                $('#drpSelectedFields option').each(function (i, selected) {
//                    debugger;
//                    if ($(selected).text().replace("|", "").replace("||", "").replace("]", "").replace("[", "") == sTexts.replace("|", "").replace("||", "").replace("]", "").replace("[", "")) {
//                        dup = true;
//                    }

//                });
//                if (dup == false) {

//                    $('#drpSelectedFields').append(option);
//                }
//            }
//            else {
//                $("#drpAvailableFields option:selected").each(function (index, element) {
//                    var dup = false;
//                    var sTexts = $(this).val();
//                    $('#drpSelectedFields option').each(function (i, selected) {
//                        debugger;
//                        if ($(selected).text().replace("|", "").replace("||", "").replace("]", "").replace("[", "") == sTexts.replace("|", "").replace("||", "").replace("]", "").replace("[", "")) {

//                            dup = true;
//                        }

//                    });
//                    if (dup == false) {
//                        debugger;
//                        sTexts = sTexts.replace("|", "[").replace("||", "]");
//                        var option = new Option(sTexts, "value");
//                        //option.text().replace("|", "[").replace("||", "]"));
//                        $('#drpSelectedFields').append(option);

//                    }
//                });
//            }
//            debugger;
//            //if ($("#drpSelectedFields").children().length == "0") {
//            //    $(".btn-primary").css('display', 'none');
//            //}
//            //else {
//            //    if ($("#tblStudentList").find("td").html() != "No Records Available") {
//            //        $(".btn-primary").css('display', '');
//            //    }
//            //    else {
//            //        $(".btn-primary").css('display', 'none');
//            //    }
//            //}
//            $('#drpSelectedFields option').each(function (i, selected) {

//                //alert($(selected).text());
//                if ($(selected).text().toLowerCase() == "rollno") {
//                    $(this).attr('table-name', 'sStudent.tAcademic');
//                    $(this).attr('field-name', 'rollno');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tAcademic');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');

//                }
//                if ($(selected).text().toLowerCase() == "batch") {
//                    $(this).attr('table-name', 'sStudent.tAcademic');
//                    $(this).attr('field-name', 'BatchId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sSetup.tBatchMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "suid") {
//                    $(this).attr('table-name', 'sStudent.tStudentMaster');
//                    $(this).attr('field-name', 'SUId');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentUIdMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "id no") {
//                    $(this).attr('table-name', 'sStudent.tStudentMaster');
//                    $(this).attr('field-name', 'Code');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }

//                if ($(selected).text().toLowerCase() == "firstname") {
//                    $(this).attr('table-name', 'sStudent.tStudentMaster');
//                    $(this).attr('field-name', 'FirstName');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentMaster');
//                    $(this).attr('IsManditory', 'T');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "middlename") {
//                    $(this).attr('table-name', 'sStudent.tStudentMaster');
//                    $(this).attr('field-name', 'MiddleName');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "lastname") {
//                    $(this).attr('table-name', 'sStudent.tStudentMaster');
//                    $(this).attr('field-name', 'LastName');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "classname") {
//                    $(this).attr('table-name', 'sStudent.vStudentAcademic');
//                    $(this).attr('field-name', 'ClassId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sSetup.tClassMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "divisionname") {
//                    $(this).attr('table-name', 'sStudent.vStudentAcademic');
//                    $(this).attr('field-name', 'DivisionId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sSetup.tDivisionMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "divisionname") {
//                    $(this).attr('table-name', 'sStudent.vStudentAcademic');
//                    $(this).attr('field-name', 'DivisionId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sSetup.tDivisionMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }

//                if ($(selected).text().toLowerCase() == "uidnumber") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'UIDNumber');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "adhaarnumber") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'AdhaarNumber');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "dateofbirth") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'DateOfBirth');
//                    $(this).attr('control-type', 'DP');
//                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
//                    $(this).attr('IsManditory', 'T');
//                    $(this).attr('IsEnabled', 'E');
//                }

//                if ($(selected).text().toLowerCase() == "birthdateinword") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'BirthDateInWord');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "bloodgroup") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'BloodGroupId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sCommon.tBloodGroupMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "birthplace") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'BirthPlace');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "birthtaluka") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'BirthTaluka');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "birthdistrict") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'BirthDistrict');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "familycaste") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'FamilyCast');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "castcategoryid") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'CastCategoryId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sCommon.tCastCategoryMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "religion") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'ReligionId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sCommon.tReligionMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "house") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'HouseId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sActivity.tHouseMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "mothertongue") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'MotherTongue');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sCommon.tMotherTongueMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "nationality") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'NationalityId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sCommon.tCountryMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hobby") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'Hobby');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sCommon.tStudentOther');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "identificationmark1") {
//                    $(this).attr('table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('field-name', 'IdentificationMark1');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "identificationmark2") {
//                    $(this).attr('table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('field-name', 'identificationmark2');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "pysicalDeformityremark") {
//                    $(this).attr('table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('field-name', 'PysicalDeformityRemark');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "majorillnessremark") {
//                    $(this).attr('table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('field-name', 'MajorIllnessRemark');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "majorillnessremark") {
//                    $(this).attr('table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('field-name', 'MajorIllnessRemark');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "majorillnessremark") {
//                    $(this).attr('table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('field-name', 'MajorIllnessRemark');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "familydoctorname") {
//                    $(this).attr('table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('field-name', 'FamilyDoctorName');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "familydoctorcontactno") {
//                    $(this).attr('table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('field-name', 'FamilyDoctorContactNo');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "presentstreetone") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'PresentStreetOne');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "presentstreettwo") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'PresentStreetTwo');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "presentstreetthree") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'PresentStreetThree');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "presentcountry") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'PresentCountry');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "presentstate") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'PresentState');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "presentcity") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'PresentCity');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "presentzipcode") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'PresentZipCode');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "presentcontactno") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'PresentContactNo');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "permanentstreetone") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'PermanentStreetOne');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "permanentstreettwo") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'PermanentStreetTwo');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "permanentstreetthree") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'PermanentStreetThree');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "permanentcountry") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'PermanentCountry');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "permanentstate") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'PermanentState');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "permanentcity") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'PermanentCity');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "permanentzipcode") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'PermanentZipCode');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "permanentcontactno") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'PermanentContactNo');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "emergencystreetone") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'EmergencyStreetOne');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "emergencystreettwo") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'EmergencyStreetTwo');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "emergencystreetthree") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'EmergencyStreetThree');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "emergencycountry") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'EmergencyCountry');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "emergencycountry") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'EmergencyCountry');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "emergencystate") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'EmergencyState');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "emergencycity") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'EmergencyCity');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "emergencyzipcode") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'EmergencyZipCode');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "emergencycontactno") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'EmergencyContactNo');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "parentcontactno") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'ParentContactNo');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "parentemail") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'ParentEmail');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "studentcontactno") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'StudentContactNo');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "fathername") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'FatherName');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "fathername") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'FatherName');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "fatherdateofbirth") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'FatherDateOfBirth');
//                    $(this).attr('control-type', 'DP');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "fatherqualification") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'FatherQualification');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "fatheroccupation") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'FatherOccupation');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "fathercontactno") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'FatherContactNo');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "fathermail") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'FatherMail');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "fatherofficeaddress") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'FatherOfficeAddress');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "fatherincome") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'FatherIncome');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "mothername") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'MotherName');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "motherdateofbirth") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'MotherDateOfBirth');
//                    $(this).attr('control-type', 'DP');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "motherqualification") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'MotherQualification');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "motheroccupation") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'MotherOccupation');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "mothercontactno") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'MotherContactNo');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "mothermail") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'MotherMail');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "motherofficeaddress") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'MotherOfficeAddress');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "motherincome") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'MotherIncome');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "motherincome") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'MotherIncome');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "admissioncategory") {
//                    $(this).attr('table-name', 'sStudent.tStudentMaster');
//                    $(this).attr('field-name', 'AdmissionCategoryId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sStudent.tAdmissionCategoryMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "previousschool") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'PreviousSchool');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "admissiondate") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'AdmissionDate');
//                    $(this).attr('control-type', 'DP');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "admissionformnumber") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'AdmissionFormNumber');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "admissionnumber") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'AdmissionNumber');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "transferfrom") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'TransferFrom');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }

//                if ($(selected).text().toLowerCase() == "passingyear") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'PassingYear');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "certificatename") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'CertificateName');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }

//                if ($(selected).text().toLowerCase() == "inactivedate") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'InactiveDate');
//                    $(this).attr('control-type', 'DP');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "inactivereason") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'InActiveReason');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "lcbook") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'LCBook');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "lcbook") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'LCBook');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "leftdate") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'LeftDate');
//                    $(this).attr('control-type', 'DP');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "lcdate") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'LcDate');
//                    $(this).attr('control-type', 'DP');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "lcbook") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'LCBook');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "leftreason") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'LeftReason');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "lcprogress") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'LCProgress');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "lcconduct") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'LCConduct');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "lcremark") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'LCRemark');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "lcremark") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'LCRemark');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "blacklistreason") {
//                    $(this).attr('table-name', 'sStudent.tStudentMaster');
//                    $(this).attr('field-name', 'BlackListReason');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "bankaccountnumber") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('field-name', 'BankAccountNumber');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "bankname") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('field-name', 'BankName');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "bankname") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('field-name', 'BankName');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "bankbranch") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('field-name', 'BankBranch');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "bankbranch") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('field-name', 'BankBranch');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "bankifsccode") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('field-name', 'BankIFSCCode');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "bankifsccode") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('field-name', 'BankIFSCCode');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "class9boardregistrationnumber") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('field-name', 'Class9BoardRegistrationNumber');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "class11boardregistrationnumber") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('field-name', 'Class11BoardRegistrationNumber');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "passportnumber") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('field-name', 'PassportNumber');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }

//                if ($(selected).text().toLowerCase() == "passporttype") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('field-name', 'PassportType');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "passportcountrycode") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('field-name', 'PassportCountryCode');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "passportissuedate") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('field-name', 'PassportIssueDate');
//                    $(this).attr('control-type', 'DP');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "passportexpirydate") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('field-name', 'PassportExpiryDate');
//                    $(this).attr('control-type', 'DP');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "siblingname1") {
//                    $(this).attr('table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('field-name', 'SiblingName1');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "siblinginstitue1") {
//                    $(this).attr('table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('field-name', 'siblinginstitue1');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "siblingclass1") {
//                    $(this).attr('table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('field-name', 'SiblingClass1');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "siblingage1") {
//                    $(this).attr('table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('field-name', 'SiblingAge1');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "siblingrelation1") {
//                    $(this).attr('table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('field-name', 'SiblingRelation1');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "siblingname2") {
//                    $(this).attr('table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('field-name', 'SiblingName2');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "siblinginstitue2") {
//                    $(this).attr('table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('field-name', 'SiblingInstitue2');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "siblingclass2") {
//                    $(this).attr('table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('field-name', 'SiblingClass2');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "siblingage2") {
//                    $(this).attr('table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('field-name', 'SiblingAge2');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "siblingrelation2") {
//                    $(this).attr('table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('field-name', 'SiblingRelation2');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "siblingname3") {
//                    $(this).attr('table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('field-name', 'SiblingName3');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "siblinginstitue3") {
//                    $(this).attr('table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('field-name', 'SiblingInstitue3');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "siblingclass3") {
//                    $(this).attr('table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('field-name', 'SiblingClass3');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "siblingage3") {
//                    $(this).attr('table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('field-name', 'SiblingAge3');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "siblingrelation3") {
//                    $(this).attr('table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('field-name', 'SiblingRelation3');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "sscboard") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'SSCBoard');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "sscschool") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'SSCSchool');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "sscpassingyear") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'SSCPassingYear');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "sscobtainmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'SSCObtainMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "sscoutofmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'SSCOutOfMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "sscpercentage") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'SSCPercentage');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "sscmathmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'SSCMathMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "sscmathoutofmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'SSCMathOutOfMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscboard") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCBoard');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscschool") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCSchool');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscpassingyear") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCPassingYear');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscobtainmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCObtainMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscoutofmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCOutOfMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscpercentage") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCPercentage');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscbiologymarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCBiologyMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscbiologyoutofmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCBiologyOutOfMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscchemistrymarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCChemistryMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscchemistryoutofmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCChemistryOutOfMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscmathmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCMathMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscmathoutofmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCMathOutOfMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscphysicsmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCPhysicsMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscphysicsoutofmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCPhysicsOutOfMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "pcmmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'PCMMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscboard") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCBoard');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscschool") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCSchool');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscpassingyear") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCPassingYear');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscobtainmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCObtainMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscoutofmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCOutOfMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscpercentage") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCPercentage');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscbiologymarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCBiologyMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscbiologyoutofmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCBiologyOutOfMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscchemistrymarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCChemistryMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscchemistryoutofmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCChemistryOutOfMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscmathmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCMathMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscmathoutofmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCMathOutOfMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscphysicsmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCPhysicsMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hscphysicsoutofmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'HSCPhysicsOutOfMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "pcmmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'PCMMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "pcbmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'PCBMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "jeerollno") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'JEERollNo');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "jeemeritno") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'JEEMeritNo');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "jeemeritmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'JEEMeritMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "jeeoutofmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'JEEOutOfMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "diplomaboard") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'DiplomaBoard');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "diplomacollege") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'DiplomaCollege');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "diplomapassingyear") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'DiplomaPassingYear');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "diplomaobtainmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'DiplomaObtainMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "diplomaoutofmarks") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'DiplomaOutOfMarks');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "diplomapercentage") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'DiplomaPercentage');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "applicationno") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'ApplicationNo');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "admissionround") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'AdmissionRound');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "admissionround") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'AdmissionRound');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "hostelname") {
//                    $(this).attr('table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('field-name', 'HostelId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sHostel.tHostelMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "room") {
//                    $(this).attr('table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('field-name', 'RoomId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sHostel.tRoomMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "buildingname") {
//                    $(this).attr('table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('field-name', 'BuildingName');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sHostel.tBuildingMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "bednumber") {
//                    $(this).attr('table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('field-name', 'BedNumber');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "studentgroup") {
//                    $(this).attr('table-name', 'sStudent.tStudentMaster');
//                    $(this).attr('field-name', 'StudentGroupId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sStudent.tStudentGroupMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "studentothergroup") {
//                    $(this).attr('table-name', 'sStudent.tStudentMaster');
//                    $(this).attr('field-name', 'StudentOtherGroupId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sStudent.tStudentOtherGroupMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "birthstate") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'BirthState');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "birthcountry") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'BirthCountry');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "pickuptime") {
//                    $(this).attr('table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('field-name', 'PickupTime');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "droptime") {
//                    $(this).attr('table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('field-name', 'Droptime');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "busroute") {
//                    $(this).attr('table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('field-name', 'BusRoute');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }

//                if ($(selected).text().toLowerCase() == "previousstandard") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'PreviousStandard');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "referenceremark") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'ReferenceRemark');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "lcnumber") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'LCNumber');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }

//                if ($(selected).text().toLowerCase() == "admissionstandard") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'AdmissionStandardId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sSetup.tClassMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "fatherorganization") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'FatherOrganization');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "fatherdesignation") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'FatherDesignation');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "motherorganization") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'MotherOrganization');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "motherdesignation") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'MotherDesignation');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "relativeorganization") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'RelativeOrganization');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "relativedesignation") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'RelativeDesignation');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "relativedesignation") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'RelativeDesignation');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "isallergy") {
//                    $(this).attr('table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('field-name', 'IsAllergy');
//                    $(this).attr('control-type', 'RB');
//                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "allergyremark") {
//                    $(this).attr('table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('field-name', 'AllergyRemark');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "number") {
//                    $(this).attr('table-name', 'sStudent.tStudentMaster');
//                    $(this).attr('field-name', 'Number');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "statusname") {
//                    $(this).attr('table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('field-name', 'StatusName');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "transportmode") {
//                    $(this).attr('table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('field-name', 'TransportModeId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sCommon.tTransportModeMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "busroutedestination") {
//                    $(this).attr('table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('field-name', 'BusRouteDestination');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "admissionquota") {
//                    $(this).attr('table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('field-name', 'AdmissionQuota');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sCommon.tAdmissionQuotaMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "divisionorder") {
//                    $(this).attr('table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('field-name', 'DivisionOrder');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "classorderindex") {
//                    $(this).attr('table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('field-name', 'ClassOrderIndex');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "classorderindex") {
//                    $(this).attr('table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('field-name', 'ClassOrderIndex');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "studentbatchstatus") {
//                    $(this).attr('table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('field-name', 'StudentBatchStatus');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sStudent.tEnrollmentStatusMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "name") {
//                    $(this).attr('table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('field-name', 'Name');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "statusname") {
//                    $(this).attr('table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('field-name', 'StatusName');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "maritalstatusid") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'MaritalStatusId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sCommon.tMaritalStatusMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "gender") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'GenderId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sCommon.tGenderMaster');
//                    $(this).attr('IsManditory', 'T');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "castecategory") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'CastCategoryId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sCommon.tCastCategoryMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "studentemail") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'StudentEmail');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "isallergy") {
//                    $(this).attr('table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('field-name', 'IsAllergy');
//                    $(this).attr('control-type', 'C');
//                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "allergyremark") {
//                    $(this).attr('table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('field-name', 'AllergyRemark');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "isphysicaldeformity") {
//                    $(this).attr('table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('field-name', 'IsPysicalDeformity');
//                    $(this).attr('control-type', 'C');
//                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "physicaldeformityremark") {
//                    $(this).attr('table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('field-name', 'PysicalDeformityRemark');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }

//                if ($(selected).text().toLowerCase() == "ismajorillness") {
//                    $(this).attr('table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('field-name', 'IsMajorIllness');
//                    $(this).attr('control-type', 'C');
//                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "majorillnessremark") {
//                    $(this).attr('table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('field-name', 'MajorIllnessRemark');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "isfatherexstudent") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'IsFatherExStudent');
//                    $(this).attr('control-type', 'C');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "ismotherexstudent") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'IsMotherExStudent');
//                    $(this).attr('control-type', 'C');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "istfws") {
//                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('field-name', 'IsTFWS');
//                    $(this).attr('control-type', 'C');
//                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "istransfer") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'IsTransfer');
//                    $(this).attr('control-type', 'C');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "iscertificateholder") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'IsCertificateHolder');
//                    $(this).attr('control-type', 'C');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "lccopy") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'LcCopy');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "leftstandard") {
//                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
//                    $(this).attr('field-name', 'LeftStandardId');
//                    $(this).attr('control-type', 'D');
//                    $(this).attr('master-table-name', 'sSetup.tClassMaster');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'D');
//                }
//                if ($(selected).text().toLowerCase() == "relativename") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'RelativeName');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "relativedateofbirth") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'RelativeDateOfBirth');
//                    $(this).attr('control-type', 'DP');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "relativeoccupation") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'RelativeOccupation');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "relativequalification") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'RelativeQualification');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "relativecontactno") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'RelativeContactNo');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "relativemail") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'RelativeMail');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "relativeofficeaddress") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'RelativeOfficeAddress');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "relativeincome") {
//                    $(this).attr('table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('field-name', 'RelativeIncome');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "presentaddress") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'PresentAddress');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "permanentaddress") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'PermanentAddress');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "emergencyaddress") {
//                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('field-name', 'EmergencyAddress');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }
//                if ($(selected).text().toLowerCase() == "familysubcast") {
//                    $(this).attr('table-name', 'sStudent.tStudentOther');
//                    $(this).attr('field-name', 'FamilySubCast');
//                    $(this).attr('control-type', 'T');
//                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
//                    $(this).attr('IsManditory', 'F');
//                    $(this).attr('IsEnabled', 'E');
//                }

//            });




//        }
//        else {
//            alert('Please select at least one value from list box');
//        }
//    }
//    else {
//        if ($("#drpSelectedFields option:selected").length > 0) {
//            $("#drpSelectedFields option:selected").remove();
//        }
//        else {
//            alert('Please select at least one value from list box');
//        }
//    }
//    if ($("#drpSelectedFields option").length > 0) {
//        $('#btnGenerateReport').attr('onclick', 'GenerateReport();');
//    }
//    else {
//        $('#btnGenerateReport').removeAttr('onclick');
//    }
//}

function AppendSelected(flag) {

    if (flag == 1) {

        if ($("#drpAvailableFields option:selected").length > 0) {
            if ($("#drpAvailableFields option:selected").length == 1) {
                var option = new Option($('#drpAvailableFields').val(), "value");
                var dup = false;
                $('#drpSelectedFields option').each(function (i, selected) {

                    if ($(selected).text() == $('#drpAvailableFields').val()) {
                        dup = true;
                    }

                });
                if (dup == false) {

                    $('#drpSelectedFields').append(option);
                }
            }
            else {
                $("#drpAvailableFields option:selected").each(function (index, element) {
                    var dup = false;
                    var sTexts = $(this).val();
                    $('#drpSelectedFields option').each(function (i, selected) {

                        if ($(selected).text() == sTexts) {
                            debugger
                            dup = true;
                        }

                    });
                    if (dup == false) {
                        debugger;
                        sTexts = sTexts.replace("|", "[").replace("||", "]");
                        var option = new Option(sTexts, "value");
                        //option.text().replace("|", "[").replace("||", "]"));
                        $('#drpSelectedFields').append(option);

                    }
                });
            }
            //debugger;
            //if ($("#drpSelectedFields").children().length == "0") {
            //    $(".btn-primary").css('display', 'none');
            //}
            //else {
            //    if ($("#tblStudentList").find("td").html() != "No Records Available") {
            //        $(".btn-primary").css('display', '');
            //    }
            //    else {
            //        $(".btn-primary").css('display', 'none');
            //    }
            //}
            $('#drpSelectedFields option').each(function (i, selected) {

                //alert($(selected).text());
                if ($(selected).text().toLowerCase() == "rollno") {
                    $(this).attr('table-name', 'sStudent.tAcademic');
                    $(this).attr('field-name', 'rollno');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tAcademic');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');

                }
                if ($(selected).text().toLowerCase() == "batch") {
                    $(this).attr('table-name', 'sStudent.tAcademic');
                    $(this).attr('field-name', 'BatchId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sSetup.tBatchMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "suid") {
                    $(this).attr('table-name', 'sStudent.tStudentMaster');
                    $(this).attr('field-name', 'SUId');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentUIdMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "id no") {
                    $(this).attr('table-name', 'sStudent.tStudentMaster');
                    $(this).attr('field-name', 'Code');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }

                if ($(selected).text().toLowerCase() == "firstname") {
                    $(this).attr('table-name', 'sStudent.tStudentMaster');
                    $(this).attr('field-name', 'FirstName');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentMaster');
                    $(this).attr('IsManditory', 'T');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "middlename") {
                    $(this).attr('table-name', 'sStudent.tStudentMaster');
                    $(this).attr('field-name', 'MiddleName');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "lastname") {
                    $(this).attr('table-name', 'sStudent.tStudentMaster');
                    $(this).attr('field-name', 'LastName');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "classname") {
                    $(this).attr('table-name', 'sStudent.vStudentAcademic');
                    $(this).attr('field-name', 'ClassId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sSetup.tClassMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "divisionname") {
                    $(this).attr('table-name', 'sStudent.vStudentAcademic');
                    $(this).attr('field-name', 'DivisionId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sSetup.tDivisionMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "divisionname") {
                    $(this).attr('table-name', 'sStudent.vStudentAcademic');
                    $(this).attr('field-name', 'DivisionId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sSetup.tDivisionMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }

                if ($(selected).text().toLowerCase() == "uidnumber") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'UIDNumber');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "adhaarnumber") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'AdhaarNumber');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "dateofbirth") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'DateOfBirth');
                    $(this).attr('control-type', 'DP');
                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
                    $(this).attr('IsManditory', 'T');
                    $(this).attr('IsEnabled', 'E');
                }

                if ($(selected).text().toLowerCase() == "birthdateinword") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'BirthDateInWord');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "bloodgroup") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'BloodGroupId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sCommon.tBloodGroupMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "birthplace") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'BirthPlace');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "birthtaluka") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'BirthTaluka');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "birthdistrict") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'BirthDistrict');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "familycaste") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'FamilyCast');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "castcategoryid") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'CastCategoryId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sCommon.tCastCategoryMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "religion") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'ReligionId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sCommon.tReligionMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "house") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'HouseId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sActivity.tHouseMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "mothertongue") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'MotherTongue');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sCommon.tMotherTongueMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "nationality") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'NationalityId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sCommon.tCountryMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hobby") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'Hobby');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sCommon.tStudentOther');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "identificationmark1") {
                    $(this).attr('table-name', 'sStudent.tStudentHealth');
                    $(this).attr('field-name', 'IdentificationMark1');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "identificationmark2") {
                    $(this).attr('table-name', 'sStudent.tStudentHealth');
                    $(this).attr('field-name', 'identificationmark2');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "pysicalDeformityremark") {
                    $(this).attr('table-name', 'sStudent.tStudentHealth');
                    $(this).attr('field-name', 'PysicalDeformityRemark');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "majorillnessremark") {
                    $(this).attr('table-name', 'sStudent.tStudentHealth');
                    $(this).attr('field-name', 'MajorIllnessRemark');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "majorillnessremark") {
                    $(this).attr('table-name', 'sStudent.tStudentHealth');
                    $(this).attr('field-name', 'MajorIllnessRemark');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "majorillnessremark") {
                    $(this).attr('table-name', 'sStudent.tStudentHealth');
                    $(this).attr('field-name', 'MajorIllnessRemark');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "familydoctorname") {
                    $(this).attr('table-name', 'sStudent.tStudentHealth');
                    $(this).attr('field-name', 'FamilyDoctorName');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "familydoctorcontactno") {
                    $(this).attr('table-name', 'sStudent.tStudentHealth');
                    $(this).attr('field-name', 'FamilyDoctorContactNo');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "presentstreetone") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'PresentStreetOne');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "presentstreettwo") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'PresentStreetTwo');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "presentstreetthree") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'PresentStreetThree');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "presentcountry") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'PresentCountry');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "presentstate") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'PresentState');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "presentcity") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'PresentCity');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "presentzipcode") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'PresentZipCode');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "presentcontactno") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'PresentContactNo');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "permanentstreetone") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'PermanentStreetOne');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "permanentstreettwo") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'PermanentStreetTwo');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "permanentstreetthree") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'PermanentStreetThree');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "permanentcountry") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'PermanentCountry');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "permanentstate") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'PermanentState');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "permanentcity") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'PermanentCity');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "permanentzipcode") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'PermanentZipCode');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "permanentcontactno") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'PermanentContactNo');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "emergencystreetone") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'EmergencyStreetOne');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "emergencystreettwo") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'EmergencyStreetTwo');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "emergencystreetthree") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'EmergencyStreetThree');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "emergencycountry") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'EmergencyCountry');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "emergencycountry") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'EmergencyCountry');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "emergencystate") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'EmergencyState');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "emergencycity") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'EmergencyCity');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "emergencyzipcode") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'EmergencyZipCode');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "emergencycontactno") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'EmergencyContactNo');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "parentcontactno") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'ParentContactNo');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "whatsappcontactno") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'WhatsAppContactNo');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "parentemail") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'ParentEmail');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "studentcontactno") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'StudentContactNo');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "fathername") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'FatherName');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "fathername") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'FatherName');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "fatherdateofbirth") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'FatherDateOfBirth');
                    $(this).attr('control-type', 'DP');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "fatherqualification") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'FatherQualification');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "fatheroccupation") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'FatherOccupation');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "fathercontactno") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'FatherContactNo');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "fathermail") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'FatherMail');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "fatherofficecontactno") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'FatherOfficeContactNo');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "fatherofficeaddress") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'FatherOfficeAddress');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "fatherannualincome") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'FatherIncome');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "mothername") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'MotherName');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "motherdateofbirth") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'MotherDateOfBirth');
                    $(this).attr('control-type', 'DP');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "motherqualification") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'MotherQualification');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "motheroccupation") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'MotherOccupation');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "mothercontactno") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'MotherContactNo');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "mothermail") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'MotherMail');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "motherofficecontactno") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'MotherOfficeContactNo');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "motherofficeaddress") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'MotherOfficeAddress');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "motherannualincome") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'MotherIncome');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "motherannualincome") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'MotherIncome');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "admissioncategory") {
                    $(this).attr('table-name', 'sStudent.tStudentMaster');
                    $(this).attr('field-name', 'AdmissionCategoryId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sStudent.tAdmissionCategoryMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "previousschool") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'PreviousSchool');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "admissiondate") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'AdmissionDate');
                    $(this).attr('control-type', 'DP');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "admissionformnumber") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'AdmissionFormNumber');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "admissionnumber") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'AdmissionNumber');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "transferfrom") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'TransferFrom');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }

                if ($(selected).text().toLowerCase() == "passingyear") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'PassingYear');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "certificatename") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'CertificateName');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }

                if ($(selected).text().toLowerCase() == "inactivedate") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'InactiveDate');
                    $(this).attr('control-type', 'DP');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "inactivereason") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'InActiveReason');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "lcbook") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'LCBook');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "lcbook") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'LCBook');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "leftdate") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'LeftDate');
                    $(this).attr('control-type', 'DP');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "lcdate") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'LcDate');
                    $(this).attr('control-type', 'DP');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "lcbook") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'LCBook');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "leftreason") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'LeftReason');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "lcprogress") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'LCProgress');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "lcconduct") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'LCConduct');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "lcremark") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'LCRemark');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "lcremark") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'LCRemark');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "blacklistreason") {
                    $(this).attr('table-name', 'sStudent.tStudentMaster');
                    $(this).attr('field-name', 'BlackListReason');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "bankaccountnumber") {
                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('field-name', 'BankAccountNumber');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "bankname") {
                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('field-name', 'BankName');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "bankname") {
                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('field-name', 'BankName');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "bankbranch") {
                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('field-name', 'BankBranch');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "bankbranch") {
                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('field-name', 'BankBranch');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "bankifsccode") {
                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('field-name', 'BankIFSCCode');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "bankifsccode") {
                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('field-name', 'BankIFSCCode');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "bankaccountholdername") {
                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('field-name', 'BankAccountHolderName');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "class9boardregistrationnumber") {
                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('field-name', 'Class9BoardRegistrationNumber');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "class11boardregistrationnumber") {
                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('field-name', 'Class11BoardRegistrationNumber');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "passportnumber") {
                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('field-name', 'PassportNumber');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }

                if ($(selected).text().toLowerCase() == "passporttype") {
                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('field-name', 'PassportType');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "passportcountrycode") {
                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('field-name', 'PassportCountryCode');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "passportissuedate") {
                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('field-name', 'PassportIssueDate');
                    $(this).attr('control-type', 'DP');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "passportexpirydate") {
                    $(this).attr('table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('field-name', 'PassportExpiryDate');
                    $(this).attr('control-type', 'DP');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdditional');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "siblingname1") {
                    $(this).attr('table-name', 'sStudent.tStudentSibling');
                    $(this).attr('field-name', 'SiblingName1');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "siblinginstitue1") {
                    $(this).attr('table-name', 'sStudent.tStudentSibling');
                    $(this).attr('field-name', 'siblinginstitue1');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "siblingclass1") {
                    $(this).attr('table-name', 'sStudent.tStudentSibling');
                    $(this).attr('field-name', 'SiblingClass1');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "siblingage1") {
                    $(this).attr('table-name', 'sStudent.tStudentSibling');
                    $(this).attr('field-name', 'SiblingAge1');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "siblingrelation1") {
                    $(this).attr('table-name', 'sStudent.tStudentSibling');
                    $(this).attr('field-name', 'SiblingRelation1');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "siblingname2") {
                    $(this).attr('table-name', 'sStudent.tStudentSibling');
                    $(this).attr('field-name', 'SiblingName2');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "siblinginstitue2") {
                    $(this).attr('table-name', 'sStudent.tStudentSibling');
                    $(this).attr('field-name', 'SiblingInstitue2');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "siblingclass2") {
                    $(this).attr('table-name', 'sStudent.tStudentSibling');
                    $(this).attr('field-name', 'SiblingClass2');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "siblingage2") {
                    $(this).attr('table-name', 'sStudent.tStudentSibling');
                    $(this).attr('field-name', 'SiblingAge2');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "siblingrelation2") {
                    $(this).attr('table-name', 'sStudent.tStudentSibling');
                    $(this).attr('field-name', 'SiblingRelation2');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "siblingname3") {
                    $(this).attr('table-name', 'sStudent.tStudentSibling');
                    $(this).attr('field-name', 'SiblingName3');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "siblinginstitue3") {
                    $(this).attr('table-name', 'sStudent.tStudentSibling');
                    $(this).attr('field-name', 'SiblingInstitue3');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "siblingclass3") {
                    $(this).attr('table-name', 'sStudent.tStudentSibling');
                    $(this).attr('field-name', 'SiblingClass3');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "siblingage3") {
                    $(this).attr('table-name', 'sStudent.tStudentSibling');
                    $(this).attr('field-name', 'SiblingAge3');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "siblingrelation3") {
                    $(this).attr('table-name', 'sStudent.tStudentSibling');
                    $(this).attr('field-name', 'SiblingRelation3');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentSibling');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "sscboard") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'SSCBoard');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "sscschool") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'SSCSchool');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "sscpassingyear") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'SSCPassingYear');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "sscobtainmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'SSCObtainMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "sscoutofmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'SSCOutOfMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "sscpercentage") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'SSCPercentage');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "sscmathmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'SSCMathMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "sscmathoutofmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'SSCMathOutOfMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscboard") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCBoard');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscschool") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCSchool');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscpassingyear") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCPassingYear');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscobtainmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCObtainMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscoutofmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCOutOfMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscpercentage") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCPercentage');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscbiologymarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCBiologyMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscbiologyoutofmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCBiologyOutOfMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscchemistrymarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCChemistryMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscchemistryoutofmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCChemistryOutOfMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscmathmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCMathMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscmathoutofmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCMathOutOfMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscphysicsmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCPhysicsMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscphysicsoutofmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCPhysicsOutOfMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "pcmmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'PCMMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscboard") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCBoard');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscschool") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCSchool');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscpassingyear") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCPassingYear');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscobtainmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCObtainMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscoutofmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCOutOfMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscpercentage") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCPercentage');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscbiologymarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCBiologyMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscbiologyoutofmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCBiologyOutOfMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscchemistrymarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCChemistryMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscchemistryoutofmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCChemistryOutOfMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscmathmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCMathMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscmathoutofmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCMathOutOfMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscphysicsmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCPhysicsMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hscphysicsoutofmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'HSCPhysicsOutOfMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "pcmmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'PCMMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "pcbmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'PCBMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "jeerollno") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'JEERollNo');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "jeemeritno") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'JEEMeritNo');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "jeemeritmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'JEEMeritMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "jeeoutofmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'JEEOutOfMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "diplomaboard") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'DiplomaBoard');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "diplomacollege") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'DiplomaCollege');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "diplomapassingyear") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'DiplomaPassingYear');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "diplomaobtainmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'DiplomaObtainMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "diplomaoutofmarks") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'DiplomaOutOfMarks');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "diplomapercentage") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'DiplomaPercentage');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "applicationno") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'ApplicationNo');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "admissionround") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'AdmissionRound');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "admissionround") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'AdmissionRound');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "hostelname") {
                    $(this).attr('table-name', 'sStudent.vStudentDetails');
                    $(this).attr('field-name', 'HostelId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sHostel.tHostelMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "room") {
                    $(this).attr('table-name', 'sStudent.vStudentDetails');
                    $(this).attr('field-name', 'RoomId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sHostel.tRoomMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "buildingname") {
                    $(this).attr('table-name', 'sStudent.vStudentDetails');
                    $(this).attr('field-name', 'BuildingName');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sHostel.tBuildingMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "bednumber") {
                    $(this).attr('table-name', 'sStudent.vStudentDetails');
                    $(this).attr('field-name', 'BedNumber');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "studentgroup") {
                    $(this).attr('table-name', 'sStudent.tStudentMaster');
                    $(this).attr('field-name', 'StudentGroupId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sStudent.tStudentGroupMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "studentothergroup") {
                    $(this).attr('table-name', 'sStudent.tStudentMaster');
                    $(this).attr('field-name', 'StudentOtherGroupId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sStudent.tStudentOtherGroupMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "birthstate") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'BirthState');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "birthcountry") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'BirthCountry');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "pickuptime") {
                    $(this).attr('table-name', 'sStudent.vStudentDetails');
                    $(this).attr('field-name', 'PickupTime');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "droptime") {
                    $(this).attr('table-name', 'sStudent.vStudentDetails');
                    $(this).attr('field-name', 'Droptime');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "busroute") {
                    $(this).attr('table-name', 'sStudent.vStudentDetails');
                    $(this).attr('field-name', 'BusRoute');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }

                if ($(selected).text().toLowerCase() == "previousstandard") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'PreviousStandard');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "referenceremark") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'ReferenceRemark');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "lcnumber") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'LCNumber');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }

                if ($(selected).text().toLowerCase() == "admissionstandard") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'AdmissionStandardId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sSetup.tClassMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "fatherorganization") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'FatherOrganization');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "fatherdesignation") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'FatherDesignation');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "motherorganization") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'MotherOrganization');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "motherdesignation") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'MotherDesignation');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "relativeorganization") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'RelativeOrganization');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "relativedesignation") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'RelativeDesignation');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "relativedesignation") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'RelativeDesignation');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "isallergy") {
                    $(this).attr('table-name', 'sStudent.vStudentDetails');
                    $(this).attr('field-name', 'IsAllergy');
                    $(this).attr('control-type', 'RB');
                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "allergyremark") {
                    $(this).attr('table-name', 'sStudent.tStudentHealth');
                    $(this).attr('field-name', 'AllergyRemark');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "number") {
                    $(this).attr('table-name', 'sStudent.tStudentMaster');
                    $(this).attr('field-name', 'Number');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "statusname") {
                    $(this).attr('table-name', 'sStudent.vStudentDetails');
                    $(this).attr('field-name', 'StatusName');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "transportmode") {
                    $(this).attr('table-name', 'sStudent.vStudentDetails');
                    $(this).attr('field-name', 'TransportModeId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sCommon.tTransportModeMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "busroutedestination") {
                    $(this).attr('table-name', 'sStudent.vStudentDetails');
                    $(this).attr('field-name', 'BusRouteDestination');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "admissionquota") {
                    $(this).attr('table-name', 'sStudent.vStudentDetails');
                    $(this).attr('field-name', 'AdmissionQuota');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sCommon.tAdmissionQuotaMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "divisionorder") {
                    $(this).attr('table-name', 'sStudent.vStudentDetails');
                    $(this).attr('field-name', 'DivisionOrder');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "classorderindex") {
                    $(this).attr('table-name', 'sStudent.vStudentDetails');
                    $(this).attr('field-name', 'ClassOrderIndex');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "classorderindex") {
                    $(this).attr('table-name', 'sStudent.vStudentDetails');
                    $(this).attr('field-name', 'ClassOrderIndex');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "studentbatchstatus") {
                    $(this).attr('table-name', 'sStudent.vStudentDetails');
                    $(this).attr('field-name', 'StudentBatchStatus');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sStudent.tEnrollmentStatusMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "name") {
                    $(this).attr('table-name', 'sStudent.vStudentDetails');
                    $(this).attr('field-name', 'Name');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "statusname") {
                    $(this).attr('table-name', 'sStudent.vStudentDetails');
                    $(this).attr('field-name', 'StatusName');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.vStudentDetails');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "maritalstatusid") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'MaritalStatusId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sCommon.tMaritalStatusMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "gender") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'GenderId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sCommon.tGenderMaster');
                    $(this).attr('IsManditory', 'T');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "castecategory") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'CastCategoryId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sCommon.tCastCategoryMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "studentemail") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'StudentEmail');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "isallergy") {
                    $(this).attr('table-name', 'sStudent.tStudentHealth');
                    $(this).attr('field-name', 'IsAllergy');
                    $(this).attr('control-type', 'C');
                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "allergyremark") {
                    $(this).attr('table-name', 'sStudent.tStudentHealth');
                    $(this).attr('field-name', 'AllergyRemark');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "isphysicaldeformity") {
                    $(this).attr('table-name', 'sStudent.tStudentHealth');
                    $(this).attr('field-name', 'IsPysicalDeformity');
                    $(this).attr('control-type', 'C');
                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "physicaldeformityremark") {
                    $(this).attr('table-name', 'sStudent.tStudentHealth');
                    $(this).attr('field-name', 'PysicalDeformityRemark');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }

                if ($(selected).text().toLowerCase() == "ismajorillness") {
                    $(this).attr('table-name', 'sStudent.tStudentHealth');
                    $(this).attr('field-name', 'IsMajorIllness');
                    $(this).attr('control-type', 'C');
                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "majorillnessremark") {
                    $(this).attr('table-name', 'sStudent.tStudentHealth');
                    $(this).attr('field-name', 'MajorIllnessRemark');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentHealth');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "isfatherexstudent") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'IsFatherExStudent');
                    $(this).attr('control-type', 'C');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "ismotherexstudent") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'IsMotherExStudent');
                    $(this).attr('control-type', 'C');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "istfws") {
                    $(this).attr('table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('field-name', 'IsTFWS');
                    $(this).attr('control-type', 'C');
                    $(this).attr('master-table-name', 'sStudent.tCollegeDetail');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "istransfer") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'IsTransfer');
                    $(this).attr('control-type', 'C');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "iscertificateholder") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'IsCertificateHolder');
                    $(this).attr('control-type', 'C');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "lccopy") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'LcCopy');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "leftstandard") {
                    $(this).attr('table-name', 'sStudent.tStudentAdmission');
                    $(this).attr('field-name', 'LeftStandardId');
                    $(this).attr('control-type', 'D');
                    $(this).attr('master-table-name', 'sSetup.tClassMaster');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'D');
                }
                if ($(selected).text().toLowerCase() == "relativename") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'RelativeName');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "relativedateofbirth") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'RelativeDateOfBirth');
                    $(this).attr('control-type', 'DP');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "relativeoccupation") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'RelativeOccupation');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "relativequalification") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'RelativeQualification');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "relativecontactno") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'RelativeContactNo');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "relativemail") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'RelativeMail');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "relativeofficeaddress") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'RelativeOfficeAddress');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "relativeannualincome") {
                    $(this).attr('table-name', 'sStudent.tStudentFamily');
                    $(this).attr('field-name', 'RelativeIncome');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentFamily');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "presentaddress") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'PresentAddress');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "permanentaddress") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'PermanentAddress');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "emergencyaddress") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'EmergencyAddress');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "familysubcast") {
                    $(this).attr('table-name', 'sStudent.tStudentOther');
                    $(this).attr('field-name', 'FamilySubCast');
                    $(this).attr('control-type', 'T');
                    $(this).attr('master-table-name', 'sStudent.tStudentOther');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
                if ($(selected).text().toLowerCase() == "isstopapplicationaccess") {
                    $(this).attr('table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('field-name', 'IsStopApplicationAccess');
                    $(this).attr('control-type', 'C');
                    $(this).attr('master-table-name', 'sStudent.tStudentCommunication');
                    $(this).attr('IsManditory', 'F');
                    $(this).attr('IsEnabled', 'E');
                }
            });

        }
        else {
            alert('Please select at least one value from list box');
        }
    }
    else {
        if ($("#drpSelectedFields option:selected").length > 0) {
            $("#drpSelectedFields option:selected").remove();
        }
        else {
            alert('Please select at least one value from list box');
        }
    }
    if ($("#drpSelectedFields option").length > 0) {
        $('#btnGenerateReport').attr('onclick', 'GenerateReport();');
    }
    else {
        $('#btnGenerateReport').removeAttr('onclick');
    }
}
function UpDownSelected(flag) {
    if ($("#drpSelectedFields option:selected").length > 0) {
        var $op = $('#drpSelectedFields option:selected');
        if ($op.length) {
            (flag == '1') ? $op.first().prev().before($op) : $op.last().next().after($op);
        }
    }
}
function AppendSelectedO(flag) {
    if (flag == 1) {
        if ($("#drpAvailableFieldsO option:selected").length > 0) {
            if ($("#drpAvailableFieldsO option:selected").length == 1) {
                var option = new Option($('#drpAvailableFieldsO').val(), "value");
                var dup = false;
                $('#drpSelectedFieldsO option').each(function (i, selected) {
                    if ($(selected).text() == $('#drpAvailableFields').val()) {
                        dup = true;
                    }
                });
                if (dup == false) {
                    $('#drpSelectedFieldsO').append(option);
                }
            }
            else {
                $("#drpAvailableFieldsO option:selected").each(function (index, element) {
                    var dup = false;
                    var sTexts = $(this).val();
                    $('#drpSelectedFieldsO option').each(function (i, selected) {
                        if ($(selected).text() == sTexts) {
                            dup = true;
                        }
                    });
                    if (dup == false) {
                        sTexts = sTexts.replace("|", "[").replace("||", "]");
                        var option = new Option(sTexts, "value");
                        $('#drpSelectedFieldsO').append(option);
                    }
                });
            }
        }
        else {
            alert('Please select at least one value from list box');
        }
    }
    else {
        if ($("#drpSelectedFieldsO option:selected").length > 0) {
            $("#drpSelectedFieldsO option:selected").remove();
        }
        else {
            alert('Please select at least one value from list box');
        }
    }
}
function UpDownSelectedO(flag) {
    if ($("#drpSelectedFieldsO option:selected").length > 0) {
        var $op = $('#drpSelectedFieldsO option:selected');
        if ($op.length) {
            (flag == '1') ? $op.first().prev().before($op) : $op.last().next().after($op);
        }
    }
}
function SearchStudents() {
    if ($('#drpGroupBatch').val() > 0) {
        //alert("hi");
        $.ajax({
            type: "POST",
            url: URL + "/GetSession",
            data: '{}',
            contentType: "application/json;charset=utf-8",
            dataType: "json",
            success: function (dt) {
                if (dt.d > 0) {
                    LoadingMessage('Loading Details', '<b>Please Wait ...</b>');
                    var OrderByStr = '', ClassStr = '', StatusStr = '', GenderStr = '', ReligionStr = '';
                    var CastCatStr = '', CityStr = '', AreaStr = '', CountryStr = '', TransportStr = '';
                    var BusRouteStr = '', DestinationStr = '', BloodGroupStr = '', HouseStr = '';
                    var TongueStr = '', SchoolStr = '', fQualificationStr = '', mQualificationStr = '';
                    var fOccupationStr = '', mOccupationStr = '', AdmissionStr = '', TagStr = '', GroupStr = '';
                    var ClubStr = '', HostelStr = '', sGroupStr = '', sOtherGroupStr = '', ExemptionStr = '', RecordTagStr = '';


                    if ($('#txtBirthday').val() != '')
                        $('#txtBirthday').val();
                    else
                        $('#txtBirthday').val(0);

                    if ($('#ddlMonth').val() != '')
                        $('#ddlMonth').val();
                    else
                        $('#ddlMonth').val(0);

                    $('#classchkdropdown option:selected').each(function (i, sel) {
                        ClassStr = ClassStr + $(sel).val() + ',';
                    });
                    $('#Statuschkdropdown option:selected').each(function (i, sel) {

                        StatusStr = StatusStr + $(sel).val() + ',';
                    });
                    $('#Genderchkdropdown option:selected').each(function (i, sel) {
                        GenderStr = GenderStr + $(sel).val() + ',';
                    });
                    $('#Religionchkdropdown option:selected').each(function (i, sel) {
                        ReligionStr = ReligionStr + $(sel).val() + ',';
                    });
                    $('#castecategorychkdropdown option:selected').each(function (i, sel) {
                        CastCatStr = CastCatStr + $(sel).val() + ',';
                    });
                    $('#citychkdropdown option:selected').each(function (i, sel) {
                        CityStr = CityStr + $(sel).val() + ',';
                    });
                    $('#Areachkdropdown option:selected').each(function (i, sel) {
                        AreaStr = AreaStr + $(sel).val() + ',';
                    });
                    $('#nationalitychkdropdown option:selected').each(function (i, sel) {
                        CountryStr = CountryStr + $(sel).val() + ',';
                    });
                    $("#transportmodechkdropdown option:selected").each(function (index, element) {
                        TransportStr = TransportStr + $(this).val() + ',';
                    });
                    $('#Busroutechkdropdown option:selected').each(function (i, sel) {
                        BusRouteStr = BusRouteStr + $(sel).val() + ',';
                    });
                    $('#Routedestinationchkdropdown option:selected').each(function (i, sel) {
                        DestinationStr = DestinationStr + $(sel).val() + ',';
                    });
                    $('#bloodgroupchkdropdown option:selected').each(function (i, sel) {
                        BloodGroupStr = BloodGroupStr + $(sel).val() + ',';
                    });
                    $('#HOusechkdropdown option:selected').each(function (i, sel) {
                        HouseStr = HouseStr + $(sel).val() + ',';
                    });
                    $('#mothertoungechkdropdown option:selected').each(function (i, sel) {
                        TongueStr = TongueStr + $(sel).val() + ',';
                    });
                    $('#Priviosschoolchkdropdown option:selected').each(function (i, sel) {
                        SchoolStr = SchoolStr + $(sel).text() + ',';
                    });
                    $('#Fatherqulificationchkdropdown option:selected').each(function (i, sel) {
                        fQualificationStr = fQualificationStr + $(sel).text() + ',';
                    });
                    $('#Motherqulificationchkdropdown option:selected').each(function (i, sel) {
                        mQualificationStr = mQualificationStr + $(sel).text() + ',';
                    });
                    $("#FatherOccupationchkdropdown option:selected").each(function (index, element) {
                        fOccupationStr = fOccupationStr + $(this).text() + ',';
                    });
                    $('#MotherOccupationchkdropdown option:selected').each(function (i, sel) {
                        mOccupationStr = mOccupationStr + $(sel).text() + ',';
                    });
                    $('#Feescatrefgorychkdropdown option:selected').each(function (i, sel) {
                        AdmissionStr = AdmissionStr + $(sel).val() + ',';
                    });
                    $('#customtagchkdropdown option:selected').each(function (i, sel) {
                        TagStr = TagStr + $(sel).val() + ',';
                    });
                    $('#Customgroupchkdropdown option:selected').each(function (i, sel) {
                        GroupStr = GroupStr + $(sel).val() + ',';
                    });
                    $('#Clubchkdropdown option:selected').each(function (i, sel) {
                        ClubStr = ClubStr + $(sel).val() + ',';
                    });
                    $('#Hostelchkdropdown option:selected').each(function (i, sel) {
                        HostelStr = HostelStr + $(sel).val() + ',';
                    });
                    $("#Studentgroupchkdropdown option:selected").each(function (i, sel) {
                        sGroupStr = sGroupStr + $(sel).val() + ',';
                    });
                    $('#studentothergroupchkdropdown option:selected').each(function (i, sel) {
                        sOtherGroupStr = sOtherGroupStr + $(sel).val() + ',';
                    });
                    $('#excemptiontypechkdropdown option:selected').each(function (i, sel) {
                        ExemptionStr = ExemptionStr + $(sel).val() + ',';
                    });
                    $('#recordtagchkdropdown option:selected').each(function (i, sel) {
                        RecordTagStr = RecordTagStr + $(sel).val() + ',';
                    });

                    if ($('#chkClass').is(':checked')) {
                        $('#dvClass').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                ClassStr = ClassStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkStatus').is(':checked')) {
                        $('#dvStatus').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                StatusStr = StatusStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkGender').is(':checked')) {
                        $('#dvGender').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                GenderStr = GenderStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkReligion').is(':checked')) {
                        $('#dvReligion').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                ReligionStr = ReligionStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkCastCategory').is(':checked')) {
                        $('#dvCastCategory').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                CastCatStr = CastCatStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkCity').is(':checked')) {
                        $('#dvCity').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                CityStr = CityStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkArea').is(':checked')) {
                        $('#dvArea').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                AreaStr = AreaStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkNationality').is(':checked')) {
                        $('#dvNationality').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                CountryStr = CountryStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkTransportMode').is(':checked')) {
                        $('#dvTransportMode').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                TransportStr = TransportStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkBusRoute').is(':checked')) {
                        $('#dvBusRoute').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                BusRouteStr = BusRouteStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkBusRouteDestination').is(':checked')) {
                        $('#dvBusRouteDestination').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                DestinationStr = DestinationStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkBloodGroup').is(':checked')) {
                        $('#dvBloodGroup').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                BloodGroupStr = BloodGroupStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkHouse').is(':checked')) {
                        $('#dvHouse').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                HouseStr = HouseStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkMotherTongue').is(':checked')) {
                        $('#dvMotherTongue').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                TongueStr = TongueStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkPreSchool').is(':checked')) {
                        $('#dvPreSchool').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                SchoolStr = SchoolStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkFatherQ').is(':checked')) {
                        $('#dvFatherQ').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                fQualificationStr = fQualificationStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkMotherQ').is(':checked')) {
                        $('#dvMotherQ').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                mQualificationStr = mQualificationStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkFatherO').is(':checked')) {
                        $('#dvFatherO').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                fOccupationStr = fOccupationStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkMotherO').is(':checked')) {
                        $('#dvMotherO').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                mOccupationStr = mOccupationStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkAdmissionCat').is(':checked')) {
                        $('#dvAdmissionCat').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                AdmissionStr = AdmissionStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkCustomTag').is(':checked')) {
                        $('#dvCustomTag').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                TagStr = TagStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkCustomGroup').is(':checked')) {
                        $('#dvCustomGroup').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                GroupStr = GroupStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkClub').is(':checked')) {
                        $('#dvClub').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                ClubStr = ClubStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkHostel').is(':checked')) {
                        $('#dvHostel').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                HostelStr = HostelStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkStudentGroup').is(':checked')) {
                        $('#dvStudentGroup').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                sGroupStr = sGroupStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkStudentOtherGroup').is(':checked')) {
                        $('#dvStudentOtherGroup').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                sOtherGroupStr = sOtherGroupStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkExemptionType').is(':checked')) {
                        $('#dvExemptionType').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                ExemptionStr = ExemptionStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    if ($('#chkRecordTag').is(':checked')) {
                        $('#dvRecordTag').children('input[type=checkbox]').each(function (index, element) {
                            if ($(this).is(':checked')) {
                                RecordTagStr = RecordTagStr + $(this).attr('attrid') + ',';
                            }
                        });
                    }
                    var isPhysical = $('#chkPhisicalD').is(':checked') ? 1 : 0;
                    var isMajorILL = $('#chkMajorILL').is(':checked') ? 1 : 0;
                    var isBlackList = $('#chkBlackList').is(':checked') ? 1 : 0;
                    var isSaveReport = $('#chkSaveReport').is(':checked') ? 1 : 0;
                    var isCommon = $('#chkIsCommon').is(':checked') ? 1 : 0;
                    var isCommonForOrg = $('#chkIsCommonForOrg').is(':checked') ? 1 : 0;
                    var obj = {


                        "DepartmentId": $('#drpDepartment').val(),
                        //"MonthId":$('#ddlMonth').val(),
                        "ClassId": $('#drpClass').val(),
                        "DivisionId": $('#drpDivision').val(),
                        "StatusId": $('#drpStatus').val(),
                        "IdNumber": '',
                        "FirstName": $('#txtFirstName').val(),
                        "LastName": $('#txtLastName').val(),
                        "CountryName": $('#txtCountry').val(),
                        "StateName": $('#txtState').val(),
                        "FromDateOfBirth": $('#txtFDateOfBirth').val(),

                        "ToDateOfBirth": $('#txtTDateOfBirth').val(),
                        "FromAdmissionDate": $('#txtFAdminssionDate').val(),
                        "ToAdmissionDate": $('#txtTAdminssionDate').val(),
                        "FromLeftDate": $('#txtFLeftDate').val(),
                        "ToLeftDate": $('#txtTLeftDate').val(),
                        "Hobby": $('#txtHobby').val(),
                        "FromIdNumber": $('#txtFIdNo').val(),
                        "ToIdNumber": $('#txtTIdNo').val(),
                        "SpecificIdNumber": $('#txtSIdNo').val(),
                        "FatherName": $('#txtFather').val(),
                        "MotherName": $('#txtMother').val(),
                        //"BirthMonthStr":$('#ddlMonth').val(),
                        "OrderByStr": OrderByStr,
                        "ClassStr": ClassStr,
                        "StatusStr": StatusStr,
                        "GenderStr": GenderStr,
                        "ReligionStr": ReligionStr,
                        "CastCatStr": CastCatStr,
                        "CityStr": CityStr,
                        "AreaStr": AreaStr,
                        "CountryStr": CountryStr,
                        "TransportStr": TransportStr,
                        "BusRouteStr": BusRouteStr,
                        "DestinationStr": DestinationStr,
                        "BloodGroupStr": BloodGroupStr,
                        "HouseStr": HouseStr,
                        "TongueStr": TongueStr,
                        "SchoolStr": SchoolStr,
                        "fQualificationStr": fQualificationStr,
                        "mQualificationStr": mQualificationStr,
                        "fOccupationStr": fOccupationStr,
                        "mOccupationStr": mOccupationStr,
                        "AdmissionStr": AdmissionStr,
                        //"BirthMonthStr":BirthMonthStr,
                        "TagStr": TagStr,
                        "GroupStr": GroupStr,
                        "ClubStr": ClubStr,
                        "HostelStr": HostelStr,
                        "sGroupStr": sGroupStr,
                        "sOtherGroupStr": sOtherGroupStr,
                        "ExemptionStr": ExemptionStr,
                        "isPhysical": isPhysical,
                        "isSaveReport": isSaveReport,
                        "isMajorILL": isMajorILL,
                        "isBlackList": isBlackList,
                        "isCommon": isCommon,
                        "isCommonForOrg": isCommonForOrg,
                        "RepeatCount": $('#txtRepeatCount').val(),
                        "StudentBatchStatusId": $('#drpStudentBatchStatus').val(),
                        "StudentNotAssigned": $('#drpStudentNotAssigned').val(),

                        "ReportName": $('#txtReportName').val(),
                        "LcNumber": $('#LcnumberText').val(),
                        "PageIndex": $('#hdnPageIndex').val(),
                        "RecordTagStr": RecordTagStr,
                        "ContactNo": $('#txtContactNo').val(),
                        "OrgGroupBatchId": $('#drpGroupBatch').val(),
                        "OrganizationId": $('#drpOrganization').val(),
                        "BirthDay": $('#txtBirthday').val(),
                        "DateOfMonth": $('#ddlMonth').val(),
                        "StopApplicationAccess": $('#ddlStopApplicationAccess').val()
                    };
                    $.ajax({
                        type: "POST",
                        url: URL + "/SearchStudents",
                        data: JSON.stringify(obj),
                        contentType: "application/json;charset=utf-8",
                        dataType: "json",
                        success: function (data) {
                            var datas = $.parseJSON(data.d);
                            if (datas.StudentList != '') {
                                $('#tblStudentList').html(datas.StudentList);
                                $('#pagging').html(datas.Paging);
                                $('#lblTotalRecords').html('Total Records : ' + datas.TotalRecords + '&nbsp;&nbsp;&nbsp;&nbsp;');
                                //alert(parseFloat(datas.TotalRecords)/200);
                                var NumberPartion = datas.TotalRecords / 100;


                                if (NumberPartion == Math.floor(NumberPartion)) {

                                    if (NumberPartion == 0)
                                        return false;
                                } else {

                                    NumberPartion = Math.floor(NumberPartion) + 1;
                                    var DropDownHtml = "";
                                    var pagingsize = 100;   //change if page size increase
                                    for (i = 1; i <= NumberPartion; i++) {
                                        if (i > 1) {
                                            DropDownHtml += "<option start='" + (((i - 1) * parseInt(pagingsize)) + 1) + "' end='" + (i * parseInt(pagingsize)) + "' >" + (((i - 1) * parseInt(pagingsize)) + 1) + " - " + (i * parseInt(pagingsize)) + "</option>";
                                        }
                                        else {

                                            DropDownHtml += "<option start='1' end='" + parseInt(pagingsize) + "'>1 - " + parseInt(pagingsize) + "</option>";
                                        }

                                    }
                                    $("#customPaging").show();
                                    $("#drpCustomUpdatePaging").html(DropDownHtml);

                                    var value = $("#txtBirthday").val();
                                    if (value != 0)
                                        $('#txtBirthday').val();
                                    else
                                        $('#txtBirthday').val('');


                                }

                            }
                            else {
                                $('#tblStudentList').html('<tr><td colspan="5">No Records Available</td></tr>');
                                $('#pagging').html(datas.Paging);
                                $('#lblTotalRecords').html('Total Records : ' + datas.TotalRecords + '&nbsp;&nbsp;&nbsp;&nbsp;');
                            }
                            window.setTimeout(function () { CloseHlsPopup(); }, 400);
                        },
                        error: function (xhr, status, error) {
                            var err = eval("(" + xhr.responseText + ")");
                            console.log(err.Message);
                        }
                    });
                }
                else {
                    CloseHlsPopup();
                    LoadingMessage('Your session has expired, we are redirecting to login page', '<b>Please Wait ...</b>');
                    window.setTimeout(function () { window.location = '/Pages/BaseFramework/Security/Login.aspx'; }, 2000);
                }
            },
            error: function (xhr, status, error) {
                var err = eval("(" + xhr.responseText + ")");
                console.log(err.Message);
            }
        });
    }
    else {
        alert('please select group batch');
    }
}
function GenerateReport() {
    if ($("#drpSelectedFields option").length > 0 || parseInt($('#drpSavedReport').val()) != 0) {
        if ($("#drpSelectedFields option").length > 9 && $('#drpViewMode').val() == "PDF") {
            alert('Select maximum 8 custom fields');
        }
        else {
            $.ajax({
                type: "POST",
                url: URL + "/GetSession",
                data: '{}',
                contentType: "application/json;charset=utf-8",
                dataType: "json",
                success: function (dt) {
                    if (dt.d > 0) {
                        LoadingMessage('Loading Details', '<b>Please Wait ...</b>');
                        var OrderByStr = '', ClassStr = '', StatusStr = '', GenderStr = '', ReligionStr = '';
                        var CastCatStr = '', CityStr = '', AreaStr = '', CountryStr = '', TransportStr = '';
                        var BusRouteStr = '', DestinationStr = '', BloodGroupStr = '', HouseStr = '';
                        var TongueStr = '', SchoolStr = '', fQualificationStr = '', mQualificationStr = '';
                        var fOccupationStr = '', mOccupationStr = '', AdmissionStr = '', TagStr = '', GroupStr = '';
                        var ClubStr = '', HostelStr = '', sGroupStr = '', sOtherGroupStr = '', ExemptionStr = '';
                        var CustomFields = '', RecordTagStr = '';

                        if ($('#txtBirthday').val() != '')
                            $('#txtBirthday').val();
                        else
                            $('#txtBirthday').val(0);


                        if ($('#ddlMonth').val() != '')
                            $('#ddlMonth').val();
                        else
                            $('#ddlMonth').val(0);

                        $("#drpSelectedFieldsO option").each(function (index, element) {
                            OrderByStr = OrderByStr + $(this).text() + ',';
                        });
                        $("#drpSelectedFields option").each(function (index, element) {
                            CustomFields = CustomFields + $(this).text() + ',';
                        });
                        $('#classchkdropdown option:selected').each(function (i, sel) {
                            ClassStr = ClassStr + $(sel).val() + ',';
                        });
                        $('#Statuschkdropdown option:selected').each(function (i, sel) {

                            StatusStr = StatusStr + $(sel).val() + ',';
                        });
                        $('#Genderchkdropdown option:selected').each(function (i, sel) {
                            GenderStr = GenderStr + $(sel).val() + ',';
                        });
                        $('#Religionchkdropdown option:selected').each(function (i, sel) {
                            ReligionStr = ReligionStr + $(sel).val() + ',';
                        });
                        $('#castecategorychkdropdown option:selected').each(function (i, sel) {
                            CastCatStr = CastCatStr + $(sel).val() + ',';
                        });
                        $('#citychkdropdown option:selected').each(function (i, sel) {
                            CityStr = CityStr + $(sel).val() + ',';
                        });
                        $('#Areachkdropdown option:selected').each(function (i, sel) {
                            AreaStr = AreaStr + $(sel).val() + ',';
                        });
                        $('#nationalitychkdropdown option:selected').each(function (i, sel) {
                            CountryStr = CountryStr + $(sel).val() + ',';
                        });
                        $("#transportmodechkdropdown option:selected").each(function (index, element) {
                            TransportStr = TransportStr + $(this).val() + ',';
                        });
                        $('#Busroutechkdropdown option:selected').each(function (i, sel) {
                            BusRouteStr = BusRouteStr + $(sel).val() + ',';
                        });
                        $('#Routedestinationchkdropdown option:selected').each(function (i, sel) {
                            DestinationStr = DestinationStr + $(sel).val() + ',';
                        });
                        $('#bloodgroupchkdropdown option:selected').each(function (i, sel) {
                            BloodGroupStr = BloodGroupStr + $(sel).val() + ',';
                        });
                        $('#HOusechkdropdown option:selected').each(function (i, sel) {
                            HouseStr = HouseStr + $(sel).val() + ',';
                        });
                        $('#mothertoungechkdropdown option:selected').each(function (i, sel) {
                            TongueStr = TongueStr + $(sel).val() + ',';
                        });
                        $('#Priviosschoolchkdropdown option:selected').each(function (i, sel) {
                            SchoolStr = SchoolStr + $(sel).text() + ',';
                        });
                        $('#Fatherqulificationchkdropdown option:selected').each(function (i, sel) {
                            fQualificationStr = fQualificationStr + $(sel).text() + ',';
                        });
                        $('#Motherqulificationchkdropdown option:selected').each(function (i, sel) {
                            mQualificationStr = mQualificationStr + $(sel).text() + ',';
                        });
                        $("#FatherOccupationchkdropdown option:selected").each(function (index, element) {
                            fOccupationStr = fOccupationStr + $(this).text() + ',';
                        });
                        $('#MotherOccupationchkdropdown option:selected').each(function (i, sel) {
                            mOccupationStr = mOccupationStr + $(sel).text() + ',';
                        });
                        $('#Feescatrefgorychkdropdown option:selected').each(function (i, sel) {
                            AdmissionStr = AdmissionStr + $(sel).val() + ',';
                        });
                        $('#customtagchkdropdown option:selected').each(function (i, sel) {
                            TagStr = TagStr + $(sel).val() + ',';
                        });
                        $('#Customgroupchkdropdown option:selected').each(function (i, sel) {
                            GroupStr = GroupStr + $(sel).val() + ',';
                        });
                        $('#Clubchkdropdown option:selected').each(function (i, sel) {
                            ClubStr = ClubStr + $(sel).val() + ',';
                        });
                        $('#Hostelchkdropdown option:selected').each(function (i, sel) {
                            HostelStr = HostelStr + $(sel).val() + ',';
                        });
                        $("#Studentgroupchkdropdown option:selected").each(function (i, sel) {
                            sGroupStr = sGroupStr + $(sel).val() + ',';
                        });
                        $('#studentothergroupchkdropdown option:selected').each(function (i, sel) {
                            sOtherGroupStr = sOtherGroupStr + $(sel).val() + ',';
                        });
                        $('#excemptiontypechkdropdown option:selected').each(function (i, sel) {
                            ExemptionStr = ExemptionStr + $(sel).val() + ',';
                        });
                        $('#recordtagchkdropdown option:selected').each(function (i, sel) {
                            RecordTagStr = RecordTagStr + $(sel).val() + ',';
                        });
                        if ($('#chkClass').is(':checked')) {
                            $('#dvClass').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    ClassStr = ClassStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkStatus').is(':checked')) {
                            $('#dvStatus').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    StatusStr = StatusStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkGender').is(':checked')) {
                            $('#dvGender').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    GenderStr = GenderStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkReligion').is(':checked')) {
                            $('#dvReligion').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    ReligionStr = ReligionStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkCastCategory').is(':checked')) {
                            $('#dvCastCategory').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    CastCatStr = CastCatStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkCity').is(':checked')) {
                            $('#dvCity').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    CityStr = CityStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkArea').is(':checked')) {
                            $('#dvArea').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    AreaStr = AreaStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkNationality').is(':checked')) {
                            $('#dvNationality').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    CountryStr = CountryStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkTransportMode').is(':checked')) {
                            $('#dvTransportMode').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    TransportStr = TransportStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkBusRoute').is(':checked')) {
                            $('#dvBusRoute').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    BusRouteStr = BusRouteStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkBusRouteDestination').is(':checked')) {
                            $('#dvBusRouteDestination').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    DestinationStr = DestinationStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkBloodGroup').is(':checked')) {
                            $('#dvBloodGroup').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    BloodGroupStr = BloodGroupStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkHouse').is(':checked')) {
                            $('#dvHouse').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    HouseStr = HouseStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkMotherTongue').is(':checked')) {
                            $('#dvMotherTongue').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    TongueStr = TongueStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkPreSchool').is(':checked')) {
                            $('#dvPreSchool').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    SchoolStr = SchoolStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkFatherQ').is(':checked')) {
                            $('#dvFatherQ').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    fQualificationStr = fQualificationStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkMotherQ').is(':checked')) {
                            $('#dvMotherQ').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    mQualificationStr = mQualificationStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkFatherO').is(':checked')) {
                            $('#dvFatherO').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    fOccupationStr = fOccupationStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkMotherO').is(':checked')) {
                            $('#dvMotherO').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    mOccupationStr = mOccupationStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkAdmissionCat').is(':checked')) {
                            $('#dvAdmissionCat').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    AdmissionStr = AdmissionStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkCustomTag').is(':checked')) {
                            $('#dvCustomTag').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    TagStr = TagStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkCustomGroup').is(':checked')) {
                            $('#dvCustomGroup').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    GroupStr = GroupStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkClub').is(':checked')) {
                            $('#dvClub').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    ClubStr = ClubStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkHostel').is(':checked')) {
                            $('#dvHostel').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    HostelStr = HostelStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkStudentGroup').is(':checked')) {
                            $('#dvStudentGroup').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    sGroupStr = sGroupStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkStudentOtherGroup').is(':checked')) {
                            $('#dvStudentOtherGroup').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    sOtherGroupStr = sOtherGroupStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkExemptionType').is(':checked')) {
                            $('#dvExemptionType').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    ExemptionStr = ExemptionStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        if ($('#chkRecordTag').is(':checked')) {
                            $('#dvRecordTag').children('input[type=checkbox]').each(function (index, element) {
                                if ($(this).is(':checked')) {
                                    RecordTagStr = RecordTagStr + $(this).attr('attrid') + ',';
                                }
                            });
                        }
                        var isPhysical = $('#chkPhisicalD').is(':checked') ? 1 : 0;
                        var isMajorILL = $('#chkMajorILL').is(':checked') ? 1 : 0;
                        var isBlackList = $('#chkBlackList').is(':checked') ? 1 : 0;
                        var isSaveReport = $('#chkSaveReport').is(':checked') ? 1 : 0;
                        var isCommon = $('#chkIsCommon').is(':checked') ? 1 : 0;
                        var isCommonForOrg = $('#chkIsCommonForOrg').is(':checked') ? 1 : 0;

                        var ClassId = 0;
                        var DivisionId = 0;
                        var StatusId = 0;

                        if ($('#chkSaveReport').is(':checked') && ($('#drpClass').val() > 0 || $('#drpDivision').val() > 0 || $('#drpStatus').val() > 0)) {
                            ClassId = 0;
                            DivisionId = 0;
                            StatusId = 0;
                            alert('For Saving Report you must Select Class, Division and Status from MultiSelect');
                            CloseHlsPopup();
                            return;

                        }
                        else {
                            ClassId = $('#drpClass').val();
                            DivisionId = $('#drpDivision').val();
                            StatusId = $('#drpStatus').val();
                        }


                        var obj = {
                            "DepartmentId": $('#drpDepartment').val(),
                            "ClassId": ClassId,
                            "DivisionId": DivisionId,
                            "StatusId": StatusId,
                            "IdNumber": '',
                            "Title": $('#txtReportName').val(),
                            "FirstName": $('#txtFirstName').val(),
                            "LastName": $('#txtLastName').val(),
                            "CountryName": $('#txtCountry').val(),
                            "StateName": $('#txtState').val(),
                            "FromDateOfBirth": $('#txtFDateOfBirth').val(),
                            "ToDateOfBirth": $('#txtTDateOfBirth').val(),
                            "FromAdmissionDate": $('#txtFAdminssionDate').val(),
                            "ToAdmissionDate": $('#txtTAdminssionDate').val(),
                            "FromLeftDate": $('#txtFLeftDate').val(),
                            "ToLeftDate": $('#txtTLeftDate').val(),
                            "Hobby": $('#txtHobby').val(),
                            "FromIdNumber": $('#txtFIdNo').val(),
                            "ToIdNumber": $('#txtTIdNo').val(),
                            "SpecificIdNumber": $('#txtSIdNo').val(),
                            "FatherName": $('#txtFather').val(),
                            "MotherName": $('#txtMother').val(),
                            "OrderByStr": OrderByStr,
                            "CustomFields": CustomFields,
                            "ClassStr": ClassStr,
                            "StatusStr": StatusStr,
                            "GenderStr": GenderStr,
                            "ReligionStr": ReligionStr,
                            "CastCatStr": CastCatStr,
                            "CityStr": CityStr,
                            "AreaStr": AreaStr,
                            "CountryStr": CountryStr,
                            "TransportStr": TransportStr,
                            "BusRouteStr": BusRouteStr,
                            "DestinationStr": DestinationStr,
                            "BloodGroupStr": BloodGroupStr,
                            "HouseStr": HouseStr,
                            "TongueStr": TongueStr,
                            "SchoolStr": SchoolStr,
                            "fQualificationStr": fQualificationStr,
                            "mQualificationStr": mQualificationStr,
                            "fOccupationStr": fOccupationStr,
                            "mOccupationStr": mOccupationStr,
                            "AdmissionStr": AdmissionStr,
                            "TagStr": TagStr,
                            "GroupStr": GroupStr,
                            "ClubStr": ClubStr,
                            "HostelStr": HostelStr,
                            "sGroupStr": sGroupStr,
                            "sOtherGroupStr": sOtherGroupStr,
                            "ExemptionStr": ExemptionStr,
                            "isPhysical": isPhysical,
                            "isSaveReport": isSaveReport,
                            "isMajorILL": isMajorILL,
                            "isBlackList": isBlackList,
                            "isCommon": isCommon,
                            "isCommonForOrg": isCommonForOrg,
                            "RepeatCount": $('#txtRepeatCount').val(),
                            "StudentBatchStatusId": $('#drpStudentBatchStatus').val(),
                            // "StudentNotAssigned": $('#drpStudentNotAssigned').val(),
                            "ReportName": $('#txtReportName').val(),
                            "PageIndex": $('#hdnPageIndex').val(),
                            "SavedReport": $('#drpSavedReport').val(),
                            "RecordTagStr": RecordTagStr,
                            "ContactNo": $('#txtContactNo').val(),
                            "OrgGroupBatchId": $('#drpGroupBatch').val(),
                            "OrgId": $('#drpOrganization').val(),
                            "BirthDay": $('#txtBirthday').val(),
                            "DateOfMonth": $('#ddlMonth').val(),
                            "StopApplicationAccess": $('#ddlStopApplicationAccess').val()
                        };
                        $.ajax({
                            type: "POST",
                            url: URL + "/GenerateStudentReport",
                            data: JSON.stringify(obj),
                            contentType: "application/json;charset=utf-8",
                            dataType: "json",
                            success: function (data) {
                                if ($('#drpViewMode').val() == "Screen")
                                    $('#btnGenerate').click();

                                else
                                    $('#btnView').click();
                                var value = $("#txtBirthday").val();
                                if (value != 0)
                                    $('#txtBirthday').val();
                                else
                                    $('#txtBirthday').val('');

                                window.setTimeout(function () { CloseHlsPopup(); }, 400);
                            },
                            error: function (xhr, status, error) {
                                var err = eval("(" + xhr.responseText + ")");
                                console.log(err.Message);
                            }
                        });
                    }
                    else {
                        CloseHlsPopup();
                        LoadingMessage('Your session has expired, we are redirecting to login page', '<b>Please Wait ...</b>');
                        window.setTimeout(function () { window.location = '/Pages/BaseFramework/Security/Login.aspx'; }, 2000);
                    }
                },
                error: function (xhr, status, error) {
                    var err = eval("(" + xhr.responseText + ")");
                    console.log(err.Message);
                }
            });
        }
    }
    else {
        alert('select atleast one field in custom field');
    }
}


function ChangePage(pageindex) {
    $('#hdnPageIndex').val(pageindex);
    SearchStudents();
}
function ResetControls() {
    /*	$("[id$=people]").multiSelect("uncheckAll");
        $("[id$=people]").multiSelect("refresh");
        $("[id$=people]").multiSelect("presets");
        $("#people option:selected").removeAttr("selected");
        $("#people option:selected").prop("checked",false);
        $("#people option:selected").prop("selected",false);*/
    $('.multi-select-button').html('-- Select --');
    $('#classchkdropdown').val('');
    $("#classchkdropdown").val('');
    $("#Statuschkdropdown").val('');
    $("#Genderchkdropdown").val('');
    $("#Religionchkdropdown").val('');
    $("#castecategorychkdropdown").val('');
    $("#citychkdropdown").val('');
    $("#Areachkdropdown").val('');
    $("#nationalitychkdropdown").val('');
    $("#transportmodechkdropdown").val('');
    $("#Busroutechkdropdown").val('');
    $("#Routedestinationchkdropdown").val('');
    $("#bloodgroupchkdropdown").val('');
    $("#HOusechkdropdown").val('');
    $("#mothertoungechkdropdown").val('');
    $("#Priviosschoolchkdropdown").val('');
    $("#Fatherqulificationchkdropdown").val('');
    $("#Motherqulificationchkdropdown").val('');
    $("#FatherOccupationchkdropdown").val('');
    $("#MotherOccupationchkdropdown").val('');
    $("#Feescatrefgorychkdropdown").val('');
    $("#customtagchkdropdown").val('');
    $("#Customgroupchkdropdown").val('');
    $("#Clubchkdropdown").val('');
    $("#Hostelchkdropdown").val('');
    $("#Studentgroupchkdropdown").val('');
    $("#studentothergroupchkdropdown").val('');
    $("#excemptiontypechkdropdown").val('');
    $("#recordtagchkdropdown").val('');
    $('.multi-select-menuitems').each(function (index, element) {
        $(this).find('input[type=checkbox]').prop('checked', false);
    });
    $('#hdnPageIndex').val(1);
    $('#drpDepartment').val(0);
    $('#txtBirthday').val('');
    $('#ddlMonth').val(0);
    $('#drpClass').val(0);
    $('#drpDivision').val(0);
    $('#drpStatus').val(0);
    $('#txtIdNo').val('');
    $('#txtFirstName').val('');
    $('#txtLastName').val('');
    $('#txtCountry').val('');
    $('#txtState').val('');
    $('#txtFDateOfBirth').val('');
    $('#txtTDateOfBirth').val('');
    $('#txtFAdminssionDate').val('');
    $('#txtTAdminssionDate').val('');
    $('#txtFLeftDate').val('');
    $('#txtTLeftDate').val('');
    $('#txtHobby').val('');
    $('#txtFIdNo').val('');
    $('#txtTIdNo').val('');
    $('#txtFather').val('');
    $('#txtMother').val('');
    $('#txtRepeatCount').val('');
    $('#drpStudentBatchStatus').val(0);
    //  $('#drpStudentNotAssigned').val(0);
    $('#txtReportName').val('');
    $('#txtContactNo').val('');
    $('#ddlStopApplicationAccess').val(-1);

    $('#chkClass').prop('checked', false);
    $('#dvClass').html('');
    $('#dvClass').hide();
    $('#dvClass').css('height', '0');
    $("#dvClass").slimScroll({ destroy: true });

    $('#chkStatus').prop('checked', false);
    $('#dvStatus').html('');
    $('#dvStatus').hide();
    $('#dvStatus').css('height', '0');
    $("#dvStatus").slimScroll({ destroy: true });

    $('#chkGender').prop('checked', false);
    $('#dvGender').html('');
    $('#dvGender').hide();
    $('#dvGender').css('height', '0');
    $("#dvGender").slimScroll({ destroy: true });

    $('#chkReligion').prop('checked', false);
    $('#dvReligion').html('');
    $('#dvReligion').hide();
    $('#dvReligion').css('height', '0');
    $("#dvReligion").slimScroll({ destroy: true });

    $('#chkCastCategory').prop('checked', false);
    $('#dvCastCategory').html('');
    $('#dvCastCategory').hide();
    $('#dvCastCategory').css('height', '0');
    $("#dvCastCategory").slimScroll({ destroy: true });

    $('#chkCity').prop('checked', false);
    $('#dvCity').html('');
    $('#dvCity').hide();
    $('#dvCity').css('height', '0');
    $("#dvCity").slimScroll({ destroy: true });

    $('#chkArea').prop('checked', false);
    $('#dvArea').html('');
    $('#dvArea').hide();
    $('#dvArea').css('height', '0');
    $("#dvArea").slimScroll({ destroy: true });

    $('#chkNationality').prop('checked', false);
    $('#dvNationality').html('');
    $('#dvNationality').hide();
    $('#dvNationality').css('height', '0');
    $("#dvNationality").slimScroll({ destroy: true });

    $('#chkTransportMode').prop('checked', false);
    $('#dvTransportMode').html('');
    $('#dvTransportMode').hide();
    $('#dvTransportMode').css('height', '0');
    $("#dvTransportMode").slimScroll({ destroy: true });

    $('#chkBusRoute').prop('checked', false);
    $('#dvBusRoute').html('');
    $('#dvBusRoute').hide();
    $('#dvBusRoute').css('height', '0');
    $("#dvBusRoute").slimScroll({ destroy: true });

    $('#chkBusRouteDestination').prop('checked', false);
    $('#dvBusRouteDestination').html('');
    $('#dvBusRouteDestination').hide();
    $('#dvBusRouteDestination').css('height', '0');
    $("#dvBusRouteDestination").slimScroll({ destroy: true });

    $('#chkBloodGroup').prop('checked', false);
    $('#dvBloodGroup').html('');
    $('#dvBloodGroup').hide();
    $('#dvBloodGroup').css('height', '0');
    $("#dvBloodGroup").slimScroll({ destroy: true });

    $('#chkHouse').prop('checked', false);
    $('#dvHouse').html('');
    $('#dvHouse').hide();
    $('#dvHouse').css('height', '0');
    $("#dvHouse").slimScroll({ destroy: true });

    $('#chkMotherTongue').prop('checked', false);
    $('#dvMotherTongue').html('');
    $('#dvMotherTongue').hide();
    $('#dvMotherTongue').css('height', '0');
    $("#dvMotherTongue").slimScroll({ destroy: true });

    $('#chkPreSchool').prop('checked', false);
    $('#dvPreSchool').html('');
    $('#dvPreSchool').hide();
    $('#dvPreSchool').css('height', '0');
    $("#dvPreSchool").slimScroll({ destroy: true });

    $('#chkFatherQ').prop('checked', false);
    $('#dvFatherQ').html('');
    $('#dvFatherQ').hide();
    $('#dvFatherQ').css('height', '0');
    $("#dvFatherQ").slimScroll({ destroy: true });

    $('#chkMotherQ').prop('checked', false);
    $('#dvMotherQ').html('');
    $('#dvMotherQ').hide();
    $('#dvMotherQ').css('height', '0');
    $("#dvMotherQ").slimScroll({ destroy: true });

    $('#chkFatherO').prop('checked', false);
    $('#dvFatherO').html('');
    $('#dvFatherO').hide();
    $('#dvFatherO').css('height', '0');
    $("#dvFatherO").slimScroll({ destroy: true });

    $('#chkMotherO').prop('checked', false);
    $('#dvMotherO').html('');
    $('#dvMotherO').hide();
    $('#dvMotherO').css('height', '0');
    $("#dvMotherO").slimScroll({ destroy: true });

    $('#chkAdmissionCat').prop('checked', false);
    $('#dvAdmissionCat').html('');
    $('#dvAdmissionCat').hide();
    $('#dvAdmissionCat').css('height', '0');
    $("#dvAdmissionCat").slimScroll({ destroy: true });

    $('#chkCustomTag').prop('checked', false);
    $('#dvCustomTag').html('');
    $('#dvCustomTag').hide();
    $('#dvCustomTag').css('height', '0');
    $("#dvCustomTag").slimScroll({ destroy: true });

    $('#chkCustomGroup').prop('checked', false);
    $('#dvCustomGroup').html('');
    $('#dvCustomGroup').hide();
    $('#dvCustomGroup').css('height', '0');
    $("#dvCustomGroup").slimScroll({ destroy: true });

    $('#chkClub').prop('checked', false);
    $('#dvClub').html('');
    $('#dvClub').hide();
    $('#dvClub').css('height', '0');
    $("#dvClub").slimScroll({ destroy: true });

    $('#chkHostel').prop('checked', false);
    $('#dvHostel').html('');
    $('#dvHostel').hide();
    $('#dvHostel').css('height', '0');
    $("#dvHostel").slimScroll({ destroy: true });

    $('#chkStudentGroup').prop('checked', false);
    $('#dvStudentGroup').html('');
    $('#dvStudentGroup').hide();
    $('#dvStudentGroup').css('height', '0');
    $("#dvStudentGroup").slimScroll({ destroy: true });

    $('#chkStudentOtherGroup').prop('checked', false);
    $('#dvStudentOtherGroup').html('');
    $('#dvStudentOtherGroup').hide();
    $('#dvStudentOtherGroup').css('height', '0');
    $("#dvStudentOtherGroup").slimScroll({ destroy: true });

    $('#chkExemptionType').prop('checked', false);
    $('#dvExemptionType').html('');
    $('#dvExemptionType').hide();
    $('#dvExemptionType').css('height', '0');
    $("#dvExemptionType").slimScroll({ destroy: true });

    $('#chkPhisicalD').prop('checked', false);
    $('#chkMajorILL').prop('checked', false);
    $('#chkBlackList').prop('checked', false);
    $('#chkSaveReport').prop('checked', false);
    $('#chkIsCommon').prop('checked', false);
    $('#chkIsCommonForOrg').prop('checked', false);
    $('#tblStudentList').html('');
    $('#pagging').html('');
    $('#lblTotalRecords').html('');
    //$('.btn-primary').hide();
    $("#customPaging").hide();
    $("#drpSelectedFields").html('');

    $('#chkRecordTag').prop('checked', false);
    $('#dvRecordTag').html('');
    $('#dvRecordTag').hide();
    $('#dvRecordTag').css('height', '0');
    $("#dvRecordTag").slimScroll({ destroy: true });


}
function CheckUncheckMessage(flag) {
    if (flag == 1) {
        $('#dvSubject').hide();
        $('#txtSubject').val('');
    }
    else if (flag == 2) {
        $('#dvSubject').show();
        $('#txtSubject').val('');
    }
        //New UI And Add New option in alert for whatsapp By Hemali -- Mantis Id :0026428
    else if (flag == 4) {
        $('#dvSubject').hide();
        $('#txtSubject').val('');        
    }
    else {
        $('#dvSubject').show();
        $('#txtSubject').val('');       
    }
    // Mantis Id : 	0038790
    if(flag == 4)
    {
        if ($("#chkWhatsapp").is(":checked")) {
            $('#dvWhatsAppTemplate').show();
        } else {
            $('#dvWhatsAppTemplate').hide();
        }
    }
}
function ValidateAlert() {
    var fields = '';
    var Title = 'Please fill the following details ___________________ \n\n';
    if ($('#chkMail').is(':checked') || $('#chkMobile').is(':checked')) {
        if ($('#txtSubject').val() == '') {
            fields = fields + 'Subject \n';
        }
    }
    //Remove Code As per New UI By Hemali -- Mantis Id :0026428
    if ($('#txtMessage').val() == '') {
        fields = fields + 'Message \n';
    }
    if (fields.length > 0) {
        alert(Title + fields);
        return false;
    }
    else {
        var x = confirm('Do you want to send alert?');
        if (x == true) {
            SendAlert();
        }
    }
}
function SendAlert() {
    $.ajax({
        type: "POST",
        url: URL + "/GetSession",
        data: '{}',
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function (dt) {
            if (dt.d > 0) {
                LoadingMessage('Loading Details', '<b>Please Wait ...</b>');
                var isChkSMS = $('#chkSMS').is(':checked') ? 1 : 0;
                var isChkMail = $('#chkMail').is(':checked') ? 1 : 0;
                var isChkMobileApp = $('#chkMobile').is(':checked') ? 1 : 0;
                var isChkWhatsApp = $('#chkWhatsapp').is(':checked') ? 1 : 0;
                var obj = {
                    "isChkSMS": isChkSMS,
                    "isChkMail": isChkMail,
                    "isChkMobileApp": isChkMobileApp,
                    "isChkWhatsApp": isChkWhatsApp,
                    "Subject": $('#txtSubject').val(),
                    "Message": $('#txtMessage').val(),
                    "OrgGroupBatchId": $('#drpGroupBatch').val(),
                    "OrgId": $('#drpOrganization').val(),
                    "whatsAppTemplateName": $('#txtWhatsAppTemplate').val()
                };
                $.ajax({
                    type: "POST",
                    url: URL + "/SendAlert",
                    data: JSON.stringify(obj),
                    contentType: "application/json;charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        var datas = $.parseJSON(data.d);
                        if (Number(datas.dtStatus) == 1) {
                            alert(datas.dtMessage);
                        }
                        else {
                            alert(datas.dtMessage);
                        }
                        window.setTimeout(function () { CloseHlsPopup(); }, 400);
                    },
                    error: function (xhr, status, error) {
                        var err = eval("(" + xhr.responseText + ")");
                        console.log(err.Message);
                    }
                });
            }
            else {
                CloseHlsPopup();
                LoadingMessage('Your session has expired, we are redirecting to login page', '<b>Please Wait ...</b>');
                window.setTimeout(function () { window.location = '/Pages/BaseFramework/Security/Login.aspx'; }, 2000);
            }
        },
        error: function (xhr, status, error) {
            var err = eval("(" + xhr.responseText + ")");
            console.log(err.Message);
        }
    });
}
function grow(text, long, counter) {
    var id = (text.id);
    CountDesc(text, long);
    textCount(text, counter, long);
    TextBoxSizeOnLoad(id);
}
function CountDesc(text, long) {
    var maxlength = new Number(long); // Change number to your max length.
    var id = (text.id);
    if (document.getElementById('txtMessage').value.length > maxlength) {
        text.value = text.value.substring(0, maxlength);
    }
}
function TextBoxSizeOnLoad(id) {
    $('#lblCharacter').html(($('#txtMessage').val().length));
    var desc = $('#txtMessage').val().length;
    if (desc <= 25000) {
        $('#lblCharacter').html(desc);
    }
    else {
        $('#lblCharacter').html(0);
    }
}
var bName = navigator.appName;
function textCount(taObj, Cnt, maxL) {
    objCnt = createObject(Cnt);
    objVal = taObj.value;
    if (objVal.length <= maxL) {
        if (objCnt) {
            if (bName == "Netscape") {
                objCnt.textContent = maxL - objVal.length;
            }
            else {
                objCnt.innerText = maxL - objVal.length;
            }
        }
    }
    else {
        objCnt.innerText = 0;
    }
    return true;
}
function createObject(objId) {
    if (document.getElementById) return document.getElementById(objId);
    else if (document.layers) return eval("document." + objId);
    else if (document.all) return eval("document.all." + objId);
    else return eval("document." + objId);
}
function Count(obj, long, id) {
    var maxlength = new Number(long);
    if ($(obj).val().length > maxlength) {
        obj.value = obj.value.substring(0, maxlength);
    }
    else {
        $('#lblCharacter').html(($(obj).val().length));
        $('#lblMessage').html(1);
    }
}
function SelectStudent(StudentId, Code) {
    $.ajax({
        type: "POST",
        url: URL + "/GetSession",
        data: '{}',
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function (dt) {
            if (dt.d > 0) {
                LoadingMessage('Loading Details', '<b>Please Wait ...</b>');
                var obj = {
                    "StudentId": StudentId,
                    "Code": Code,
                    "OrgGroupBatchId": $('#drpGroupBatch').val(),
                    "OrgId": $('#drpOrganization').val()
                };
                $.ajax({
                    type: "POST",
                    url: URL + "/SelectStudent",
                    data: JSON.stringify(obj),
                    contentType: "application/json;charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        window.location = '/Pages/StudentManagement/Student.aspx';
                    },
                    error: function (xhr, status, error) {
                        var err = eval("(" + xhr.responseText + ")");
                        console.log(err.Message);
                    }
                });
            }
            else {
                CloseHlsPopup();
                LoadingMessage('Your session has expired, we are redirecting to login page', '<b>Please Wait ...</b>');
                window.setTimeout(function () { window.location = '/Pages/BaseFramework/Security/Login.aspx'; }, 2000);
            }
        },
        error: function (xhr, status, error) {
            var err = eval("(" + xhr.responseText + ")");
            console.log(err.Message);
        }
    });
}
function DeleteReport(Id) {
    $.ajax({
        type: "POST",
        url: URL + "/GetSession",
        data: '{}',
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function (dt) {
            if (dt.d > 0) {
                var x = confirm('Do you want to delete?');
                if (x == true) {
                    LoadingMessage('Loading Details', '<b>Please Wait ...</b>');
                    var obj = {
                        "Id": Id
                    };
                    $.ajax({
                        type: "POST",
                        url: URL + "/DeleteReport",
                        data: JSON.stringify(obj),
                        contentType: "application/json;charset=utf-8",
                        dataType: "json",
                        success: function (data) {
                            alert('Deleted successfully.... Please Refresh the Page');
                            CloseHlsPopup();
                        },
                        error: function (xhr, status, error) {
                            var err = eval("(" + xhr.responseText + ")");
                            console.log(err.Message);
                        }
                    });
                }
            }
            else {
                CloseHlsPopup();
                LoadingMessage('Your session has expired, we are redirecting to login page', '<b>Please Wait ...</b>');
                window.setTimeout(function () { window.location = '/Pages/BaseFramework/Security/Login.aspx'; }, 2000);
            }
        },
        error: function (xhr, status, error) {
            var err = eval("(" + xhr.responseText + ")");
            console.log(err.Message);
        }
    });
}


function ViewReport(Id, Title, ColumnName) {
    $.ajax({
        type: "POST",
        url: URL + "/GetSession",
        data: '{}',
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function (dt) {
            if (dt.d > 0) {
                var x = confirm('Do you want to Download?');
                if (x == true) {
                    LoadingMessage('Loading Details', '<b>Please Wait ...</b>');
                    var obj = {
                        "Id": Id,
                        "Title": Title,
                        "ColumnName": ColumnName,
                        "OrgGroupBatchId": $('#drpGroupBatch').val(),
                        "OrganizationId": $('#drpOrganization').val()
                    };
                    $.ajax({
                        type: "POST",
                        url: URL + "/ViewReport",
                        data: JSON.stringify(obj),
                        contentType: "application/json;charset=utf-8",
                        dataType: "json",
                        success: function (data) {
                            $('#btnSaveReport').click();
                            CloseHlsPopup();
                        },
                        error: function (xhr, status, error) {
                            var err = eval("(" + xhr.responseText + ")");
                            console.log(err.Message);
                        }
                    });
                }
            }
            else {
                CloseHlsPopup();
                LoadingMessage('Your session has expired, we are redirecting to login page', '<b>Please Wait ...</b>');
                window.setTimeout(function () { window.location = '/Pages/BaseFramework/Security/Login.aspx'; }, 2000);
            }
        },
        error: function (xhr, status, error) {
            var err = eval("(" + xhr.responseText + ")");
            console.log(err.Message);
        }
    });
}


function myfunction() {
    $.ajax({
        type: "POST",
        url: URL + "/GetSession",
        data: '{}',
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function (dt) {
            if (dt.d > 0) {
                var obj = {
                    "flag": 1
                };
                $.ajax({
                    type: "POST",
                    url: URL + "/BindValues",
                    data: JSON.stringify(obj),
                    contentType: "application/json;charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        var datas = $.parseJSON(data.d);
                        if (datas.Result != '') {
                            $('#dvClass1').html(datas.Result);
                            var DivCheckBoxList1 = document.getElementById("divHealthIndexParameter");

                            var boxes = DivCheckBoxList1.getElementsByTagName("input");
                            if (boxes.length) {
                                if (DivCheckBoxList1.style.display == "none") {
                                    DivCheckBoxList1.style.display = "block";
                                    var inputElems = document.getElementsByTagName("input"); var count = 0;
                                    for (var i = 0; i < inputElems.length; i++) { if (inputElems[i].type === "checkbox") { count++; } }
                                    if (count > 1) { DivCheckBoxList1.style.height = "100px"; $('#divHealthIndexParameter').slimScroll({ height: '100px' }); }
                                }
                            }
                        }
                        else {
                            $('#dvClass').html('&nbsp;No Data');
                            var DivCheckBoxList1 = document.getElementById("divHealthIndexParameter");
                            DivCheckBoxList1.style.display = "none";
                        }
                    },
                    error: function (xhr, status, error) {
                        var err = eval("(" + xhr.responseText + ")");
                        console.log(err.Message);
                    }
                });
            }
            else {
                CloseHlsPopup();
                LoadingMessage('Your session has expired, we are redirecting to login page', '<b>Please Wait ...</b>');
                window.setTimeout(function () { window.location = '/Pages/BaseFramework/Security/Login.aspx'; }, 2000);
            }
        },
        error: function (xhr, status, error) {
            var err = eval("(" + xhr.responseText + ")");
            console.log(err.Message);
        }
    });
}

function RestrictAlphaNumeric(ctrl) {
    // debugger;
    var that = $(ctrl);
    //that.style.color = "#fff";
    setTimeout(function () {
        $(ctrl).val($(ctrl).val().replace(/\D/g, ""));
        //that.style.color = "#000";
    }, 100);
}
//$(document).ready(function () {
//    $(".inputValue").on("paste", function (e) {
//        //alert();
//        var that = this;
//        that.style.color = "#fff";
//        setTimeout(function () {
//            that.value = that.value.replace(/\D/g, "");
//            that.style.color = "#000";
//        }, 100);
//    });
//})



$("#chkMail").click(function (e) {
    //alert("hi");
    var ischkMail = $('#chkMail').is(':checked') ? 1 : 0;
    var isChkMobileApp = $('#chkMobile').is(':checked') ? 1 : 0;

    //alert(ischkMail);
    // alert(isChkMobileApp);
    if (ischkMail == 1 && isChkMobileApp == 0) {
        $("#dvSubject").show();
    }
    else if (ischkMail == 0 && isChkMobileApp == 1) {
        $("#dvSubject").show();
    }
    else if (ischkMail == 1 && isChkMobileApp == 1) {
        $("#dvSubject").show();
    }
    else {
        $("#dvSubject input").val('');
        $("#dvSubject").hide();
    }

});


$("#chkMobile").click(function (e) {
    //alert("hi");
    var ischkMail = $('#chkMail').is(':checked') ? 1 : 0;
    var isChkMobileApp = $('#chkMobile').is(':checked') ? 1 : 0;

    //alert(ischkMail);
    // alert(isChkMobileApp);
    if (ischkMail == 1 && isChkMobileApp == 0) {
        $("#dvSubject").show();
    }
    else if (ischkMail == 0 && isChkMobileApp == 1) {
        $("#dvSubject").show();
    }
    else if (ischkMail == 1 && isChkMobileApp == 1) {
        $("#dvSubject").show();
    }
    else {
        $("#dvSubject input").val('');
        $("#dvSubject").hide();
    }

});