EOS/Views/Inventory/AddOrEditFleet.cshtml
Nidhi Bhargava f0c1ab20e1 code push
2025-09-04 16:25:07 +05:30

278 lines
14 KiB
Plaintext

@model GODATA.Models.Inventory.ManageFleet
@Html.ValidationSummary(true)
@Html.HiddenFor(model => model.CityId, new { id = "CityName" })
@Html.HiddenFor(model => model.DealerId, new { id = "hdnDealerId" })
@Html.HiddenFor(model => model.DealerDealerDefaultLattitude, new { id = "hdnDealerDefaultLatitude" })
@Html.HiddenFor(model => model.DealerDealerDefaultLongitude, new { id = "hdnDealerDefaultLongitude" })
@Html.HiddenFor(model => model.DealerState, new { id = "hdnDealerStateId" })
<div class="managefleet_dealerdetail_wrapper">
<img src="~/Content/css/images/dealer-detail-tag01.png" class="detail_lables" />
<table class="themeTable" cellpadding="5" cellspacing="0" width="100%" style="border-top: 1px solid #dedede; margin-top: 2px;">
<tbody class="">
<tr>
<td class="tableCelllabel bordernone">
<span class="darktxt">
@Html.LabelFor(model => model.NewDealerId)
</span><span class="error" style="color: #ee1d23"> * </span>
</td>
<td class="tableCellinfo bordernone SelectDD">
@Html.TextBoxFor(model => model.NewDealerId, new { @onkeypress = "return AlphaNumeic(event,this)", @onblur = "CheckDealerNameExistOrNot()" })
<span class="error" id="spnDealerId" style="color: #ee1d23">* </span>
<div class="tooltip">
<img id="img_help" src="~/Content/css/images/help_favicon.png" height="20" width="20" alt="help" />
<span>
Ex: 1A1234,<br />
&nbsp;&nbsp;&nbsp;1A12345,<br />
&nbsp;&nbsp;1A123456
</span>
</div>
</td>
<td class="tableCelllabel bordernone">
<span class="darktxt">
@Html.LabelFor(model => model.DealerOrganizationId)
</span><span class="error" style="color: #ee1d23"> * </span>
</td>
<td class="tableCellinfo bordernone SelectDD">
@Html.DropDownListFor(model => model.DealerOrganizationId, (IEnumerable<SelectListItem>)ViewBag.OrganizationList, "-Select-", new { @id = "ddOrganization", @onchange = "LoadStateListRegionWise(id, 'ddState','ddCity')" })
@*@Html.DropDownListFor(model => model.DealerOrganizationId, (IEnumerable<SelectListItem>)ViewBag.OrganizationList, "-Select-", new { @id = "ddOrganization" })*@
@Html.TextBoxFor(model => model.DealerOrganizationName, new { @readonly = "readonly", @style = "display:none" })
<span class="error" id="spnOrganizationId" style="color: #ee1d23">* </span>
</td>
</tr>
<tr>
<td class="tableCelllabel bordernone">
<span class="darktxt">
@Html.LabelFor(model => model.DealerDealerName)
</span><span class="error" style="color: #ee1d23"> * </span>
</td>
<td class="tableCellinfo bordernone">
@Html.EditorFor(model => model.DealerDealerName, new { @id = "DealerName" })
<span class="error" id="spnDealerName" style="color: #ee1d23">* </span>
</td>
<td class="tableCelllabel">
<span class="darktxt">
@Html.LabelFor(model => model.DealerState)
</span><span class="error" style="color: #ee1d23"> * </span>
</td>
<td class="tableCellinfo SelectDD">
@*<select id="ddState" data-val="true" data-val-required="*" onchange="LoadCityListAndUpdateGrid()" name="DealerState">
<option value="-Select-">-Select-</option>
</select>*@
@Html.DropDownListFor(model => model.DealerState, (IEnumerable<SelectListItem>)ViewBag.StateList, "-Select-", new { @id = "ddState", @onchange = "LoadCityListAndUpdateGrid()" })
@Html.TextBoxFor(model => model.DealerStateName, new { @readonly = "readonly", @style = "display:none" })
<span class="error" id="spnDealerState" style="color: #ee1d23">* </span>
</td>
</tr>
<tr>
<td class="tableCelllabel">
<span class="darktxt">
@Html.LabelFor(model => model.DealerCity)
</span><span class="error" style="color: #ee1d23"> * </span>
</td>
<td class="tableCellinfo SelectDD">
<select id="ddCity" data-val="true" data-val-required="*" onchange="UpdateCityInGrid()" name="City">
<option value="-Select-">-Select-</option>
</select>
@Html.TextBoxFor(model => model.DealerCity, new { @readonly = "readonly", @style = "display:none" })
<span id="spnDealerCity" class="error" style="display: none; color: #ee1d23">*</span>
</td>
<td class="tableCelllabel bordernone">
<span class="darktxt">
@Html.LabelFor(model => model.DealerContactNo)
</span><span class="error" style="color: #ee1d23"> * </span>
</td>
<td class="tableCellinfo bordernone SelectDD" id="tdDealerContactNo">
@Html.TextBoxFor(model => model.DealerContactNo, new { @onblur = "CheckDealerDupContactNo()", @onkeypress = "return isNumber(event,this);" })
<span class="error" id="spnDealerContactNo" style="color: #ee1d23">* </span>
</td>
</tr>
<tr>
@*<td class="tableCelllabel">
<span class="darktxt">
Product Variant
</span><span class="error" style="color: red;display:none;" id="spnproductVariant"></span>
</td>
<td class="tableCellinfo SelectDD" style="width: 90px;display: block">
<select id="ddVehicleType" name="VehicleType" onchange="onChangefuelType();">
<option value="Diesel">Diesel</option>
<option value="CNG">CNG</option>
<option value="Electric">Electric</option>
</select>
</td>*@
<tr>
<td class="tableCelllabel">
<span class="darktxt">Product Variant</span>
</td>
<td class="tableCellinfo darktxt fleet_combo">
<input id="fueltypeComboboxDealer" onchange="setvaldealer();" placeholder="Fuel type" onfocus="this.select();" style="width: 200px;" />
</td>
</tr>
<tr id="trSetLocation">
<td class="tableCelllabel bordernone" id="tdlblSetDealerLoc">
<span class="darktxt">
<span>Dealer location</span> <span class="error" style="color: #ee1d23">* </span>
</span>
</td>
<td class="tableCellinfo bordernone SelectDD" id="tdbtnSetDealerLoc">
<input type="button" class="button_blue Fullength" value="Dealer location" style="width: 74% !important; margin: 4px 0 0 0;" onclick="SetDealerLocation()" />
</td>
<td class="tableCelllabel bordernone">
&nbsp;
</td>
<td class="tableCellinfo bordernone">
&nbsp;
</td>
</tr>
</tbody>
</table>
<div class="Mange_Fleet_Details">
<div class="fleft">
<img src="~/Content/css/images/van-detail-tag01.png" class="detail_lables" />
</div>
<div class="fright"><a class='k-button k-button-icontext' onclick='VanDetail()' id="btnAddVanDetail" href='#'>Add Van Detail</a></div>
<div class="clear"></div>
@(Html.Kendo().Grid(Model.VanList)
.Name("gridDealer").Filterable().Pageable().Scrollable().Resizable(resize => resize.Columns(true))
.Events(events => events.DataBound("onRowBoundDealer").ColumnResize("onColumnResize")).Sortable()
.Columns(columns =>
{
columns.Bound(model => model.VanAlias);
columns.Bound(model => model.VanState);
columns.Bound(model => model.VanCity);
columns.Bound(model => model.VanModelName);
columns.Bound(model => model.VanRegistrationNo);
columns.Bound(model => model.ServiceEngineerName);
columns.Bound(model => model.ServiceEngineerAlias).Title("Fuel Type");
columns.Bound(model => model.ServiceEngineerContactNumber);
columns.Bound(model => model.ServiceEngineerApplicationLicenseKey).Title("License Key <sup>#</sup>");
columns.Command(command =>
command.Custom("SetVanLocation").Text("Van Location").Click("ShowVanLocation").HtmlAttributes(new { title = "Show Details", @id = "cmdVanLocation" })).Width(150);
columns.Command(command =>
{
command.Custom("Edit").Text("").Click("editDealer").HtmlAttributes(new { title = "Edit" });
command.Custom("Delete").Text("").Click("DeleteDealer").HtmlAttributes(new { title = "Delete", @id = "cmdDelete" });
}).Title("Device Actions");
columns.Bound(model => model.IsVanRelease).ClientTemplate(
"# if (IsVanRelease == true) { #" +
"<img src='" + Url.Content("~/Content/images/UnRelease.png") + "' alt='Van Not Release' onclick=\"ReleaseDevice('#=VanAlias#','#=VanId#')\" />" +
"# } else { #" +
"<img src='" + Url.Content("~/Content/images/Release.png") + "' alt='Van Release' />" +
"# } #"
);
columns.Bound(model => model.IsDeletedVan).Hidden();
columns.Bound(model => model.IsVanRelease).Hidden();
columns.Bound(model => model.VanIsVisitedInterState).ClientTemplate("#= VanIsVisitedInterState ? 'Yes' : 'No' #").Hidden();
columns.Bound(model => model.VanId).HtmlAttributes(new { @id = "hdnvanid" }).Hidden();
columns.Bound(model => model.VanDefaultLatitude).Hidden();
columns.Bound(model => model.VanDefaultLongitude).Hidden();
columns.Bound(model => model.ServiceEngineerId).Hidden();
})
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.PageSize((int)ViewBag.pageSize)
.ServerOperation(false)
)
)
</div>
</div>
<div id="divCreateDealer" style="display: none; /*min-height: 150px; height: auto; */">
</div>
<div id="divShowVanLocation" style="display: none; /*min-height: 150px; height: auto; */">
</div>
<div id="divShowDealerLocation" style="display: none; /*min-height: 150px; height: auto; */">
</div>
@*<div class="Create_Wrp">
<input type="submit" value="Save" id="btnSaveFleet" class="button_blue" style="margin-top: 0px; width: auto; overflow: hidden; height: 27px; line-height: 9px;" onclick="SaveRecord();" />
<input type="button" value="Cancel" class="button_blue" style="background: #ee2e22 !important; margin-top: 0px; width: auto; overflow: hidden; height: 27px; line-height: 9px;" onclick="btnCancelAddUser();" />
</div>*@
<script>
showDealerDetails();
var stateId = '@ViewBag.StateId';
$(document).ready(function () {
//var multiselect = $('#ddVehicleType').kendoMultiSelect({
// // dataSource: vehicleProductVariantList,
// dataTextField: 'Text',
// dataValueField: 'Value',
// filter: 'contains',
// placeholder: "-Select-"
//}).data("kendoMultiSelect");
//multiselect.value(["diesel", "cng"]);
loadfuelTypeDealer();
// loadfuelTypeVan();
//setTimeout(function () {
// $("#fueltypeComboboxDealer").autocomplete({
// alert("aa");
// });//.val('Diesel/CNG/Electric').data('autocomplete')._trigger('select');
//}, 2000);
});
//var multiselect = $('#ddVehicleType').kendoMultiSelect({
// dataSource: data,
// dataTextField: 'name',
// dataValueField: 'value',
// filter: 'contains',
// placeholder: "Add Filter",
// delay: 0,
// minLength: 2,
// highlightFirst: true,
// ignoreCase: true,
// change: function (event) {
// console.log("change");
// }
//}).data("kendoMultiSelect");
setTimeout(function () {
$("#ddState").val(stateId);
LoadCityListAndUpdateGrid();
}, 1000);
//searchUser();
</script>
<style type="text/css">
.SelectDD select {
width: 171px;
padding: 6px 0px;
font-family: 'HermesFB Regular';
font-family: Arial;
text-indent: 3px;
}
div.tooltip span {
border-radius: 4px;
box-shadow: 5px 5px 8px #ccc;
margin-left: -2px;
margin-top: -10px;
width: 122px;
}
</style>