1293 lines
48 KiB
HTML
1293 lines
48 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Inventory\ManageFleet.js</title>
|
|
<link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
|
|
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
|
|
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
|
|
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
|
|
<script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
|
|
</head>
|
|
<body class="yui3-skin-sam">
|
|
|
|
<div id="doc">
|
|
<div id="hd" class="yui3-g header">
|
|
<div class="yui3-u-3-4">
|
|
|
|
<h1><img src="../assets/css/logo.png" title=""></h1>
|
|
|
|
</div>
|
|
<div class="yui3-u-1-4 version">
|
|
<em>API Docs for: </em>
|
|
</div>
|
|
</div>
|
|
<div id="bd" class="yui3-g">
|
|
|
|
<div class="yui3-u-1-4">
|
|
<div id="docs-sidebar" class="sidebar apidocs">
|
|
<div id="api-list">
|
|
<h2 class="off-left">APIs</h2>
|
|
<div id="api-tabview" class="tabview">
|
|
<ul class="tabs">
|
|
<li><a href="#api-classes">Classes</a></li>
|
|
<li><a href="#api-modules">Modules</a></li>
|
|
</ul>
|
|
|
|
<div id="api-tabview-filter">
|
|
<input type="search" id="api-filter" placeholder="Type to filter APIs">
|
|
</div>
|
|
|
|
<div id="api-tabview-panel">
|
|
<ul id="api-classes" class="apis classes">
|
|
|
|
<li><a href="../classes/CallFeedbackRating.html">CallFeedbackRating</a></li>
|
|
|
|
<li><a href="../classes/CloseTicketReport.html">CloseTicketReport</a></li>
|
|
|
|
<li><a href="../classes/ConsolidatedReport.html">ConsolidatedReport</a></li>
|
|
|
|
<li><a href="../classes/CustomerReport.html">CustomerReport</a></li>
|
|
|
|
<li><a href="../classes/DealerWiseCallDetails.html">DealerWiseCallDetails</a></li>
|
|
|
|
<li><a href="../classes/DeclinedCalls.html">DeclinedCalls</a></li>
|
|
|
|
<li><a href="../classes/DropDownData.html">DropDownData</a></li>
|
|
|
|
<li><a href="../classes/EicherPromise.html">EicherPromise</a></li>
|
|
|
|
<li><a href="../classes/EosCallCount.html">EosCallCount</a></li>
|
|
|
|
<li><a href="../classes/GeoAnalysis.html">GeoAnalysis</a></li>
|
|
|
|
<li><a href="../classes/HdBusLmdContrCallFeedbackRatingibution.html">HdBusLmdContrCallFeedbackRatingibution</a></li>
|
|
|
|
<li><a href="../classes/HdBusLmdContribution.html">HdBusLmdContribution</a></li>
|
|
|
|
<li><a href="../classes/HistoryTracking.html">HistoryTracking</a></li>
|
|
|
|
<li><a href="../classes/LiveTracking.html">LiveTracking</a></li>
|
|
|
|
<li><a href="../classes/ManageEscalation.html">ManageEscalation</a></li>
|
|
|
|
<li><a href="../classes/ManageFleet.html">ManageFleet</a></li>
|
|
|
|
<li><a href="../classes/ManageFleet_Detail.html">ManageFleet_Detail</a></li>
|
|
|
|
<li><a href="../classes/ManageFleet_details.html">ManageFleet_details</a></li>
|
|
|
|
<li><a href="../classes/ManageOwner.html">ManageOwner</a></li>
|
|
|
|
<li><a href="../classes/ManageReason.html">ManageReason</a></li>
|
|
|
|
<li><a href="../classes/ManageVechile.html">ManageVechile</a></li>
|
|
|
|
<li><a href="../classes/ManageVehicle.html">ManageVehicle</a></li>
|
|
|
|
<li><a href="../classes/NonVecvUserManagement.html">NonVecvUserManagement</a></li>
|
|
|
|
<li><a href="../classes/Notifications.html">Notifications</a></li>
|
|
|
|
<li><a href="../classes/OpenTicketReport.html">OpenTicketReport</a></li>
|
|
|
|
<li><a href="../classes/OrganizationChart.html">OrganizationChart</a></li>
|
|
|
|
<li><a href="../classes/PositioningTool.html">PositioningTool</a></li>
|
|
|
|
<li><a href="../classes/PositioningTool_Report.html">PositioningTool_Report</a></li>
|
|
|
|
<li><a href="../classes/ReasonForClosure.html">ReasonForClosure</a></li>
|
|
|
|
<li><a href="../classes/Report.html">Report</a></li>
|
|
|
|
<li><a href="../classes/ShowDealerMap.html">ShowDealerMap</a></li>
|
|
|
|
<li><a href="../classes/TicketAdministration.html">TicketAdministration</a></li>
|
|
|
|
<li><a href="../classes/TicketAdministration_FullDetail.html">TicketAdministration_FullDetail</a></li>
|
|
|
|
<li><a href="../classes/TicketFeedback.html">TicketFeedback</a></li>
|
|
|
|
<li><a href="../classes/TicketForDealer.html">TicketForDealer</a></li>
|
|
|
|
<li><a href="../classes/TicketForDealer_FullDetails.html">TicketForDealer_FullDetails</a></li>
|
|
|
|
<li><a href="../classes/TicketReassign.html">TicketReassign</a></li>
|
|
|
|
<li><a href="../classes/TileDashboard.html">TileDashboard</a></li>
|
|
|
|
<li><a href="../classes/TimeSlotClosure.html">TimeSlotClosure</a></li>
|
|
|
|
<li><a href="../classes/TollFreeAndOpportunityLoss.html">TollFreeAndOpportunityLoss</a></li>
|
|
|
|
<li><a href="../classes/VanCoverageDesigner.html">VanCoverageDesigner</a></li>
|
|
|
|
<li><a href="../classes/VecvUserManagement.html">VecvUserManagement</a></li>
|
|
|
|
</ul>
|
|
|
|
<ul id="api-modules" class="apis modules">
|
|
|
|
<li><a href="../modules/Dashboard.html">Dashboard</a></li>
|
|
|
|
<li><a href="../modules/DropDownData.html">DropDownData</a></li>
|
|
|
|
<li><a href="../modules/Geo.html">Geo</a></li>
|
|
|
|
<li><a href="../modules/Inventory.html">Inventory</a></li>
|
|
|
|
<li><a href="../modules/Notifications.html">Notifications</a></li>
|
|
|
|
<li><a href="../modules/ReportModule.html">ReportModule</a></li>
|
|
|
|
<li><a href="../modules/Ticket.html">Ticket</a></li>
|
|
|
|
<li><a href="../modules/TrackingModule.html">TrackingModule</a></li>
|
|
|
|
<li><a href="../modules/UserManagement.html">UserManagement</a></li>
|
|
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="yui3-u-3-4">
|
|
<div id="api-options">
|
|
Show:
|
|
<label for="api-show-inherited">
|
|
<input type="checkbox" id="api-show-inherited" checked>
|
|
Inherited
|
|
</label>
|
|
|
|
<label for="api-show-protected">
|
|
<input type="checkbox" id="api-show-protected">
|
|
Protected
|
|
</label>
|
|
|
|
<label for="api-show-private">
|
|
<input type="checkbox" id="api-show-private">
|
|
Private
|
|
</label>
|
|
<label for="api-show-deprecated">
|
|
<input type="checkbox" id="api-show-deprecated">
|
|
Deprecated
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="apidocs">
|
|
<div id="docs-main">
|
|
<div class="content">
|
|
<h1 class="file-heading">File: Inventory\ManageFleet.js</h1>
|
|
|
|
<div class="file">
|
|
<pre class="code prettyprint linenums">
|
|
/**
|
|
* To Manage Fleet
|
|
* @module Inventory
|
|
*/
|
|
|
|
/**
|
|
* This class contains functions related to show device details and their state (Operational/Non-operational/Disabled/Archive/All")
|
|
* @class ManageFleet
|
|
* @constructor
|
|
*/
|
|
|
|
//Global variables
|
|
var activeRequest_City, activeRequest_UserDetails, activeRequest, activeRequest_Edit, vSelectedRow;
|
|
|
|
//For Checking Whether Dealer Contact No. Or Van Registration No. Exist
|
|
var vDealerContactExist = false;
|
|
var vVanRegistratioNoExist = false;
|
|
|
|
//Get the value Dealer Contact No. Or Van Registration No. On Focus
|
|
var vDealerContactNoOnFocus = "";
|
|
var vRegistrationNoOnFocus = "";
|
|
|
|
//Show Message if Dealer Contact No. Or Van Registration No. is Exist
|
|
var vVanRegistrationNoExistMsg = "";
|
|
var vDealerContactNoExistMsg = "";
|
|
|
|
/**
|
|
* Function to Add Kendo Window.
|
|
* @method addKendoWindowToDiv
|
|
* @param {String} divId Id of Kendo Window
|
|
* @param {String} titleText Title Of Kendo Window
|
|
* @param {String} width width Of Kendo Window
|
|
* @param {String} left left Of Kendo Window
|
|
* @param {String} top top Of Kendo Window
|
|
* @for ManageFleet
|
|
*/
|
|
function addKendoWindowToDiv(divId, titleText, width, left) {
|
|
$(divId).kendoWindow({
|
|
width: width,
|
|
title: titleText,
|
|
modal: true,
|
|
resizable: false,
|
|
draggable: true,
|
|
position: {
|
|
top: 95,
|
|
left: left
|
|
}
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Function to Enter Only Apha Numeric Character in Textbox.
|
|
* @method AlphaNumeic
|
|
* @param {Object} e Get Event Detail
|
|
* @param {Object} t Get Textbox Detail
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
|
|
function AlphaNumeic(e, t) {
|
|
var key;
|
|
var keychar;
|
|
|
|
if (window.event)
|
|
key = window.event.keyCode;
|
|
else if (e)
|
|
key = e.which;
|
|
else
|
|
return true;
|
|
keychar = String.fromCharCode(key);
|
|
keychar = keychar.toLowerCase();
|
|
if (t.value.length == 1) {
|
|
// control keys
|
|
if ((key == null) || (key == 0) || (key == 8) ||
|
|
(key == 9) || (key == 13) || (key == 27))
|
|
return true;
|
|
else if ((("abcdefghijklmnopqrstuvwxyz").indexOf(keychar) > -1))
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
else {
|
|
// control keys
|
|
if ((key == null) || (key == 0) || (key == 8) ||
|
|
(key == 9) || (key == 13) || (key == 27))
|
|
return true;
|
|
else if ((("abcdefghijklmnopqrstuvwxyz0123456789").indexOf(keychar) > -1))
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Function to Set Kendo Window Title.
|
|
* @method SetKendoWindowTitle
|
|
* @param {String} divId Id of Kendo Window
|
|
* @param {String} titleText Title Of Kendo Window
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
function SetKendoWindowTitle(divId, titleText) {
|
|
var dialog = $(divId).data("kendoWindow");
|
|
dialog.title(titleText);
|
|
}
|
|
|
|
/**
|
|
* Function to Close Kendo Window.
|
|
* @method closeWindow
|
|
* @param {String} divId Id of Kendo Window
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
function closeWindow(divId) {
|
|
$(divId).data("kendoWindow").close();
|
|
}
|
|
|
|
|
|
/**
|
|
* Function to Get All Dealer Name According to State And City and State Must be Selected but City is optional
|
|
* @method GetDealerNameList
|
|
* @Param {Boolean} vChkValidation (Check Validation or not)
|
|
* @Param {Integer} vRowIndex Click on Dealer List Row Or Not
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
function GetDealerNameList(vChkValidation, vRowIndex) {
|
|
$("#spanState").hide();
|
|
stateVal = $("#stateCombobox").val();
|
|
cityVal = $("#cityCombobox").val();
|
|
if (stateVal != 0 || vChkValidation == false) {
|
|
$("#div_load").show();
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "/Inventory/GetDealerList/",
|
|
data: { sStateIdNo: stateVal, sCityIdNo: cityVal },
|
|
success: function (data) {
|
|
//Bind html
|
|
HideDealerDetailMessage();
|
|
$("#divDealerList").html(data);
|
|
//console.log(data);
|
|
//$("#btnAdd").click();
|
|
//btnCancelAddUser();
|
|
|
|
},
|
|
error: function (data) {
|
|
console.log(data);
|
|
},
|
|
complete: function (data) {
|
|
//$("#divDealerList").html(data);
|
|
//vRowIndex = 0;
|
|
//$('#tableDealerList > tbody > tr').each(function () {
|
|
// vRowIndex++;
|
|
// if ($("#hdnDealerId").val() == this.id) {
|
|
|
|
// return;
|
|
// }
|
|
//});
|
|
if (vRowIndex != -1) {
|
|
$('#tableDealerList tbody tr').eq(vRowIndex).click();
|
|
|
|
}
|
|
$("#div_load").hide();
|
|
}
|
|
});
|
|
}
|
|
else {
|
|
$("#spanState").show();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Function to Load All State on Page Load
|
|
* @method loadStateChoices
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
function loadStateChoices() {
|
|
SecurityToken = securityToken;
|
|
utcMinutes = parseInt(UtcMinutes, 10);
|
|
UserId = userId;
|
|
$.ajax({
|
|
type: "POST",
|
|
url: WCFRESTURL.GetStateListIdWise,
|
|
data: { Token: SecurityToken, UtcMinutes: utcMinutes, UserId: UserId },
|
|
dataType: "json",
|
|
|
|
success: function (data) {
|
|
//data.push({
|
|
// StateId: 0,
|
|
// StateAlias: "-Select-"
|
|
//});
|
|
data.sort(function SortState(a, b) { // non-anonymous as you ordered...
|
|
return b.StateAlias < a.StateAlias ? 1 // if b should come earlier, push a to end
|
|
: b.StateAlias > a.StateAlias ? -1 // if b should come later, push a to begin
|
|
: 0; // a and b are equal
|
|
});
|
|
|
|
$("#stateCombobox").kendoComboBox({
|
|
dataTextField: "StateAlias",
|
|
dataValueField: "StateId",
|
|
filter: "contains",
|
|
dataSource: data,
|
|
change: function () {
|
|
// loading cities according to state id
|
|
//$("#stateCombobox").data('kendoComboBox').select(0);
|
|
loadCityChoices($("#stateCombobox").val());
|
|
}
|
|
});
|
|
|
|
},
|
|
complete: function () {
|
|
$("#stateCombobox,#cityCombobox").focus(function () {
|
|
$(this).select();
|
|
});
|
|
},
|
|
error: function (jqXHR, textStatus, errorThrown) {
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
/**
|
|
* Function to Fill City According to State Id For Kendo Ui Combo.
|
|
* @method loadCityChoices
|
|
* @Param : vRowIndex Click on Dealer List Row Or Not
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
function loadCityChoices(stateId) {
|
|
SecurityToken = securityToken;
|
|
utcMinutes = parseInt(UtcMinutes, 10);
|
|
UserId = userId;
|
|
if (stateId != 0) {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: WCFRESTURL.GetCityListStateIdWise,
|
|
data: { Token: SecurityToken, UtcMinutes: utcMinutes, UserId: UserId, StateId: stateId },
|
|
dataType: "json",
|
|
success: function (data) {
|
|
data.push({
|
|
CityId: 0,
|
|
CityName: "-All-"
|
|
});
|
|
data.sort(function SortCity(a, b) { // non-anonymous as you ordered...
|
|
return b.CityName < a.CityName ? 1 // if b should come earlier, push a to end
|
|
: b.CityName > a.CityName ? -1 // if b should come later, push a to begin
|
|
: 0; // a and b are equal
|
|
});
|
|
$("#cityCombobox").kendoComboBox({
|
|
dataTextField: "CityName",
|
|
dataValueField: "CityId",
|
|
filter: "contains",
|
|
dataSource: data
|
|
});
|
|
|
|
},
|
|
complete: function () {
|
|
$("#cityCombobox").data("kendoComboBox").select(0);
|
|
},
|
|
error: function (jqXHR, textStatus, errorThrown) {
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Function to load city list state wise.
|
|
* @method LoadCityList
|
|
* @param {String} stateId selected state id
|
|
* @for ManageFleet
|
|
*/
|
|
function LoadCityList(stateId) {
|
|
var selectedState = $('#ddState').find('option:selected').text();
|
|
$("#stateName").val(selectedState);
|
|
var stateVal;
|
|
stateVal = $("#ddState").val();
|
|
if (stateVal != "-Select-")
|
|
stateVal = $("#ddState").val();
|
|
else
|
|
stateVal = 0;
|
|
|
|
if (stateVal != "") {
|
|
|
|
if (activeRequest_City && activeRequest_City.readystate != 4) {
|
|
activeRequest_City.abort();
|
|
}
|
|
activeRequest_City = $.ajax({
|
|
type: "GET",
|
|
url: "/UserInventory/showCityStateWise/",
|
|
data: { stateVal: stateVal },
|
|
success: function (data) {
|
|
// empty City dropdown
|
|
$("#ddCity").text("");
|
|
// by default add select text.
|
|
$("#ddCity").append($('<option></option>').val("").html("-Select-"));
|
|
// add data to dropdown.
|
|
if (data.list) {
|
|
for (var counter = 0; counter < data.list.length; counter++) {
|
|
$("#ddCity").append(
|
|
$('<option></option>').val(data.list[counter].Value).html(data.list[counter].Text));
|
|
}
|
|
}
|
|
if ($("#CityName").val() != "") {
|
|
$("#ddCity").val($("#CityName").val());
|
|
}
|
|
},
|
|
error: function (data) {
|
|
console.log(data);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
/**
|
|
* Function to load city list state wise.
|
|
* @method LoadCityListForVan
|
|
* @param {String} stateId selected state id
|
|
* @for ManageFleet
|
|
*/
|
|
function LoadCityListForVan(stateId, city) {
|
|
var selectedState = $('#ddState').find('option:selected').text();
|
|
$("#stateName").val(selectedState);
|
|
var stateVal;
|
|
stateVal = $("#ddState").val();
|
|
if (stateVal != "-Select-")
|
|
stateVal = $("#ddState").val();
|
|
else
|
|
stateVal = 0;
|
|
|
|
if (stateVal != "") {
|
|
|
|
if (activeRequest_City && activeRequest_City.readystate != 4) {
|
|
activeRequest_City.abort();
|
|
}
|
|
activeRequest_City = $.ajax({
|
|
type: "GET",
|
|
url: "/UserInventory/showCityStateWise/",
|
|
data: { stateVal: stateVal },
|
|
success: function (data) {
|
|
// empty City dropdown
|
|
$("#ddVanCity").text("");
|
|
// by default add select text.
|
|
$("#ddVanCity").append($('<option></option>').val("").html("-Select-"));
|
|
// add data to dropdown.
|
|
if (data.list) {
|
|
for (var counter = 0; counter < data.list.length; counter++) {
|
|
$("#ddVanCity").append(
|
|
$('<option></option>').val(data.list[counter].Value).html(data.list[counter].Text));
|
|
}
|
|
}
|
|
|
|
$("#ddVanCity option").filter(function () {
|
|
return this.text == city;
|
|
}).attr('selected', true);
|
|
},
|
|
error: function (data) {
|
|
console.log(data);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
/**
|
|
* Function to load City list and Update Grid.
|
|
* @method LoadCityListAndUpdateGrid
|
|
* @param {String} stateId selected state id
|
|
* @for ManageFleet
|
|
*/
|
|
function LoadCityListAndUpdateGrid(stateId) {
|
|
var selectedState = $('#ddState').find('option:selected').text();
|
|
$("#stateName").val(selectedState);
|
|
var stateVal;
|
|
stateVal = $("#ddState").val();
|
|
if (stateVal != "-Select-")
|
|
stateVal = $("#ddState").val();
|
|
else
|
|
stateVal = 0;
|
|
UpdateStateInGrid();
|
|
if (stateVal != "") {
|
|
|
|
if (activeRequest_City && activeRequest_City.readystate != 4) {
|
|
activeRequest_City.abort();
|
|
}
|
|
activeRequest_City = $.ajax({
|
|
type: "GET",
|
|
url: "/UserInventory/showCityStateWise/",
|
|
data: { stateVal: stateVal },
|
|
success: function (data) {
|
|
// empty City dropdown
|
|
$("#ddCity").text("");
|
|
// by default add select text.
|
|
$("#ddCity").append($('<option></option>').val("").html("-Select-"));
|
|
// add data to dropdown.
|
|
if (data.list) {
|
|
for (var counter = 0; counter < data.list.length; counter++) {
|
|
$("#ddCity").append(
|
|
$('<option></option>').val(data.list[counter].Value).html(data.list[counter].Text));
|
|
}
|
|
}
|
|
if ($("#CityName").val() != "") {
|
|
$("#ddCity").val($("#CityName").val());
|
|
}
|
|
|
|
$("#hdnDealerDefaultLatitude").val("");
|
|
$("#hdnDealerDefaultLongitude").val("");
|
|
|
|
},
|
|
error: function (data) {
|
|
console.log(data);
|
|
}
|
|
});
|
|
}
|
|
|
|
}
|
|
/**
|
|
* Function to Van Update State in Grid if Dealer State Chnage in Add Mode
|
|
* @method UpdateStateInGrid
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
function UpdateStateInGrid() {
|
|
var vDealerState = $('#ddState').find('option:selected').text();
|
|
var grid = $("#gridDealer").data("kendoGrid");
|
|
var datasource = grid.dataSource.data();
|
|
for (var i = 0; i <= datasource.length - 1; i++) {
|
|
datasource[i].set("VanState", vDealerState);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Function to Van Update City in Grid if Dealer City Chnage in Add Mode
|
|
* @method UpdateCityInGrid
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
function UpdateCityInGrid() {
|
|
var vDealerCity = $('#ddCity').find('option:selected').text();
|
|
var grid = $("#gridDealer").data("kendoGrid");
|
|
var datasource = grid.dataSource.data();
|
|
for (var i = 0; i <= datasource.length - 1; i++) {
|
|
datasource[i].set("VanCity", vDealerCity);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Function to load city list state wise.
|
|
* @method LoadCityList
|
|
* @param {String} stateId selected state id
|
|
* @for ManageFleet
|
|
*/
|
|
function LoadCityListOnDealer(stateId) {
|
|
var selectedState = $('#ddlState').find('option:selected').text();
|
|
var stateVal;
|
|
stateVal = $("#ddlState").val();
|
|
if (stateVal != "-Select-")
|
|
stateVal = $("#ddlState").val();
|
|
else
|
|
stateVal = 0;
|
|
|
|
if (stateVal != "") {
|
|
if (activeRequest_City && activeRequest_City.readystate != 4) {
|
|
activeRequest_City.abort();
|
|
}
|
|
activeRequest_City = $.ajax({
|
|
type: "GET",
|
|
url: "/UserInventory/showCityStateWise/",
|
|
data: { stateVal: stateVal },
|
|
success: function (data) {
|
|
// empty City dropdown
|
|
$("#ddlCity").text("");
|
|
// by default add select text.
|
|
$("#ddlCity").append($('<option></option>').val("").html("-Select-"));
|
|
|
|
// add data to dropdown.
|
|
if (data.list) {
|
|
for (var counter = 0; counter < data.list.length; counter++) {
|
|
$("#ddlCity").append(
|
|
$('<option></option>').val(data.list[counter].Value).html(data.list[counter].Text));
|
|
}
|
|
}
|
|
if ($("#CityName").val() != "") {
|
|
$("#ddlCity").val($("#CityName").val());
|
|
}
|
|
},
|
|
error: function (data) {
|
|
console.log(data);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* Function to load State And City On Page Load.
|
|
* @method UpdateCityInGrid
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
$(document).ready(function () {
|
|
loadStateChoices();
|
|
loadCityChoices($("#stateCombobox").val());
|
|
$("#btnDelete").hide();
|
|
|
|
|
|
});
|
|
|
|
/**
|
|
* This function create a popup for Add Van Detail.
|
|
* @method VanDetail
|
|
* @for ManageFleet
|
|
*/
|
|
function VanDetail() {
|
|
if (AllValidAddVanDetail()) {
|
|
addKendoWindowToDiv("#divCreateDealer", "Add Van Detail", "833px", 385);
|
|
// Ajax request
|
|
if (activeRequest && activeRequest.readystate != 4) {
|
|
activeRequest.abort();
|
|
}
|
|
$("#div_load").show();
|
|
activeRequest = $.ajax({
|
|
type: "POST",
|
|
url: "/Inventory/AddorEditVanDetail",
|
|
success: function (data) {
|
|
$("#divCreateDealer").parent().addClass("responsive_popup") //addClass for respond the menu
|
|
$("#divCreateDealer").html('');
|
|
$("#divCreateDealer").html('');
|
|
$("#divCreateDealer").html(data);
|
|
SetKendoWindowTitle("#divCreateDealer", "Add Van Detail");
|
|
//open form in new dialog box
|
|
$("#divCreateDealer").data("kendoWindow").open();
|
|
//$("#VanCity").val($("#ddCity option:selected").val());
|
|
$("#VanState").val($("#ddState option:selected").text());
|
|
LoadCityListForVan($("#ddState option:selected").val(), $("#ddCity option:selected").text());
|
|
//$('#VanRegistrationNo').attr('readonly', false);
|
|
$("#btnSaveVan").prop('value', 'Save');
|
|
|
|
//Set vSelectedRow = undefined so that after van added in grid no row will be selected
|
|
//it Will affect on Add Van Detail Because we get selected Row but no row is selected
|
|
vSelectedRow = undefined;
|
|
vRegistrationNoOnFocus = "";
|
|
HideVanDetailMessage();
|
|
},
|
|
complete: function () {
|
|
$("#div_load").hide();
|
|
},
|
|
error: function (data) {
|
|
console.log(data);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* This function is used to Add or Edit Van Detail In Grid.
|
|
* @method btnAddVanDetail
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
function btnAddVanDetail() {
|
|
HideVanDetailMessage();
|
|
var VanAlias = $("#VanAlias").val();
|
|
var VanState = $("#VanState").val();
|
|
var VanCity = $("#ddVanCity option:selected").val();;
|
|
var ModelName = $("#VanModelName").val();
|
|
var VanRegistrationNo = $("#VanRegistrationNo").cleanVal();
|
|
var ServiceEngineerName = $("#ServiceEngineerName").val();
|
|
var ServiceEngineerContactNumber = $("#ServiceEngineerContactNumber").val();
|
|
var ServiceEngineerApplicationLicenseKey = $("#ServiceEngineerApplicationLicenseKey").val();
|
|
var VanId = $("#hdnVanId").val();
|
|
|
|
var VanIsVisitedInterState = $("#VanIsVisitedInterState").is(':checked');
|
|
if (AllValidVanDetail()) {
|
|
if (vVanRegistratioNoExist == false) {
|
|
$("#div_load").show();
|
|
oDealer = {};
|
|
oDealer.VanId = VanId;
|
|
oDealer.VanAlias = VanAlias;
|
|
oDealer.VanState = VanState;
|
|
oDealer.VanCity = VanCity;
|
|
oDealer.VanModelName = ModelName;
|
|
oDealer.VanRegistrationNo = VanRegistrationNo;
|
|
oDealer.ServiceEngineerName = ServiceEngineerName;
|
|
oDealer.ServiceEngineerContactNumber = ServiceEngineerContactNumber;
|
|
oDealer.VanIsVisitedInterState = VanIsVisitedInterState;
|
|
oDealer.ServiceEngineerApplicationLicenseKey = ServiceEngineerApplicationLicenseKey;
|
|
var datasource;
|
|
var grid = $("#gridDealer").data("kendoGrid");
|
|
if (grid != null)
|
|
datasource = grid.dataSource;
|
|
|
|
if (typeof (vSelectedRow) == "undefined") {
|
|
if (VanId == 0) {
|
|
datasource.add({
|
|
VanId: oDealer.VanId, VanAlias: oDealer.VanAlias, VanState: oDealer.VanState, VanCity: oDealer.VanCity,
|
|
VanModelName: oDealer.VanModelName, VanRegistrationNo: oDealer.VanRegistrationNo, ServiceEngineerName: oDealer.ServiceEngineerName,
|
|
ServiceEngineerContactNumber: oDealer.ServiceEngineerContactNumber, VanIsVisitedInterState: oDealer.VanIsVisitedInterState,
|
|
ServiceEngineerApplicationLicenseKey: oDealer.ServiceEngineerApplicationLicenseKey
|
|
});
|
|
}
|
|
}
|
|
else {
|
|
vSelectedRow.set("VanAlias", oDealer.VanAlias);
|
|
vSelectedRow.set("VanState", oDealer.VanState);
|
|
vSelectedRow.set("VanCity", oDealer.VanCity);
|
|
vSelectedRow.set("VanModelName", oDealer.VanModelName);
|
|
vSelectedRow.set("VanRegistrationNo", oDealer.VanRegistrationNo);
|
|
vSelectedRow.set("ServiceEngineerName", oDealer.ServiceEngineerName);
|
|
vSelectedRow.set("ServiceEngineerContactNumber", oDealer.ServiceEngineerContactNumber);
|
|
vSelectedRow.set("ServiceEngineerApplicationLicenseKey", oDealer.ServiceEngineerApplicationLicenseKey);
|
|
vSelectedRow.set("VanIsVisitedInterState", oDealer.VanIsVisitedInterState);
|
|
|
|
}
|
|
closeWindow("#divCreateDealer");
|
|
$("#div_load").hide();
|
|
}
|
|
else {
|
|
jAlert(vVanRegistrationNoExistMsg, 'message');
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
|
|
/**
|
|
* This function is used Delete the Dealer.
|
|
* @method DeleteRecord
|
|
* @param {Bollean} IsDeleted Record is save or deleted
|
|
* @for ManageFleet
|
|
*/
|
|
function DeleteRecord(IsDeleted) {
|
|
//jConfirm('Are you sure that you want to delete the Dealer <b> ' + ConfirmDealerName + '</b> ?', 'Delete', function (result) {
|
|
jConfirm(MANAGE_FLEET_MESSAGES.confirmDeleteDealer + ' <b> ' + ConfirmDealerName + '</b> ?', 'Delete', function (result) {
|
|
if (result) {
|
|
SaveRecord(IsDeleted);
|
|
}
|
|
});
|
|
return false;
|
|
}
|
|
|
|
//function OnBeginManageFleet() {
|
|
// return true;
|
|
//}
|
|
/**
|
|
* This function is used Delete the Dealer.
|
|
* @method SaveRecord
|
|
* @param {Boolean} IsDeleted Record is deleted or not
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
function SaveRecord(IsDeleted) {
|
|
//if (IsDeleted == true) {
|
|
// jConfirm('Are you sure that you want to delete the EOS Team Member <b> ' + ConfirmDealerName + '</b> ?', 'Delete', function (result) {
|
|
// isd
|
|
// })
|
|
//}
|
|
if (AllValid() || IsDeleted == true) {
|
|
if (vDealerContactExist == false || IsDeleted == true) {
|
|
$("#div_load").show();
|
|
var grid = $("#gridDealer").data("kendoGrid");
|
|
var datasource = grid.dataSource;
|
|
var vOrganizationId = $("#ddOrganization option:selected").val();
|
|
var vDealerName = $("#DealerDealerName").val();
|
|
var vStateId = $("#ddState option:selected").text();
|
|
var vCityId = $("#ddCity option:selected").val();
|
|
var vanList = datasource.data();
|
|
var vDealerId = $("#hdnDealerId").val();
|
|
var vNewDealerId = $("#NewDealerId").val();
|
|
var vDealerContactNo = $("#DealerContactNo").val();
|
|
var vDealerDefaultLatitude = $("#hdnDealerDefaultLatitude").val();
|
|
var vDealerDefaultLongitude = $("#hdnDealerDefaultLongitude").val();
|
|
var DealerData = {
|
|
DealerOrganizationId: vOrganizationId,
|
|
DealerDealerName: vDealerName,
|
|
DealerState: vStateId,
|
|
DealerCity: vCityId,
|
|
VanList: vanList,
|
|
DealerId: vDealerId,
|
|
DealerContactNo: vDealerContactNo,
|
|
DealerDealerDefaultLattitude: vDealerDefaultLatitude,
|
|
DealerDealerDefaultLongitude: vDealerDefaultLongitude,
|
|
IsDeleted: IsDeleted,
|
|
NewDealerId: vNewDealerId
|
|
};
|
|
$.ajax({
|
|
contentType: 'application/json; charset=utf-8',
|
|
dataType: 'json',
|
|
type: 'POST',
|
|
url: '/Inventory/SaveManageFleet',
|
|
data: JSON.stringify(DealerData),
|
|
success: function (data) {
|
|
jAlert(data.message, 'message');
|
|
HideDealerDetailMessage();
|
|
HideVanDetailMessage();
|
|
if (IsDeleted) {
|
|
//$("#cityCombobox").data("kendoComboBox").select(0);
|
|
//$("#stateCombobox").data("kendoComboBox").select(0);
|
|
//loadStateChoices();
|
|
//loadCityChoices($("#stateCombobox").val());
|
|
document.getElementById("btnAdd").click();
|
|
GetDealerNameList(false, vRowIndex);
|
|
}
|
|
else if (data.success == false) {
|
|
//do nothing
|
|
}
|
|
else {
|
|
$("#btnAdd").show();
|
|
$("#btnDelete").show();
|
|
//alert(DealerId);
|
|
$("#hdnDealerId").val(data.DealerId);
|
|
GetDealerDetailByID(data.DealerId);
|
|
|
|
}
|
|
|
|
|
|
//$("#tableDealerList tbody tr.eq(" + vRowIndex + ")").trigger('click');
|
|
//$("#tableDealerList tbody tr.SelectedRow").trigger('click');
|
|
},
|
|
failure: function (response) {
|
|
|
|
},
|
|
complete: function () {
|
|
if ($("#stateCombobox").val() != "") {
|
|
GetDealerNameList(false, -1);
|
|
}
|
|
$("#div_load").hide();
|
|
}
|
|
|
|
});
|
|
}
|
|
else {
|
|
jAlert(vDealerContactNoExistMsg, 'message');
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
*This function is used to Manage Fleet in Add Mode
|
|
* @method addDealer
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
function addDealer() {
|
|
|
|
var sDealer = "";
|
|
//send ajax report to add user
|
|
|
|
$.ajax({
|
|
type: "Get",
|
|
url: "/Inventory/AddOrEditFleet/",
|
|
data: { sDealerId: sDealer },
|
|
success: function (data) {
|
|
$("#divAddOrEditFleet").html("");
|
|
$("#divAddOrEditFleet").html(data);
|
|
$("#btnAdd,#btnDelete").hide();
|
|
//$("#ddOrganization").show();
|
|
//$("#ddState").show();
|
|
//$("#ddCity").show();
|
|
//$("#DealerOrganizationName").hide();
|
|
//$("#DealerStateName").hide();
|
|
//$("#DealerCity").hide();
|
|
$("#btnSaveFleet").prop('value', 'Save');
|
|
HideDealerDetailMessage();
|
|
HideVanDetailMessage();
|
|
$("#NewDealerId").prop('readonly', false);
|
|
},
|
|
error: function (data) {
|
|
console.log(data);
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
* This function is Used to Validate the Complete Control Before Saving Dealer Detail
|
|
* @method AllValid
|
|
* @for ManageFleet
|
|
*/
|
|
function AllValid() {
|
|
HideDealerDetailMessage();
|
|
var DealerOrganization = $("#ddOrganization option:selected").val();
|
|
var DealerName = $("#DealerDealerName").val();
|
|
var DealerState = $("#ddState option:selected").val();
|
|
var DealerCity = $("#ddCity option:selected").val();
|
|
var DealerContactNo = $("#DealerContactNo").val();
|
|
var DealerId = $("#NewDealerId").val();
|
|
var vResult = false;
|
|
//var grid = $("#gridDealer").data("kendoGrid");
|
|
//var datasource = grid.dataSource.data().length;
|
|
if (DealerId == "") {
|
|
$("#spnDealerId").html("*");
|
|
$("#spnDealerId").show();
|
|
}
|
|
else if (DealerId.length < 6 || DealerId.length > 8) {
|
|
$("#spnDealerId").html("Dealer SCode length should be in between 6 and 8 characters.");
|
|
$("#spnDealerId").show();
|
|
}
|
|
else if (DealerOrganization == "")
|
|
$("#spnOrganizationId").show();
|
|
else if (DealerName == "")
|
|
$("#spnDealerName").show();
|
|
else if (DealerState == "")
|
|
$("#spnDealerState").show();
|
|
else if (DealerCity == "")
|
|
$("#spnDealerCity").show();
|
|
else if (DealerContactNo == "") {
|
|
$("#spnDealerContactNo").html("*");
|
|
$("#spnDealerContactNo").show();
|
|
}
|
|
else if (DealerContactNo.length != 10) {
|
|
$("#spnDealerContactNo").html("Mobile No. should be of 10 characters.");
|
|
$("#spnDealerContactNo").show();
|
|
}
|
|
else if ($("#hdnDealerDefaultLatitude").val() == "" || $("#hdnDealerDefaultLatitude").val() == "0")
|
|
//jAlert("Please Set Dealer Location");
|
|
jAlert(MANAGE_FLEET_MESSAGES.setDealerLocation);
|
|
else if (ChkDealerStateAndCityWithVanStateVanStateAndCity() == false) {
|
|
}
|
|
else
|
|
vResult = true;
|
|
|
|
//else if (datasource == 0)
|
|
// alert("Please enter van detail");
|
|
|
|
|
|
return vResult;
|
|
}
|
|
|
|
/**
|
|
* This function is Used to Validate the Complete Control Before Saving Dealer Van Detail
|
|
* @method AllValidVanDetail
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
function AllValidVanDetail() {
|
|
HideVanDetailMessage();
|
|
|
|
var VanAlias = $("#VanAlias").val();
|
|
var VanState = $("#VanState").val();
|
|
var VanCity = $("#ddVanCity option:selected").val();
|
|
var VanModelName = $("#VanModelName").val();
|
|
var VanRegistrationNo = $("#VanRegistrationNo").val();
|
|
var ServiceEngineerName = $("#ServiceEngineerName").val();
|
|
var ServiceEngineerContactNumber = $("#ServiceEngineerContactNumber").val();
|
|
|
|
var vResult = false;
|
|
|
|
if (VanAlias == "")
|
|
$("#spnVanName").show();
|
|
else if (VanState == "")
|
|
$("#spnVanState").show();
|
|
else if (VanCity == "")
|
|
$("#spanVanCity").show();
|
|
else if (VanModelName == "")
|
|
$("#spanVanModelName").show();
|
|
else if (VanRegistrationNo == "")
|
|
$("#spanVanRegistration").show();
|
|
else if (ServiceEngineerName == "")
|
|
$("#spanVanServiceEngineerName").show();
|
|
else if (ServiceEngineerContactNumber == "") {
|
|
$("#spanVanServiceEngineerContactNo").html("*");
|
|
$("#spanVanServiceEngineerContactNo").show();
|
|
}
|
|
else if (ServiceEngineerContactNumber.length != 10) {
|
|
$("#spanVanServiceEngineerContactNo").html("Mobile No. should be of 10 characters.");
|
|
$("#spanVanServiceEngineerContactNo").show();
|
|
}
|
|
else
|
|
vResult = true;
|
|
|
|
return vResult;
|
|
}
|
|
|
|
|
|
/**
|
|
* This function is Used to Check the Duplicate Contact No Of Dealer
|
|
* @method CheckDealerDupContactNo
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
function CheckDealerDupContactNo() {
|
|
var sDealerDetail = "dealer";
|
|
var sDealerContactNo = $("#DealerContactNo").val();
|
|
if (vDealerContactNoOnFocus != sDealerContactNo) {
|
|
$("#div_load").show();
|
|
//send ajax report to add user
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "/Inventory/CheckDealerContactNoAndVanRegistrationNo/",
|
|
data: { sDealerDetail: sDealerDetail, sDealerContactNo: sDealerContactNo },
|
|
success: function (data) {
|
|
if (data.status == "2") {
|
|
vDealerContactExist = true;
|
|
vDealerContactNoExistMsg = data.message;
|
|
jAlert(data.message, 'message');
|
|
}
|
|
else if (data.status == "1") {
|
|
vDealerContactExist = false;
|
|
}
|
|
},
|
|
error: function (data) {
|
|
console.log(data);
|
|
},
|
|
complete: function () {
|
|
$("#div_load").hide();
|
|
}
|
|
});
|
|
}
|
|
else {
|
|
vDealerContactExist = false;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* This function is Used to Check the Duplicate Registration No Of Van And Also Check in grid
|
|
* @method CheckVanDupRegistrationNo
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
function CheckVanDupRegistrationNo() {
|
|
var sDealerDetail = "van";
|
|
var sVanRegistrationNo = $("#VanRegistrationNo").cleanVal();
|
|
|
|
if (CheckVanRegistrationOnGrid(sVanRegistrationNo)) {
|
|
if (vRegistrationNoOnFocus != sVanRegistrationNo) {
|
|
//send ajax report to add user
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "/Inventory/CheckDealerContactNoAndVanRegistrationNo/",
|
|
data: { sDealerDetail: sDealerDetail, sDealerContactNo: sVanRegistrationNo },
|
|
success: function (data) {
|
|
if (data.status == "2") {
|
|
vVanRegistratioNoExist = true;
|
|
vVanRegistrationNoExistMsg = data.message;
|
|
jAlert(data.message, 'message');
|
|
}
|
|
else if (data.status == "1") {
|
|
vVanRegistratioNoExist = false;
|
|
}
|
|
},
|
|
error: function (data) {
|
|
console.log(data);
|
|
}
|
|
});
|
|
}
|
|
else {
|
|
vVanRegistratioNoExist = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* This function is Used to Check the Duplicate Registration No. in grid
|
|
* @method CheckVanRegistrationOnGrid
|
|
* @param {string} vVanRegistrationNo Van Registration that exist or not
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
function CheckVanRegistrationOnGrid(vVanRegistrationNo) {
|
|
var grid = $("#gridDealer").data("kendoGrid");
|
|
datasource = grid.dataSource;
|
|
var RegistrationNoList = datasource.data();
|
|
for (var i = 0; i <= RegistrationNoList.length - 1; i++) {
|
|
if (typeof (vSelectedRow) != "undefined" && vSelectedRow.VanRegistrationNo.toUpperCase() == vVanRegistrationNo.toUpperCase()) {
|
|
vVanRegistratioNoExist = false;
|
|
return true;
|
|
}
|
|
else if (RegistrationNoList[i].VanRegistrationNo.toUpperCase() == vVanRegistrationNo.toUpperCase() && typeof (vSelectedRow) != "undefined" &&
|
|
vSelectedRow.VanRegistrationNo.toUpperCase() != vVanRegistrationNo.toUpperCase()) {
|
|
vVanRegistratioNoExist = true;
|
|
vVanRegistrationNoExistMsg = "This registration is already added by you for Van : " + RegistrationNoList[i].VanAlias;
|
|
jAlert(vVanRegistrationNoExistMsg, 'message');
|
|
return false;
|
|
}
|
|
else if (RegistrationNoList[i].VanRegistrationNo.toUpperCase() == vVanRegistrationNo.toUpperCase()) {
|
|
vVanRegistratioNoExist = true;
|
|
vVanRegistrationNoExistMsg = "This registration is already added by you for Van : " + RegistrationNoList[i].VanAlias;
|
|
jAlert(vVanRegistrationNoExistMsg, 'message');
|
|
return false;
|
|
}
|
|
|
|
}
|
|
vVanRegistratioNoExist = false;
|
|
return true;
|
|
}
|
|
|
|
|
|
/**
|
|
* This function is Used to Check Whether the Dealer State ANd city is same as Van state or city Or not
|
|
* @method ChkDealerStateAndCityWithVanStateVanStateAndCity
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
function ChkDealerStateAndCityWithVanStateVanStateAndCity() {
|
|
var grid = $("#gridDealer").data("kendoGrid");
|
|
datasource = grid.dataSource;
|
|
var VanList = datasource.data();
|
|
var vStateId = $("#ddState option:selected").text();
|
|
var vCityId = $("#ddCity option:selected").val();
|
|
|
|
for (var i = 0; i <= VanList.length - 1; i++) {
|
|
if (VanList[i].VanState != vStateId) {
|
|
//jAlert("The dealer state and van state should be same. please check van : " + VanList[i].VanAlias, 'message');
|
|
jAlert(MANAGE_FLEET_MESSAGES.chkDealerVanStateCity + " " + VanList[i].VanAlias, 'message');
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* This function is Used to Hide The Validation Message For Add Van Detail
|
|
* @method AllValidAddVanDetail
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
function AllValidAddVanDetail() {
|
|
HideDealerDetailMessage();
|
|
var DealerState = $("#ddState option:selected").val();
|
|
var DealerCity = $("#ddCity option:selected").val();
|
|
|
|
var vResult = false;
|
|
if (DealerState == "")
|
|
$("#spnDealerState").show();
|
|
else if (DealerCity == "" || DealerCity == "-Select-")
|
|
$("#spnDealerCity").show();
|
|
else if (vDealerContactExist == true)
|
|
jAlert(vDealerContactNoExistMsg, 'message');
|
|
else
|
|
vResult = true;
|
|
|
|
return vResult;
|
|
}
|
|
|
|
/**
|
|
* This function is Used to Perform Cancel Button On Van Detail
|
|
* @method btnUndoVanDealerDetail
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
|
|
function btnUndoVanDealerDetail() {
|
|
if (typeof (vSelectedRow) != "undefined") {
|
|
if ($("#hdnVanId").val() != "" || vSelectedRow.VanAlias != "") {
|
|
$("#VanAlias").val(vSelectedRow.VanAlias);
|
|
$("#VanState").val(vSelectedRow.VanState);
|
|
$("#VanCity").val(vSelectedRow.VanCity);
|
|
$("#VanModelName").val(vSelectedRow.VanModelName);
|
|
$("#VanRegistrationNo").val(vRegNo);
|
|
$("#ServiceEngineerName").val(vSelectedRow.ServiceEngineerName);
|
|
$("#ServiceEngineerContactNumber").val(vSelectedRow.ServiceEngineerContactNumber);
|
|
$('#VanIsVisitedInterState').prop('checked', vSelectedRow.VanIsVisitedInterState);
|
|
}
|
|
}
|
|
else {
|
|
$("#VanAlias").val("");
|
|
$("#VanModelName").val("");
|
|
$("#VanRegistrationNo").val("");
|
|
$("#ServiceEngineerName").val("");
|
|
$("#ServiceEngineerContactNumber").val("");
|
|
$('#VanIsVisitedInterState').prop('checked', false);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* This function is Used to Perform Cancel Button On Dealer Detail
|
|
* @method btnCancelAddUser
|
|
* @for ManageFleet
|
|
*/
|
|
|
|
function btnCancelAddUser() {
|
|
//$("#tableDealerList tbody tr.SelectedRow").trigger('click');
|
|
if (document.getElementById('tableDealerList')) {
|
|
$("#tableDealerList tbody tr.SelectedRow").trigger('click');
|
|
} else {
|
|
$("#divDealerList").html("");
|
|
$("#btnAdd").show();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
</pre>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src="../assets/vendor/prettify/prettify-min.js"></script>
|
|
<script>prettyPrint();</script>
|
|
<script src="../assets/js/yui-prettify.js"></script>
|
|
<script src="../assets/../api.js"></script>
|
|
<script src="../assets/js/api-filter.js"></script>
|
|
<script src="../assets/js/api-list.js"></script>
|
|
<script src="../assets/js/api-search.js"></script>
|
|
<script src="../assets/js/apidocs.js"></script>
|
|
</body>
|
|
</html>
|