$(document).ready(function () { $('a.pg').on('click', function (e) { e.preventDefault(); $('.grid').attr('action', $('.grid').attr('action') + $(this).attr('href')); $('form.grid').submit(); }); }); function BindCascadingDropDownList(sourceid, url, selectedvalue, cascadeParamValue, selectAll) { console.log(cascadeParamValue) $('#' + sourceid).empty(); if (selectAll) $("#" + sourceid).append(''); else $("#" + sourceid).append(''); //alert(sourceid) //alert($('#' + sourceid+' option:selected').val()) // if ($("#" + sourceid).val() != '') { $.ajax({ type: 'POST', url: url, dataType: 'json', data: cascadeParamValue, contentType: "application/json", async: false, success: function (data) { //debugger; $.each(data, function (i, item) { $("#" + sourceid).append(''); }); // if (selectedvalue == 0) // selectedvalue = ""; if (!selectAll && selectedvalue == 0) selectedvalue = ""; $("#" + sourceid).val(selectedvalue); }, failure: function (response) { console.log(response); } }); // } return false; } // Push data into array function BindArray(sourceid, url, params) { $('#' + sourceid).empty(); var items = []; $.ajax({ type: 'POST', url: url, dataType: 'json', data: params, contentType: "application/json", async: false, success: function (data) { $.each(data, function (i, item) { items.push(item.Value); }); $('#' + sourceid).val(items) }, failure: function (response) { console.log(response); } }); return false; } function BindDropDownList(sourceid, url, selectedValue) { $('#' + sourceid).empty(); } // To Get min and max Wardnumber function GetMinMaxWardNumber(requestType) { var params = '{"requestType": "' + requestType + '"}'; $.ajax({ type: 'POST', url: '/Bind/GetMinMaxWardNumber', dataType: 'json', data: params, contentType: "application/json", async: false, success: function (data) { debugger; $('#fromWard').val(data[0].minward); $('#toWard').val(data[0].maxward); }, failure: function (response) { console.log(response); } }); return false; } //// // // // / Old js function // function BindElectionID(selectedValue) { // $("#ElectionID").empty(); // debugger // $.ajax({ // type: 'POST',//url: '@Url.Action("BindElectionIDAdmin", "Bind")', // url: '@Url.Action("BindElectionIDForAdmin", "Bind")', // //data: '{ClientID: "' + @Session["ClientID"].ToString() + '"}', // data: '{UserID: "' + @Session["UserId"].ToString() + '"}', // dataType: 'json', // contentType: "application/json", // success: function (Elections) { // // debugger; // $("#ElectionID").append(''); // $.each(Elections, function (i, Election) { // $("#ElectionID").append(''); // }); // $("#ElectionID").val(selectedValue); // BindAssembly('@selAssembly'); // }, // error: function (ex) { // alert('Failed to retrieve ElectionID.' + ex); // } // }); // } //function BindParts() { // $("#Part").empty(); // var Assembly = $("#Assembly").val(); // var parts = []; // $.ajax({ // type: 'POST', // url: '@Url.Action("BindParts", "Bind")', // dataType: 'json', // data: '{Assembly: "' + Assembly + '"}', // contentType: "application/json", // async: false, // success: function (Parts) { // $.each(Parts, function (i, Part) { // parts.push(Parts[i].PartCode); // }); // $('#parts').val(parts); // }, // failure: function (response) { // // alert('Failed to retrieve Part.' + ex); // } // }); // return false; //} //function BindSection() { // $("#SectionAddress").empty(); // var Part = $("#Part").val(); // var Assembly = $("#Assembly").val(); // $.ajax({ // type: 'POST', // url: '@Url.Action("BindSectionAddress", "Bind")', // dataType: 'json', // data: '{Part: "' + Part + '" , Assembly: "' + Assembly + '"}', // contentType: "application/json", // async: false, // success: function (SectionAddresses) { // //debugger; // $("#SectionAddress").append(''); // $.each(SectionAddresses, function (i, SectionAddress) { // $("#SectionAddress").append(''); // }); // $("#SectionAddress").val('@ViewBag.SectionAddress'); // // BindPollingStation(); // }, // failure: function (response) { // alert('Failed to retrieve Section.' + ex); // } // }); // return false; //} //function GetSectionName() { // var Part = $("#Part").val(); // var Assembly = $("#Assembly").val(); // var SectionAddress = $('#SectionAddress').val(); // $.ajax({ // type: 'POST', // url: '@Url.Action("GetSectionAddress", "Bind")', // dataType: 'json', // data: '{Part: "' + Part + '" , Assembly: "' + Assembly + '" ,SectionAddress: "' + SectionAddress + '"}', // contentType: 'application/json; charset=utf-8', // async: false, // success: function (BindSectionName) { // // alert(BindSectionName[0].SectionName); // if (BindSectionName[0].SectionName != null) { // //alert(); // $('#SectionName').val(BindSectionName[0].SectionName); // //alert($('#SectionName').val()); // } // else { // alert('Failed to retrieve Section!!'); // return false; // } // }, // error: function () { // alert("error"); // } // }); //} video game raging zeus mines slot allstar 7s hold and win east coast vs west coast bonus buy games book of fairytale beauties 9 coins whatsapp slot bonus esqueleto explosivo 2 reborn horizon hunters slot bamboo wilds horse racing betting promotions slot 10 lucky sevens slot trout s treasure wild christmas glory casino live crypto payments slot timber stacks what casino has ugga bugga slot machine in las vegas bonus buy games piggy bank stacked fortune slot golden catch video game dice 2 live casino hotel in las vegas live casino betting tips mc casino responsible gaming tennis betting video game need for x bonus buy games fire stampede golden slot winner apk OK sport