Advertisement
Guest User

Untitled

a guest
Aug 15th, 2018
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 48.55 KB | None | 0 0
  1. @using Lss.Extensions;
  2. @using Lss.Security;
  3. @using Application.Models
  4. @using Mindscape.LightSpeed
  5. @model Application.Models.Reservation
  6. @Html.AntiForgeryToken()
  7. @Html.HiddenFor(model => model.Id)
  8. @Html.HiddenFor(model => model.LockVersion)
  9. @Html.HiddenFor(model => model.OrganizationId)
  10. @Html.HiddenFor(model => model.SiteId)
  11. @Html.HiddenFor(model => model.Trips[0].Id)
  12. @Html.Hidden("Trips[0].Origin_SegmentId", Model.Trips[0].Origin_Segment.EntityState != EntityState.New ? Model.Trips[0].Origin_SegmentId.ToString() : String.Empty)
  13. @Html.Hidden("Trips[0].Destination_SegmentId", Model.Trips[0].Destination_Segment.EntityState != EntityState.New ? Model.Trips[0].Destination_SegmentId.ToString() : String.Empty)
  14. @Html.Hidden("Trips[0].TripNo", "123")
  15.  
  16.  
  17. <script type="text/javascript">
  18. var originStreetSegmentUrl = '@Url.Action("_GetOriginStreetSegment")';
  19. var originLandmarkSegmentUrl = '@Url.Action("_GetOriginLandmarkSegment")';
  20. var destinationStreetSegmentUrl = '@Url.Action("_GetDestinationStreetSegment")';
  21. var destinationLandmarkSegmentUrl = '@Url.Action("_GetDestinationLandmarkSegment")';
  22. var contactUrl = '@Url.Action("Add", "Contact")';
  23. var contactPhoneUrl = '@Url.Action("_GetContactPhoneNumber")';
  24. var contactByNameAndPhoneNumber = '@Url.Action("_GetContactByNameAndPhoneNumber")';
  25. var tempTripPriceUrl = '@Url.Action("Estimate", "Trip_PriceTemp")';
  26. var siteIDinput='@Html.HiddenFor(model => model.SiteId)';
  27.  
  28. var siteID=siteIDinput.substr(siteIDinput.lastIndexOf("=")+2,36);
  29. var originSegmentData = @(Html.Raw(ViewData["OriginSegmentInfo"].ToString()));
  30. var destinationSegmentData = @(Html.Raw(ViewData["DestinationSegmentInfo"].ToString()));
  31.  
  32. </script>
  33. <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
  34. <link href="https://webservices.tranware.net/SaaS/customJS/standard.css" rel="stylesheet">
  35. <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;key=AIzaSyDYvzQccmiWpQFxG0os_ETJbT3njSb48Kc&amp;libraries=places"></script>
  36. <script src="https://webservices.tranware.net/SaaS/customJS/SASK.js"></script>
  37.  
  38.  
  39. <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  40. <table style="margin: 0 auto;">
  41. <tr>
  42. <td>
  43. <table class="l-fields" style=" height: 300px;">
  44. <tr>
  45. <td class="l-label" colspan="4" style="text-align: center;">R &nbsp;&nbsp;&nbsp;&nbsp;E &nbsp;&nbsp;&nbsp;&nbsp;S &nbsp;&nbsp;&nbsp;&nbsp;E &nbsp;&nbsp;&nbsp;&nbsp;R &nbsp;&nbsp;&nbsp;&nbsp;V &nbsp;&nbsp;&nbsp;&nbsp;A &nbsp;&nbsp;&nbsp;&nbsp;T &nbsp;&nbsp;&nbsp;&nbsp;I &nbsp;&nbsp;&nbsp;&nbsp;O &nbsp;&nbsp;&nbsp;&nbsp;N &nbsp;&nbsp;&nbsp;&nbsp;</td>
  46. </tr>
  47. <tr>
  48. <td class="l-label">@Html.Lss().LabelFor(model => model.ReservationNo)</td>
  49. <td class="l-field">@Html.Lss().Span().Name("ReservationNo").Text("Pending")</td>
  50. </tr>
  51. <tr>
  52. <td class="l-label"></td>
  53. <td>
  54. <input id="profileSearch" placeholder="Profile search" tabindex = '1' class="k-textbox" type="text" />
  55. </td>
  56. </tr>
  57. <tr>
  58. <td class="l-label">
  59.  
  60. </td>
  61.  
  62. <td class="l-field">
  63. <input id="contactSearch" placeholder="Contact search" class="k-textbox" type="text"/>
  64. <div style="display: none;">
  65. @(Html.Lss().ComboBoxFor(model => model.ContactId)
  66. .DataSource(dataSource => dataSource
  67. .Read(read => read
  68. .Action("_GetListContactId", "Reservation", Request.QueryString.ToRouteValueDictionary())))
  69. .DefaultValue(Model.Contact).Events(e => e.Change("selectPassenger_Contact")).HtmlAttributes(new {style = "display: none;", TabIndex = -1 }))
  70. @Html.Lss().RequiredFieldIndicatorFor(model => model.ContactId)
  71. @Html.ValidationMessageFor(model => model.ContactId)
  72. </div>
  73. </td>
  74. <td class="l-label" colspan="2">
  75. @(Html.Lss().Button()
  76. .Name("btnAddContact")
  77. .OnClick("btnAddContact_Click('ContactId')")
  78. .InputType("button")
  79. .Text("Add New Contact").HtmlAttributes(new { TabIndex = -1 }))
  80.  
  81.  
  82. @(Html.Lss().Button()
  83. .Name("btnPreviousTrips")
  84. .Text("Lookup Existing Trips")
  85. .InputType("button")
  86. .HtmlAttributes(new { TabIndex = 2 })
  87. .OnClick(string.Format(
  88. @"$.lss.window.openPopup(
  89. {{
  90. url : '{0}' + '?Passenger_ContactId=' + $('#ContactId').val(),
  91. close: lookupClose
  92. }});",
  93. Url.Action("LookupPreviousTrips", "Grid", new
  94. {
  95. virtualAction = "LookupPreviousTrips"
  96. })
  97. )))
  98. </td>
  99.  
  100. </tr>
  101.  
  102. <tr>
  103.  
  104. <td class="l-label">Contact Phone #</td>
  105. <td class="l-field">
  106. @(Html.Lss().TextBox().Name("PhoneNo").HtmlAttributes(new { TabIndex = -1 }))
  107. @Html.Lss().RequiredFieldIndicatorFor(model => model.Contact.Phone)
  108.  
  109. @Html.ValidationMessageFor(model => model.Contact.Phone)
  110. </td>
  111. <td class="l-label">@Html.Lss().LabelFor(model => model.RateId)</td>
  112.  
  113. <script>
  114. //E2G Mark - The functions in this script tag were added to facilitate the automatic setting of Rate defaults and any associated Trip Priority
  115. function rateIdDataSourceChange() {
  116. updateRateIdDefaults();
  117. }
  118.  
  119. function rateIdChange(e) {
  120. var rateComboBox = $("#RateId").data("kendoComboBox");
  121. var tripPriorityComboBox = $("#Trips_0__TripPriorityId").data("kendoComboBox");
  122. tripPriorityComboBox.value(null);
  123. tripPriorityComboBox.trigger("change");
  124. tripPriorityComboBox.dataSource.fetch().then(function(value) {
  125. if (rateComboBox.dataItem() && rateComboBox.dataItem().TripPriorityId !== "00000000-0000-0000-0000-000000000000") { //Implies no TripPriorityId was present itn the Rate table
  126. tripPriorityComboBox.value(rateComboBox.dataItem().TripPriorityId);
  127. tripPriorityComboBox.trigger("change");
  128. } else {
  129. tripPriorityComboBox.value(null);
  130. tripPriorityComboBox.trigger("change");
  131. }
  132. });
  133. }
  134.  
  135. function updateRateIdDefaults() {
  136. var rateComboBox = $("#RateId").data("kendoComboBox");
  137. var dataItems = rateComboBox.dataSource.data();
  138. if (rateComboBox.text() == "") {
  139. for (i = 0; i<dataItems.length; i++) {
  140. if (dataItems[i].IsDefault) {
  141. rateComboBox.value(dataItems[i].Value);
  142. var tripPriorityComboBox = $("#Trips_0__TripPriorityId").data("kendoComboBox");
  143. tripPriorityComboBox.value(null);
  144. tripPriorityComboBox.trigger("change");
  145. tripPriorityComboBox.dataSource.fetch().then(function(value) {
  146. var tpDataItems = tripPriorityComboBox.dataSource.data();
  147. if (dataItems[i].TripPriorityId !== "00000000-0000-0000-0000-000000000000") { //Implies no TripPriorityId was present itn the Rate table
  148. tripPriorityComboBox.value(dataItems[i].TripPriorityId);
  149. tripPriorityComboBox.trigger("change");
  150. }else {
  151. tripPriorityComboBox.value(null);
  152. tripPriorityComboBox.trigger("change");
  153. }
  154. });
  155. break;
  156. }
  157. }
  158. }
  159. }
  160.  
  161. function accountChange() {
  162. var rateComboBox = $("#RateId").data("kendoComboBox");
  163. if (rateComboBox) {
  164. rateComboBox.value(null);
  165. rateComboBox.trigger('change');
  166. rateComboBox.dataSource.fetch();
  167. }
  168. var tripPriorityComboBox = $("#Trips_0__TripPriorityId").data("kendoComboBox");
  169. if (tripPriorityComboBox) {
  170. tripPriorityComboBox.dataSource.fetch();
  171. }
  172. }
  173. </script>
  174.  
  175. <td class="l-field">
  176. @(Html.Lss().ComboBoxFor(model => model.RateId)
  177. .DataSource(dataSource => dataSource
  178. .Read(read => read
  179. .Action("_GetListRateId", "Reservation", Request.QueryString.ToRouteValueDictionary()))
  180. .Events(events => events.Change("rateIdDataSourceChange"))) //E2G Mark - Added to help set default values for Rate and TripPriority
  181. .Events(events => events.Change("rateIdChange")) //E2G Mark - Added to help set default values for Rate and TripPriority
  182. .DefaultValue(Model.Rate)
  183. .HtmlAttributes(new { TabIndex = -1 }))
  184. @*.HtmlAttributes(new { TabIndex = 9, style = "color: red;" }).SelectedIndex(2))*@
  185. @Html.Lss().RequiredFieldIndicatorFor(model => model.RateId)
  186. @Html.ValidationMessageFor(model => model.RateId)
  187. </td>
  188. </tr>
  189. <tr>
  190. <td class="l-label">@Html.Lss().LabelFor(model => model.Account_ContactId)</td>
  191. <td class="l-field">
  192.  
  193.  
  194. <div style="display: none;">
  195. <input id="accountSearch" placeholder="Account search" class="k-textbox" type="text"/>
  196. </div>
  197. @(Html.Lss().ComboBoxFor(model => model.Account_ContactId)
  198. .DataSource(dataSource => dataSource
  199. .Read(read => read
  200. .Action("_GetListAccount_ContactId", "Reservation", Request.QueryString.ToRouteValueDictionary())))
  201. .Events(events => events.Change("accountChange")) //E2G Mark - Added to help set default values for Rate and TripPriority
  202. .DefaultValue(Model.Account_Contact).HtmlAttributes(new {TabIndex = -1 }))
  203. @Html.Lss().RequiredFieldIndicatorFor(model => model.Account_ContactId)
  204. @Html.ValidationMessageFor(model => model.Account_ContactId)
  205.  
  206.  
  207. </td>
  208. <td class="l-label">@Html.Lss().LabelFor(model => model.ReservationDate)</td>
  209. <td class="l-field">
  210. @(Html.Lss().DatePickerFor(model => model.ReservationDate).HtmlAttributes(new { TabIndex = -1 }))
  211. @Html.Lss().RequiredFieldIndicatorFor(model => model.ReservationDate)
  212. @Html.ValidationMessageFor(model => model.ReservationDate)
  213. </td>
  214. </tr>
  215. <tr>
  216. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Passenger_ContactId)</td>
  217. <td class="l-field">
  218. <input id="passengerSearch" placeholder="Passenger search" class="k-textbox" type="text"/>
  219. <div style="display: none;">
  220. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Passenger_ContactId)
  221. .DataSource(dataSource => dataSource
  222. .Read(read => read
  223. .Action("_GetListPassenger_ContactId", "Trip", Request.QueryString.ToRouteValueDictionary())))
  224. .DefaultValue(Model.Trips[0].Passenger_Contact).HtmlAttributes(new {TabIndex = -1 }))
  225. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Passenger_ContactId)
  226. @Html.ValidationMessageFor(model => model.Trips[0].Passenger_ContactId)
  227. </div>
  228.  
  229. </td>
  230. <td class="l-label">@Html.Lss().LabelFor(model => model.ReservationStatusId)</td>
  231. <td class="l-field">
  232. @(Html.Lss().ComboBoxFor(model => model.ReservationStatusId)
  233. .DataSource(dataSource => dataSource
  234. .Read(read => read
  235. .Action("_GetListReservationStatusId", "Reservation", Request.QueryString.ToRouteValueDictionary())))
  236. .DefaultValue(Model.ReservationStatus).HtmlAttributes(new { TabIndex = -1 }))
  237. @Html.Lss().RequiredFieldIndicatorFor(model => model.ReservationStatusId)
  238. @Html.ValidationMessageFor(model => model.ReservationStatusId)
  239. </td>
  240. </tr>
  241. <tr>
  242. <td class="l-label">@Html.Lss().LabelFor(model => model.Name)</td>
  243. <td class="l-field">
  244. @(Html.Lss().TextBoxFor(model => model.Name).HtmlAttributes(new { TabIndex = -1 }))
  245. @Html.Lss().RequiredFieldIndicatorFor(model => model.Name)
  246. @Html.ValidationMessageFor(model => model.Name)
  247. </td>
  248. <td class="l-label">@Html.Lss().LabelFor(model => model.ReservationTypeId)</td>
  249. <td class="l-field">
  250. @(Html.Lss().ComboBoxFor(model => model.ReservationTypeId)
  251. .DataSource(dataSource => dataSource
  252. .Read(read => read
  253. .Action("_GetListReservationTypeId", "Reservation", Request.QueryString.ToRouteValueDictionary())))
  254. .DefaultValue(Model.ReservationType).HtmlAttributes(new { TabIndex = -1 }))
  255. @Html.Lss().RequiredFieldIndicatorFor(model => model.ReservationTypeId)
  256. @Html.ValidationMessageFor(model => model.ReservationTypeId)
  257. </td>
  258. </tr>
  259. </table>
  260. </td>
  261. <td>
  262. <table class="l-fields" style=" height: 300px;">
  263. <tr>
  264. <td class="l-label" colspan="4" style="text-align: center;">T &nbsp;&nbsp;&nbsp;&nbsp;R &nbsp;&nbsp;&nbsp;&nbsp;I &nbsp;&nbsp;&nbsp;&nbsp;P &nbsp;&nbsp;&nbsp;&nbsp;</td>
  265. </tr>
  266. <tr>
  267. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].TripNo)</td>
  268. <td class="l-field">@Html.Lss().Span().Name("TripNo").Text("Pending")</td>
  269. </tr>
  270. <tr>
  271. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].DriverId)</td>
  272. <td class="l-field">
  273. @(Html.Lss().ComboBoxFor(model => model.Trips[0].DriverId)
  274. .DataSource(dataSource => dataSource
  275. .Read(read => read
  276. .Action("_GetListDriverId", "Trip", Request.QueryString.ToRouteValueDictionary())))
  277. .DefaultValue(Model.Trips[0].Driver).HtmlAttributes(new { TabIndex = -1 }))
  278. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].DriverId)
  279. @Html.ValidationMessageFor(model => model.Trips[0].DriverId)
  280. </td>
  281. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].VehicleTypeId)</td>
  282. <td class="l-field">
  283. @(Html.Lss().ComboBoxFor(model => model.Trips[0].VehicleTypeId)
  284. .DataSource(dataSource => dataSource
  285. .Read(read => read
  286. .Action("_GetListVehicleTypeId", "Trip", Request.QueryString.ToRouteValueDictionary())))
  287. .DefaultValue(Model.Trips[0].VehicleType).HtmlAttributes(new { TabIndex = -1 }))
  288. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].VehicleTypeId)
  289. @Html.ValidationMessageFor(model => model.Trips[0].VehicleId)
  290. </td>
  291. </tr>
  292. <tr>
  293. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].TripAreaId)</td>
  294. <td class="l-field">
  295. @(Html.Lss().ComboBoxFor(model => model.Trips[0].TripAreaId)
  296. .DataSource(dataSource => dataSource
  297. .Read(read => read
  298. .Action("_GetListTripAreaId", "Trip", Request.QueryString.ToRouteValueDictionary())))
  299. .DefaultValue(Model.Trips[0].TripArea).HtmlAttributes(new { TabIndex = -1 }))
  300. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].TripAreaId)
  301. @Html.ValidationMessageFor(model => model.Trips[0].TripAreaId)
  302. </td>
  303. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].VehicleId)</td>
  304. <td class="l-field">
  305. @(Html.Lss().ComboBoxFor(model => model.Trips[0].VehicleId)
  306. .DataSource(dataSource => dataSource
  307. .Read(read => read
  308. .Action("_GetListVehicleId", "Trip", Request.QueryString.ToRouteValueDictionary())))
  309. .DefaultValue(Model.Trips[0].Vehicle).HtmlAttributes(new { TabIndex = -1 }))
  310. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].VehicleId)
  311. @Html.ValidationMessageFor(model => model.Trips[0].VehicleId)
  312. </td>
  313. </tr>
  314. <tr>
  315. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].TripPriorityId)</td>
  316. <td class="l-field">
  317. @(Html.Lss().ComboBoxFor(model => model.Trips[0].TripPriorityId)
  318. .DataSource(dataSource => dataSource
  319. .Read(read => read
  320. .Action("_GetListTripPriorityId", "Trip", Request.QueryString.ToRouteValueDictionary())))
  321. .DefaultValue(Model.Trips[0].TripPriority).HtmlAttributes(new { TabIndex = -1 }))
  322. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].TripPriorityId)
  323. @Html.ValidationMessageFor(model => model.Trips[0].TripPriorityId)
  324. </td>
  325. <td class="l-label">Mileage</td>
  326. <td class="l-field">
  327. @(Html.Lss().NumericTextBoxFor(model => model.Trips[0].TripMileage)
  328. .Format("#.0")
  329. .HtmlAttributes(new { TabIndex = -1 })
  330. )
  331. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].TripMileage)
  332. @Html.ValidationMessageFor(model => model.Trips[0].TripMileage)
  333. </td>
  334. </tr>
  335. <tr>
  336. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].TripStatusId)</td>
  337. <td class="l-field">
  338. @(Html.Lss().ComboBoxFor(model => model.Trips[0].TripStatusId)
  339. .DataSource(dataSource => dataSource
  340. .Read(read => read
  341. .Action("_GetListTripStatusId", "Trip", Request.QueryString.ToRouteValueDictionary())))
  342. .DefaultValue(Model.Trips[0].TripStatus).HtmlAttributes(new { TabIndex = -1 }))
  343. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].TripStatusId)
  344. @Html.ValidationMessageFor(model => model.Trips[0].TripStatusId)
  345. </td>
  346. <td class="l-label">@Html.Lss().Label("Trip Estimate")</td>
  347. <td class="l-label">
  348. <span class="l-trip-cost"></span>
  349. @(Html.Lss().Button()
  350. .Name("btnGetPriceEstimate")
  351. .OnClick("btnGetPriceEstimate_Click()")
  352. .InputType("button")
  353. .Text("Get Trip Estimate").HtmlAttributes(new { TabIndex = -1 }))
  354. </td>
  355.  
  356.  
  357. </tr>
  358.  
  359. <tr>
  360. <td style="text-align: left;" class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].AdditionalPassengers)</td>
  361. <td class="l-field" colspan="3">
  362. @(Html.Lss().TextAreaFor(model => model.Trips[0].AdditionalPassengers)
  363. .AddCssClass("k-input l-input-fs-wide").HtmlAttributes(new { TabIndex = 8, style = "width:100%;height:2.13em;" }))
  364. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].AdditionalPassengers)
  365. @Html.ValidationMessageFor(model => model.Trips[0].AdditionalPassengers)
  366. </td>
  367. </tr>
  368. <tr>
  369. <td style="text-align: left;" class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Description)</td>
  370. <td class="l-field" colspan="3">
  371. @(Html.Lss().TextAreaFor(model => model.Trips[0].Description)
  372. .AddCssClass("k-input l-input-fs-wide").HtmlAttributes(new { TabIndex = 8, style = "width:100%;height:2.13em;" }))
  373. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Description)
  374. @Html.ValidationMessageFor(model => model.Trips[0].Description)
  375. </td>
  376. </tr>
  377. </table>
  378. </td>
  379. </tr>
  380. <tr>
  381. <td colspan="2">
  382. <table class="l-fields" style="margin: unset; width: 100%;">
  383. <tr>
  384. <td class="l-label" colspan="4" style="text-align: center;">
  385. <h1>Origin</h1>
  386. </td>
  387. <td class="l-label" colspan="4" style="text-align: center;">
  388. <h1>Destination</h1>
  389. </td>
  390. </tr>
  391. <tr>
  392. <td colspan="4" style="margin:10px;">
  393. <input id="jqautocomplete" placeholder="location to search" tabindex="3" class="k-textbox" type="text"/>
  394. <input id="searchTextField" type="text" placeholder="Search Origin Address" class="k-textbox" style="display:none; width:100%;">
  395. </td>
  396.  
  397. <td colspan="4" style="margin:10px;">
  398. <input id="jqautocompleteDestination" placeholder="location to search" tabindex="6" class="k-textbox" type="text"/>
  399. <input id="destinationSearchTextField" type="text" placeholder="Search Destination Address" class="k-textbox" style="display:none; width: 100%;">
  400. </td>
  401.  
  402. </tr>
  403. <tr style="height:90px; margin:16px;">
  404. <td colspan="4" id="pickupDisplay" >
  405. </td>
  406. <td colspan="4" id="dropoffDisplay">
  407. </td>
  408. </tr>
  409. <tr style="" id="">
  410. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].OriginScheduledDate)</td>
  411. <td class="l-field">
  412. @(Html.Lss().DateTimePickerFor(model => model.Trips[0].OriginScheduledDate)
  413. .Interval(15)
  414. .HtmlAttributes(new { TabIndex = 4 }))
  415. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].OriginScheduledDate)
  416. @Html.ValidationMessageFor(model => model.Trips[0].OriginScheduledDate)
  417. </td>
  418.  
  419. <td class="l-label">
  420. <div id="tripCount" style=" position: fixed; margin-left: 10px; font-size: 18px; color: black;"> </div>
  421. <span>@Html.Lss().LabelFor(model => model.Trips[0].Origin_AddressLine3)</span></td>
  422. <td class="l-field OriginStreetValues OriginLandmarkValues PickUpValues">
  423. @(Html.Lss().TextBoxFor(model => model.Trips[0].Origin_AddressLine3).HtmlAttributes(new { TabIndex = -1 }))
  424. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_AddressLine3)
  425. @Html.ValidationMessageFor(model => model.Trips[0].Origin_AddressLine3)
  426. </td>
  427.  
  428. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].DestinationScheduledDate)</td>
  429. <td class="l-field">
  430. @(Html.Lss().DateTimePickerFor(model => model.Trips[0].DestinationScheduledDate)
  431. .Interval(15)
  432. .HtmlAttributes(new { TabIndex = -1 }))
  433. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].DestinationScheduledDate)
  434. @Html.ValidationMessageFor(model => model.Trips[0].DestinationScheduledDate)
  435. </td>
  436.  
  437. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_AddressLine3)</td>
  438. <td class="l-field DestinationStreetValues DestinationLandmarkValues DropOffValues">
  439. @(Html.Lss().TextBoxFor(model => model.Trips[0].Destination_AddressLine3).HtmlAttributes(new { TabIndex = -1 }))
  440. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_AddressLine3)
  441. @Html.ValidationMessageFor(model => model.Trips[0].Destination_AddressLine3)
  442. </td>
  443. </tr>
  444. <tr style="">
  445. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_Landmark)</td>
  446. <td class="l-field TripValues">
  447. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Origin_LandmarkId)
  448. .DataSource(dataSource => dataSource
  449. .Read(read => read
  450. .Action("_GetListOriginLandmarkSegmentId", "Trip", Request.QueryString.ToRouteValueDictionary())))
  451. .Events(events => events
  452. .Change("populateOriginFromLandmarkSegment"))
  453. .DefaultValue(Model.Trips[0].Origin_Landmark).HtmlAttributes(new { TabIndex = -1 }))
  454. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_LandmarkId)
  455. @Html.ValidationMessageFor(model => model.Trips[0].Origin_LandmarkId)
  456. </td>
  457. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].OriginPhone)</td>
  458. <td class="l-field OriginLandmarkValues PickUpValues">
  459. @(Html.Lss().TextBoxFor(model => model.Trips[0].OriginPhone).HtmlAttributes(new { TabIndex = -1, id = "OriginPhone" }))
  460. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].OriginPhone)
  461. @Html.ValidationMessageFor(model => model.Trips[0].OriginPhone)
  462. </td>
  463. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_Landmark)</td>
  464. <td class="l-field TripValues DropOffValues">
  465. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Destination_LandmarkId)
  466. .DataSource(dataSource => dataSource
  467. .Read(read => read
  468. .Action("_GetListDestinationLandmarkSegmentId", "Trip", Request.QueryString.ToRouteValueDictionary())))
  469. .Events(events => events
  470. .Change("populateDestinationFromLandmarkSegment"))
  471. .DefaultValue(Model.Trips[0].Destination_Landmark).HtmlAttributes(new { TabIndex = -1}))
  472. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_LandmarkId)
  473. @Html.ValidationMessageFor(model => model.Trips[0].Destination_LandmarkId)
  474. </td>
  475. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].DestinationPhone)</td>
  476. <td class="l-field OriginLandmarkValues PickUpValues">
  477. @(Html.Lss().TextBoxFor(model => model.Trips[0].DestinationPhone).HtmlAttributes(new { TabIndex = -1, id = "DestinationPhone" }))
  478. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].DestinationPhone)
  479. @Html.ValidationMessageFor(model => model.Trips[0].DestinationPhone)
  480. </td>
  481. </tr>
  482. <tr style="">
  483. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].OriginRouteCode)</td>
  484. <td class="l-field OriginLandmarkValues PickUpValues">
  485. @(Html.Lss().TextBoxFor(model => model.Trips[0].OriginRouteCode).HtmlAttributes(new { TabIndex = -1, id = "OriginRouteCode" }))
  486. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].OriginRouteCode)
  487. @Html.ValidationMessageFor(model => model.Trips[0].OriginRouteCode)
  488. </td>
  489. <td style="display:none;" class="l-field OriginLandmarkValues PickUpValues">
  490. @(Html.Lss().TextBoxFor(model => model.Trips[0].OriginLatitude)
  491. .HtmlAttributes(new { TabIndex = -1, style = "width=50%; border-style: hidden; background-color:transparent" })
  492. .ReadOnly(true))
  493. @(Html.Lss().TextBoxFor(model => model.Trips[0].OriginLongitude)
  494. .HtmlAttributes(new { TabIndex = -1, style = "width=50%; border-style: hidden; background-color:transparent" })
  495. .ReadOnly(true))
  496. </td>
  497. <td></td>
  498. <td></td>
  499. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].DestinationRouteCode)</td>
  500. <td class="l-field DestinationLandmarkValues DropOffValues">
  501. @(Html.Lss().TextBoxFor(model => model.Trips[0].DestinationRouteCode).HtmlAttributes(new { TabIndex = -1, id = "DestinationRouteCode" }))
  502. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].DestinationRouteCode)
  503. @Html.ValidationMessageFor(model => model.Trips[0].DestinationRouteCode)
  504. </td>
  505. <td style="display:none;" class="l-field DestinationLandmarkValues PickUpValues">
  506. @(Html.Lss().TextBoxFor(model => model.Trips[0].DestinationLatitude)
  507. .HtmlAttributes(new { TabIndex = -1, style = "width=50%; border-style: hidden; background-color:transparent" })
  508. .ReadOnly(true))
  509. @(Html.Lss().TextBoxFor(model => model.Trips[0].DestinationLongitude)
  510. .HtmlAttributes(new { TabIndex = -1, style = "width=50%; border-style: hidden; background-color:transparent" })
  511. .ReadOnly(true))
  512. </td>
  513. </tr>
  514. <tr style="display:none;">
  515. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_AddressLine1)</td>
  516. <td class="l-field OriginStreetValues OriginLandmarkValues PickUpValues">
  517. @(Html.Lss().TextBoxFor(model => model.Trips[0].Origin_AddressLine1).HtmlAttributes(new { TabIndex = -1, @class = "street_number" }))
  518. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_AddressLine1)
  519. @Html.ValidationMessageFor(model => model.Trips[0].Origin_AddressLine1)
  520. </td>
  521. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_Segment.CountyId)</td>
  522. <td class="l-field OriginStreetValues OriginLandmarkValues PickUpValues">
  523. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Origin_Segment.CountyId)
  524. .DataSource(dataSource => dataSource
  525. .Read(read => read
  526. .Action("_GetListCountyId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  527. .DefaultValue(Model.Trips[0].Origin_Segment.County).HtmlAttributes(new { TabIndex = -1 }))
  528. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_Segment.CountyId)
  529. @Html.ValidationMessageFor(model => model.Trips[0].Origin_Segment.CountyId)
  530. </td>
  531. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_AddressLine1)</td>
  532. <td class="l-field DestinationStreetValues DestinationLandmarkValues DropOffValues">
  533. @(Html.Lss().TextBoxFor(model => model.Trips[0].Destination_AddressLine1).HtmlAttributes(new { TabIndex = -1 }))
  534. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_AddressLine1)
  535. @Html.ValidationMessageFor(model => model.Trips[0].Destination_AddressLine1)
  536. </td>
  537. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_Segment.CountyId)</td>
  538. <td class="l-field DestinationStreetValues DestinationLandmarkValues DropOffValues">
  539. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Destination_Segment.CountyId)
  540. .DataSource(dataSource => dataSource
  541. .Read(read => read
  542. .Action("_GetListCountyId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  543. .DefaultValue(Model.Trips[0].Destination_Segment.County).HtmlAttributes(new { TabIndex = -1 }))
  544. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_SegmentId)
  545. @Html.ValidationMessageFor(model => model.Trips[0].Destination_SegmentId)
  546. </td>
  547. </tr>
  548. <tr style="display:none;">
  549. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_AddressLine2)</td>
  550. <td class="l-field OriginStreetValues OriginLandmarkValues PickUpValues">
  551. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Origin_AddressLine2)
  552. .DataSource(dataSource => dataSource
  553. .Read(read => read
  554. .Action("_GetListOrigin_SegmentId", "Trip", Request.QueryString.ToRouteValueDictionary())
  555. .Data("getOriginStreetValue")))
  556. .Events(events => events
  557. .Change("populateOriginFromStreetSegment"))
  558. .DefaultValue<StreetSegment>(Model.Trips[0].Origin_Segment.EntityState == Mindscape.LightSpeed.EntityState.New ? null : Model.Trips[0].Origin_Segment)
  559. .HtmlAttributes(new { TabIndex = -1 }))
  560. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_SegmentId)
  561. @Html.ValidationMessageFor(model => model.Trips[0].Origin_SegmentId)
  562. </td>
  563. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_Segment.CityId)</td>
  564. <td class="l-field OriginStreetValues OriginLandmarkValues PickUpValues">
  565. @(Html.Lss().ComboBoxFor(mode => Model.Trips[0].Origin_Segment.CityId)
  566. .DataSource(dataSource => dataSource
  567. .Read(read => read
  568. .Action("_GetListCityId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  569. .DefaultValue(Model.Trips[0].Origin_Segment.City).HtmlAttributes(new { TabIndex = -1, @class = "locality" }))
  570. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_Segment.CityId)
  571. @Html.ValidationMessageFor(model => model.Trips[0].Origin_Segment.CityId)
  572. </td>
  573. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_AddressLine2)</td>
  574. <td class="l-field DestinationStreetValues DestinationLandmarkValues DropOffValues">
  575. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Destination_AddressLine2)
  576. .DataSource(dataSource => dataSource
  577. .Read(read => read
  578. .Action("_GetListDestination_SegmentId", "Trip", Request.QueryString.ToRouteValueDictionary())
  579. .Data("getDestinationStreetValue")))
  580. .Events(events => events
  581. .Change("populateDestinationFromStreetSegment")).HtmlAttributes(new { TabIndex = -1 }))
  582. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_SegmentId)
  583. @Html.ValidationMessageFor(model => model.Trips[0].Destination_SegmentId)
  584. </td>
  585. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_Segment.CityId)</td>
  586. <td class="l-field DestinationStreetValues DestinationLandmarkValues DropOffValues">
  587. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Destination_Segment.CityId)
  588. .DataSource(dataSource => dataSource
  589. .Read(read => read
  590. .Action("_GetListCityId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  591. .DefaultValue(Model.Trips[0].Destination_Segment.City).HtmlAttributes(new { TabIndex = -1 }))
  592. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_SegmentId)
  593. @Html.ValidationMessageFor(model => model.Trips[0].Destination_SegmentId)
  594. </td>
  595. </tr>
  596. <tr style="display:none;">
  597. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_Segment.Country)</td>
  598. <td class="l-field OriginStreetValues OriginLandmarkValues PickUpValues">
  599. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Origin_Segment.CountryId)
  600. .DataSource(dataSource => dataSource
  601. .Read(read => read
  602. .Action("_GetListCountryId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  603. .DefaultValue(Model.Trips[0].Origin_Segment.Country).HtmlAttributes(new { TabIndex = -1 }))
  604. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_Segment.CountryId)
  605. @Html.ValidationMessageFor(model => model.Trips[0].Origin_Segment.CountryId)
  606. </td>
  607. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_Segment.PostalCodeId)</td>
  608. <td class="l-field OriginStreetValues OriginLandmarkValues PickUpValues">
  609. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Origin_Segment.PostalCodeId)
  610. .DataSource(dataSource => dataSource
  611. .Read(read => read
  612. .Action("_GetListPostalCodeId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  613. .DefaultValue(Model.Trips[0].Origin_Segment.PostalCode)
  614. .HtmlAttributes(new { TabIndex = -1, @class = "postal_code" }))
  615. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_Segment.PostalCodeId)
  616. @Html.ValidationMessageFor(model => model.Trips[0].Origin_Segment.PostalCodeId)
  617. </td>
  618.  
  619. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_Segment.CountryId)</td>
  620. <td class="l-field DestinationStreetValues DestinationLandmarkValues DropOffValues">
  621. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Destination_Segment.CountryId)
  622. .DataSource(dataSource => dataSource
  623. .Read(read => read
  624. .Action("_GetListCountryId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  625. .DefaultValue(Model.Trips[0].Destination_Segment.Country).HtmlAttributes(new { TabIndex = -1 }))
  626. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_SegmentId)
  627. @Html.ValidationMessageFor(model => model.Trips[0].Destination_Segment)
  628. </td>
  629. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_Segment.PostalCodeId)</td>
  630. <td class="l-field DestinationStreetValues DestinationLandmarkValues DropOffValues">
  631. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Destination_Segment.PostalCodeId)
  632. .DataSource(dataSource => dataSource
  633. .Read(read => read
  634. .Action("_GetListPostalCodeId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  635. .DefaultValue(Model.Trips[0].Destination_Segment.PostalCode).HtmlAttributes(new { TabIndex = -1 }))
  636. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_SegmentId)
  637. @Html.ValidationMessageFor(model => model.Trips[0].Destination_SegmentId)
  638. </td>
  639. </tr>
  640. <tr style="display:none;">
  641.  
  642. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_Segment.StateId)</td>
  643. <td class="l-field OriginStreetValues OriginLandmarkValues DropOffValues">
  644. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Origin_Segment.StateId)
  645. .DataSource(dataSource => dataSource
  646. .Read(read => read
  647. .Action("_GetListStateId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  648. .DefaultValue(Model.Trips[0].Origin_Segment.State)
  649. .HtmlAttributes(new { TabIndex = -1, @class = "administrative_area_level_1" }))
  650. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_Segment.StateId)
  651. @Html.ValidationMessageFor(model => model.Trips[0].Origin_Segment.StateId)
  652. </td>
  653.  
  654. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_Segment.Primary_ZoneId)</td>
  655. <td class="l-field OriginStreetValues OriginLandmarkValues PickUpValues">
  656. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Origin_Segment.Primary_ZoneId)
  657. .DataSource(dataSource => dataSource
  658. .Read(read => read
  659. .Action("_GetListPrimary_ZoneId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  660. .DefaultValue(Model.Trips[0].Origin_Segment.Primary_Zone)
  661. .HtmlAttributes(new { TabIndex = -1 }))
  662. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_Segment.Primary_ZoneId)
  663. @Html.ValidationMessageFor(model => model.Trips[0].Origin_Segment.Primary_ZoneId)
  664. </td>
  665. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_Segment.State)</td>
  666. <td class="l-field DestinationStreetValues DestinationLandmarkValues DropOffValues">
  667. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Destination_Segment.StateId)
  668. .DataSource(dataSource => dataSource
  669. .Read(read => read
  670. .Action("_GetListStateId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  671. .DefaultValue(Model.Trips[0].Destination_Segment.State)
  672. .HtmlAttributes(new { TabIndex = -1 }))
  673. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_SegmentId)
  674. @Html.ValidationMessageFor(model => model.Trips[0].Destination_Segment)
  675. </td>
  676.  
  677. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_Segment.Primary_ZoneId)</td>
  678. <td class="l-field DestinationStreetValues DestinationLandmarkValues PickUpValues">
  679. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Destination_Segment.Primary_ZoneId)
  680. .DataSource(dataSource => dataSource
  681. .Read(read => read
  682. .Action("_GetListPrimary_ZoneId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  683. .DefaultValue(Model.Trips[0].Destination_Segment.Primary_Zone)
  684. .HtmlAttributes(new { TabIndex = -1 }))
  685. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_Segment.Primary_ZoneId)
  686. @Html.ValidationMessageFor(model => model.Trips[0].Destination_Segment.Primary_ZoneId)
  687. </td>
  688. </tr>
  689. <tr >
  690. <td class="l-label">Comments</td>
  691. <td class="l-field" colspan="3">
  692. @(Html.Lss().TextAreaFor(model => model.Trips[0].OriginComments)
  693. .AddCssClass("k-input l-input-fs-wide").HtmlAttributes(new { TabIndex = 5, style = "width: 100%" }))
  694. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].OriginComments)
  695. @Html.ValidationMessageFor(model => model.Trips[0].OriginComments)
  696. </td>
  697. <td class="l-label">Comments</td>
  698. <td class="l-field DropOffValues" colspan="3">
  699. @(Html.Lss().TextAreaFor(model => model.Trips[0].DestinationComments)
  700. .AddCssClass("k-input l-input-fs-wide").HtmlAttributes(new { TabIndex = 7, style = "width: 100%" }))
  701. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].DestinationComments)
  702. @Html.ValidationMessageFor(model => model.Trips[0].DestinationComments)
  703. </td>
  704. </tr>
  705. </table>
  706. </td>
  707. </tr>
  708. </table>
  709. <script type="text/javascript">
  710.  
  711. //var originSearchAddress = document.getElementById('originSearchTextField');
  712.  
  713. //autocomplete = new google.maps.places.Autocomplete(originSearchAddress, options);
  714. //autocomplete.setBounds(circle.getBounds());
  715.  
  716. //google.maps.event.addListener(autocomplete, 'place_changed', function () {
  717. // fillInAddress();
  718. //});
  719.  
  720. //google.maps.event.addDomListener(originSearchAddress, 'keydown', function (e) {
  721. // if (e.keyCode == 13) {
  722. // e.preventDefault();
  723. // }
  724. //});
  725.  
  726. //var destinationSearchAddress = document.getElementById('destinationSearchTextField');
  727.  
  728. //destinationAutocomplete = new google.maps.places.Autocomplete(destinationSearchAddress, options);
  729. //destinationAutocomplete.setBounds(circle.getBounds());
  730.  
  731. //google.maps.event.addListener(destinationAutocomplete, 'place_changed', function () {
  732. // fillInDestinationAddress();
  733. //});
  734. //google.maps.event.addDomListener(destinationSearchAddress, 'keydown', function (e) {
  735. // if (e.keyCode == 13) {
  736. // e.preventDefault();
  737. // }
  738. //});
  739.  
  740.  
  741. $(document).ready(function () {
  742.  
  743. $("#Trips_0__OriginScheduledDate").on('change', function () {
  744.  
  745. // $("#tripCount").html("20");
  746. if ($("#Trips_0__DestinationScheduledDate").val() == '') {
  747. // $("#Trips_0__DestinationScheduledDate").val($("#Trips_0__OriginScheduledDate").val());
  748.  
  749.  
  750. //$("#datetimepicker").kendoDateTimePicker();
  751.  
  752. var datepicker = $("#Trips_0__DestinationScheduledDate").data("kendoDateTimePicker");
  753. datepicker.value($("#Trips_0__OriginScheduledDate").val());
  754. datepicker.trigger("change");
  755. }
  756. $.get("/Trip/_CountTripsForTime", { scheduledDateTime:$("#Trips_0__OriginScheduledDate").val() }, function (data) {
  757. $("#tripCount").html(data[0].Count );
  758. })
  759. });
  760.  
  761.  
  762. // var SiteCode = '@Session.SiteCode';
  763. // $.getScript("https://webservices.tranware.net/SaaS/customJS/"+SiteCode+".js");
  764.  
  765. });
  766. /*
  767. var profileQuery = function (request, response) {
  768.  
  769. jQuery.get("http://192.168.0.104:3000/API/contactLookup?name=", {
  770. term: request.term
  771. },
  772. function (data) {
  773. console.log(data);
  774. if (data.length > 0) {
  775. for (var i in data) {
  776. data[i].value = data[i].Fullname;
  777. data[i].label = data[i].Fullname;
  778. }
  779. response(data);
  780. } else {
  781. var data = {};
  782. response(data);
  783. }
  784. });
  785. }
  786. */
  787. function btnAddContact_Click() {
  788. var contact = $('#ContactId').val();
  789. var win = $.lss.window.openPopup({
  790. url: contactUrl + '?contact=' + contact
  791. });
  792. win.bind("close", selectContactId);
  793. }
  794.  
  795. function sendContactId() {
  796. var combo = $('#ContactId').data("kendoComboBox");
  797. return {
  798. 'Id': combo.value()
  799. };
  800. }
  801.  
  802. function selectContactId() {
  803. var comboBox = $('#ContactId').data('kendoComboBox');
  804. $.when(comboBox.dataSource.fetch()).then(function () {
  805. comboBox.trigger('change');
  806. });
  807. }
  808.  
  809. function btnGetPriceEstimate_Click() {
  810. var rateId = $('#RateId').val();
  811. var tripId = $('#Trips_0__Id').val();
  812. var originLandmarkId = $('#Trips_0__Origin_LandmarkId').val();
  813. var destinationLandmarkId = $('#Trips_0__Destination_LandmarkId').val();
  814. var originSegmentId = $('#Trips_0__Origin_AddressLine2').val();
  815. var destinationSegmentId = $('#Trips_0__Destination_AddressLine2').val();
  816. var originZoneId = $('#Trips_0__Origin_Segment_Primary_ZoneId').val();
  817. var destinationZoneId = $('#Trips_0__Destination_Segment_Primary_ZoneId').val();
  818. var mileage = $('#Trips_0__TripMileage').val();
  819. if (mileage === '') {
  820. mileage = 0.0;
  821. }
  822. var originLatitude = $('#Trips_0__OriginLatitude').val();
  823. var originLongitude = $('#Trips_0__OriginLongitude').val();
  824. var destinationLatitude = $('#Trips_0__DestinationLatitude').val();
  825. var destinationLongitude = $('#Trips_0__DestinationLongitude').val();
  826. var additionalPassengers = $('#Trips_0__AdditionalPassengers').val();
  827.  
  828.  
  829. $.lss.window.openPopup({ url: tempTripPriceUrl + '?rateId=' + rateId + '&tripId=' + tripId});
  830. var data = {
  831. rateId: rateId, tripId: tripId, originLandmarkId: originLandmarkId, destinationLandmarkId: destinationLandmarkId,
  832. originSegmentId: originSegmentId, destinationSegmentId: destinationSegmentId, originZoneId: originZoneId, destinationZoneId: destinationZoneId,
  833. mileage: mileage, originLatitude: originLatitude, originLongitude: originLongitude, destinationLatitude: destinationLatitude, destinationLongitude: destinationLongitude,
  834. additionalPassengers: additionalPassengers
  835. };
  836. var url = '@Url.Action("Estimate","Trip_PriceTemp")';
  837.  
  838. $.get(url, data)
  839. .done(function (d) {
  840. $('.l-trip-cost').html(kendo.toString(d.Estimate, "c"));
  841. $('#Trips_0__TripMileage').data('kendoNumericTextBox').value(d.Mileage);
  842. })
  843. .fail(function () {
  844. $.lss.notify.error();
  845. });
  846. }
  847. </script>
  848. <script src="https://webservices.tranware.net/SaaS/customJS/reservationtrip.js"></script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement