$(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"); // } // }); //} slot ripe rewards oksport online sportsbook fast payouts online casino bonus buy games 3 coin treasures the knight king gacor slot tricks 2025 video game andar bahar gems inferno megaways book of aphrodite the golden era slot samba fiesta top live casino hotels with discounts bonus buy games queen of water bonus buy games meteor of chaos tk999 live casino tables bonus buy games merry hog bonus buy games super elements bonus buy games yummy bonanza bonus buy games sizzling eggs extremely light slot book of hercules a legendary quest slot secret book of amun ra link slot terbaru togel cash pandas bonus buy games 4 secrets of aladdin slot heroic spins bonus buy games 12 treasures aztec riches OK sport