Advertisement
Guest User

Untitled

a guest
Aug 15th, 2018
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.08 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. var siteID=siteIDinput.substr(siteIDinput.lastIndexOf("=")+2,36);
  28. var originSegmentData = @(Html.Raw(ViewData["OriginSegmentInfo"].ToString()));
  29. var destinationSegmentData = @(Html.Raw(ViewData["DestinationSegmentInfo"].ToString()));
  30.  
  31. </script>
  32. <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
  33. <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;key=AIzaSyBe0-8ZfLKlFrKqj3VrbqqaQhyFlcWRBMQ&amp;libraries=places"></script>
  34.  
  35. <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  36. <table style="margin: 0 auto;">
  37. <tr>
  38. <td>
  39. <table class="l-fields">
  40. <tr>
  41. <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>
  42. </tr>
  43. <tr>
  44. <td class="l-label">@Html.Lss().LabelFor(model => model.ReservationNo)</td>
  45. <td class="l-field">@Html.Lss().Span().Name("ReservationNo").Text("Pending")</td>
  46. </tr>
  47. <tr>
  48. <td class="l-label">
  49. @(Html.Lss().Button()
  50. .Name("btnCallerId")
  51. .OnClick("btnCallerId_Click('AccountId')")
  52. .InputType("button")
  53. .IconClass("l-i-phone2")
  54. )
  55. @Html.Lss().LabelFor(model => model.ContactId)
  56.  
  57. </td>
  58. <td class="l-field">
  59. @(Html.Lss().ComboBoxFor(model => model.ContactId)
  60. .DataSource(dataSource => dataSource
  61. .Read(read => read
  62. .Action("_GetListContactId", "Reservation", Request.QueryString.ToRouteValueDictionary())))
  63. .DefaultValue(Model.Contact).Events(e => e.Change("selectPassenger_Contact")).HtmlAttributes(new { TabIndex = 1 }))
  64. @Html.Lss().RequiredFieldIndicatorFor(model => model.ContactId)
  65. @Html.ValidationMessageFor(model => model.ContactId)
  66. </td>
  67. <td class="l-label" colspan="2">
  68. @(Html.Lss().Button()
  69. .Name("btnAddContact")
  70. .OnClick("btnAddContact_Click('ContactId')")
  71. .InputType("button")
  72. .Text("Add New Contact").HtmlAttributes(new { TabIndex = -1 }))
  73.  
  74. @(Html.Lss().Button()
  75. .Name("btnPreviousTrips")
  76. .Text("Lookup Existing Trips")
  77. .InputType("button")
  78. .OnClick(string.Format(
  79. @"$.lss.window.openPopup(
  80. {{
  81. url : '{0}' + '?Passenger_ContactId=' + $('#ContactId').val(),
  82. close: lookupClose
  83. }});",
  84. Url.Action("LookupPreviousTrips", "Grid", new
  85. {
  86. virtualAction = "LookupPreviousTrips"
  87. })
  88. )).HtmlAttributes(new { TabIndex = 2 }))
  89. </td>
  90. </tr>
  91. <tr>
  92. <td class="l-label">Contact Phone #</td>
  93. <td class="l-field">
  94. @(Html.Lss().TextBox().Name("PhoneNo").HtmlAttributes(new { TabIndex = 3 }))
  95. @Html.Lss().RequiredFieldIndicatorFor(model => model.Contact.Phone)
  96. @Html.ValidationMessageFor(model => model.Contact.Phone)
  97. </td>
  98. <td class="l-label">@Html.Lss().LabelFor(model => model.RateId)</td>
  99.  
  100. <script>
  101. //E2G Mark - The functions in this script tag were added to facilitate the automatic setting of Rate defaults and any associated Trip Priority
  102. function rateIdDataSourceChange() {
  103. updateRateIdDefaults();
  104. }
  105.  
  106. function rateIdChange(e) {
  107. var rateComboBox = $("#RateId").data("kendoComboBox");
  108. var tripPriorityComboBox = $("#Trips_0__TripPriorityId").data("kendoComboBox");
  109. tripPriorityComboBox.value(null);
  110. tripPriorityComboBox.trigger("change");
  111. tripPriorityComboBox.dataSource.fetch().then(function(value) {
  112. if (rateComboBox.dataItem() && rateComboBox.dataItem().TripPriorityId !== "00000000-0000-0000-0000-000000000000") { //Implies no TripPriorityId was present itn the Rate table
  113. tripPriorityComboBox.value(rateComboBox.dataItem().TripPriorityId);
  114. tripPriorityComboBox.trigger("change");
  115. } else {
  116. tripPriorityComboBox.value(null);
  117. tripPriorityComboBox.trigger("change");
  118. }
  119. });
  120. }
  121.  
  122. function updateRateIdDefaults() {
  123. var rateComboBox = $("#RateId").data("kendoComboBox");
  124. var dataItems = rateComboBox.dataSource.data();
  125. if (rateComboBox.text() == "") {
  126. for (i = 0; i<dataItems.length; i++) {
  127. if (dataItems[i].IsDefault) {
  128. rateComboBox.value(dataItems[i].Value);
  129. var tripPriorityComboBox = $("#Trips_0__TripPriorityId").data("kendoComboBox");
  130. tripPriorityComboBox.value(null);
  131. tripPriorityComboBox.trigger("change");
  132. tripPriorityComboBox.dataSource.fetch().then(function(value) {
  133. var tpDataItems = tripPriorityComboBox.dataSource.data();
  134. if (dataItems[i].TripPriorityId !== "00000000-0000-0000-0000-000000000000") { //Implies no TripPriorityId was present itn the Rate table
  135. tripPriorityComboBox.value(dataItems[i].TripPriorityId);
  136. tripPriorityComboBox.trigger("change");
  137. }else {
  138. tripPriorityComboBox.value(null);
  139. tripPriorityComboBox.trigger("change");
  140. }
  141. });
  142. break;
  143. }
  144. }
  145. }
  146. }
  147.  
  148. function accountChange() {
  149. var rateComboBox = $("#RateId").data("kendoComboBox");
  150. if (rateComboBox) {
  151. rateComboBox.value(null);
  152. rateComboBox.trigger('change');
  153. rateComboBox.dataSource.fetch();
  154. }
  155. var tripPriorityComboBox = $("#Trips_0__TripPriorityId").data("kendoComboBox");
  156. if (tripPriorityComboBox) {
  157. tripPriorityComboBox.dataSource.fetch();
  158. }
  159. }
  160. </script>
  161.  
  162. <td class="l-field">
  163. @(Html.Lss().ComboBoxFor(model => model.RateId)
  164. .DataSource(dataSource => dataSource
  165. .Read(read => read
  166. .Action("_GetListRateId", "Reservation", Request.QueryString.ToRouteValueDictionary()))
  167. .Events(events => events.Change("rateIdDataSourceChange"))) //E2G Mark - Added to help set default values for Rate and TripPriority
  168. .Events(events => events.Change("rateIdChange")) //E2G Mark - Added to help set default values for Rate and TripPriority
  169. .DefaultValue(Model.Rate)
  170. .HtmlAttributes(new { TabIndex = 9 }))
  171. @*.HtmlAttributes(new { TabIndex = 9, style = "color: red;" }).SelectedIndex(2))*@
  172. @Html.Lss().RequiredFieldIndicatorFor(model => model.RateId)
  173. @Html.ValidationMessageFor(model => model.RateId)
  174. </td>
  175. </tr>
  176. <tr>
  177. <td class="l-label">@Html.Lss().LabelFor(model => model.Account_ContactId)</td>
  178. <td class="l-field">
  179. @(Html.Lss().ComboBoxFor(model => model.Account_ContactId)
  180. .DataSource(dataSource => dataSource
  181. .Read(read => read
  182. .Action("_GetListAccount_ContactId", "Reservation", Request.QueryString.ToRouteValueDictionary())))
  183. .Events(events => events.Change("accountChange")) //E2G Mark - Added to help set default values for Rate and TripPriority
  184. .DefaultValue(Model.Account_Contact).HtmlAttributes(new { TabIndex = 4 }))
  185. @*.HtmlAttributes(new { TabIndex = 4, style = "color: red;" }).SelectedIndex(2))*@
  186. @Html.Lss().RequiredFieldIndicatorFor(model => model.Account_ContactId)
  187. @Html.ValidationMessageFor(model => model.Account_ContactId)
  188. </td>
  189. <td class="l-label">@Html.Lss().LabelFor(model => model.ReservationDate)</td>
  190. <td class="l-field">
  191. @(Html.Lss().DatePickerFor(model => model.ReservationDate).HtmlAttributes(new { TabIndex = -1 }))
  192. @Html.Lss().RequiredFieldIndicatorFor(model => model.ReservationDate)
  193. @Html.ValidationMessageFor(model => model.ReservationDate)
  194. </td>
  195. </tr>
  196. <tr>
  197. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Passenger_ContactId)</td>
  198. <td class="l-field">
  199. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Passenger_ContactId)
  200. .DataSource(dataSource => dataSource
  201. .Read(read => read
  202. .Action("_GetListPassenger_ContactId", "Trip", Request.QueryString.ToRouteValueDictionary())))
  203. .DefaultValue(Model.Trips[0].Passenger_Contact).HtmlAttributes(new { TabIndex = -1 }))
  204. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Passenger_ContactId)
  205. @Html.ValidationMessageFor(model => model.Trips[0].Passenger_ContactId)
  206. </td>
  207. <td class="l-label">@Html.Lss().LabelFor(model => model.ReservationStatusId)</td>
  208. <td class="l-field">
  209. @(Html.Lss().ComboBoxFor(model => model.ReservationStatusId)
  210. .DataSource(dataSource => dataSource
  211. .Read(read => read
  212. .Action("_GetListReservationStatusId", "Reservation", Request.QueryString.ToRouteValueDictionary())))
  213. .DefaultValue(Model.ReservationStatus).HtmlAttributes(new { TabIndex = -1 }))
  214. @Html.Lss().RequiredFieldIndicatorFor(model => model.ReservationStatusId)
  215. @Html.ValidationMessageFor(model => model.ReservationStatusId)
  216. </td>
  217. </tr>
  218. <tr>
  219. <td class="l-label">@Html.Lss().LabelFor(model => model.Name)</td>
  220. <td class="l-field">
  221. @(Html.Lss().TextBoxFor(model => model.Name).HtmlAttributes(new { TabIndex = -1 }))
  222. @Html.Lss().RequiredFieldIndicatorFor(model => model.Name)
  223. @Html.ValidationMessageFor(model => model.Name)
  224. </td>
  225. <td class="l-label">@Html.Lss().LabelFor(model => model.ReservationTypeId)</td>
  226. <td class="l-field">
  227. @(Html.Lss().ComboBoxFor(model => model.ReservationTypeId)
  228. .DataSource(dataSource => dataSource
  229. .Read(read => read
  230. .Action("_GetListReservationTypeId", "Reservation", Request.QueryString.ToRouteValueDictionary())))
  231. .DefaultValue(Model.ReservationType).HtmlAttributes(new { TabIndex = -1 }))
  232. @Html.Lss().RequiredFieldIndicatorFor(model => model.ReservationTypeId)
  233. @Html.ValidationMessageFor(model => model.ReservationTypeId)
  234. </td>
  235. </tr>
  236. </table>
  237. </td>
  238. <td>
  239. <table class="l-fields">
  240. <tr>
  241. <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>
  242. </tr>
  243. <tr>
  244. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].TripNo)</td>
  245. <td class="l-field">@Html.Lss().Span().Name("TripNo").Text("Pending")</td>
  246. </tr>
  247. <tr>
  248. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].DriverId)</td>
  249. <td class="l-field">
  250. @(Html.Lss().ComboBoxFor(model => model.Trips[0].DriverId)
  251. .DataSource(dataSource => dataSource
  252. .Read(read => read
  253. .Action("_GetListDriverId", "Trip", Request.QueryString.ToRouteValueDictionary())))
  254. .DefaultValue(Model.Trips[0].Driver).HtmlAttributes(new { TabIndex = -1 }))
  255. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].DriverId)
  256. @Html.ValidationMessageFor(model => model.Trips[0].DriverId)
  257. </td>
  258. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].VehicleTypeId)</td>
  259. <td class="l-field">
  260. @(Html.Lss().ComboBoxFor(model => model.Trips[0].VehicleTypeId)
  261. .DataSource(dataSource => dataSource
  262. .Read(read => read
  263. .Action("_GetListVehicleTypeId", "Trip", Request.QueryString.ToRouteValueDictionary())))
  264. .DefaultValue(Model.Trips[0].VehicleType).HtmlAttributes(new { TabIndex = -1 }))
  265. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].VehicleTypeId)
  266. @Html.ValidationMessageFor(model => model.Trips[0].VehicleId)
  267. </td>
  268. </tr>
  269. <tr>
  270. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].TripAreaId)</td>
  271. <td class="l-field">
  272. @(Html.Lss().ComboBoxFor(model => model.Trips[0].TripAreaId)
  273. .DataSource(dataSource => dataSource
  274. .Read(read => read
  275. .Action("_GetListTripAreaId", "Trip", Request.QueryString.ToRouteValueDictionary())))
  276. .DefaultValue(Model.Trips[0].TripArea).HtmlAttributes(new { TabIndex = -1 }))
  277. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].TripAreaId)
  278. @Html.ValidationMessageFor(model => model.Trips[0].TripAreaId)
  279. </td>
  280. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].VehicleId)</td>
  281. <td class="l-field">
  282. @(Html.Lss().ComboBoxFor(model => model.Trips[0].VehicleId)
  283. .DataSource(dataSource => dataSource
  284. .Read(read => read
  285. .Action("_GetListVehicleId", "Trip", Request.QueryString.ToRouteValueDictionary())))
  286. .DefaultValue(Model.Trips[0].Vehicle).HtmlAttributes(new { TabIndex = -1 }))
  287. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].VehicleId)
  288. @Html.ValidationMessageFor(model => model.Trips[0].VehicleId)
  289. </td>
  290. </tr>
  291. <tr>
  292. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].TripPriorityId)</td>
  293. <td class="l-field">
  294. @(Html.Lss().ComboBoxFor(model => model.Trips[0].TripPriorityId)
  295. .DataSource(dataSource => dataSource
  296. .Read(read => read
  297. .Action("_GetListTripPriorityId", "Trip", Request.QueryString.ToRouteValueDictionary())))
  298. .DefaultValue(Model.Trips[0].TripPriority).HtmlAttributes(new { TabIndex = -1 }))
  299. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].TripPriorityId)
  300. @Html.ValidationMessageFor(model => model.Trips[0].TripPriorityId)
  301. </td>
  302. <td class="l-label">Mileage</td>
  303. <td class="l-field">
  304. @(Html.Lss().NumericTextBoxFor(model => model.Trips[0].TripMileage)
  305. .Format("#.0")
  306. .HtmlAttributes(new { TabIndex = -1 })
  307. )
  308. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].TripMileage)
  309. @Html.ValidationMessageFor(model => model.Trips[0].TripMileage)
  310. </td>
  311. </tr>
  312. <tr>
  313. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].TripStatusId)</td>
  314. <td class="l-field">
  315. @(Html.Lss().ComboBoxFor(model => model.Trips[0].TripStatusId)
  316. .DataSource(dataSource => dataSource
  317. .Read(read => read
  318. .Action("_GetListTripStatusId", "Trip", Request.QueryString.ToRouteValueDictionary())))
  319. .DefaultValue(Model.Trips[0].TripStatus).HtmlAttributes(new { TabIndex = -1 }))
  320. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].TripStatusId)
  321. @Html.ValidationMessageFor(model => model.Trips[0].TripStatusId)
  322. </td>
  323. <td class="l-label">@Html.Lss().Label("Trip Estimate")</td>
  324. <td class="l-label">
  325. <span class="l-trip-cost"></span>
  326. @(Html.Lss().Button()
  327. .Name("btnGetPriceEstimate")
  328. .OnClick("btnGetPriceEstimate_Click()")
  329. .InputType("button")
  330. .Text("Get Trip Estimate").HtmlAttributes(new { TabIndex = 10 }))
  331. </td>
  332.  
  333.  
  334. </tr>
  335.  
  336. <tr>
  337. <td style="text-align: left;" class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].AdditionalPassengers)</td>
  338. <td class="l-field" colspan="3">
  339. @(Html.Lss().TextAreaFor(model => model.Trips[0].AdditionalPassengers)
  340. .AddCssClass("k-input l-input-fs-wide").HtmlAttributes(new { TabIndex = -1, style = "width:100%;height:2.13em;" }))
  341. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].AdditionalPassengers)
  342. @Html.ValidationMessageFor(model => model.Trips[0].AdditionalPassengers)
  343. </td>
  344. </tr>
  345. </table>
  346. </td>
  347. </tr>
  348. <tr>
  349. <td colspan="2">
  350. <table class="l-fields" style="margin: unset; width: 100%;">
  351. <tr>
  352. <td class="l-label" colspan="4" style="text-align: center;">
  353. <h1>Origin</h1>
  354. </td>
  355. <td class="l-label" colspan="4" style="text-align: center;">
  356. <h1>Destination</h1>
  357. </td>
  358. </tr>
  359. <tr>
  360. <td colspan="4" style="margin:10px;">
  361. <input id="jqautocomplete" placeholder="location to search" class="k-textbox" type="text"/>
  362. <input id="searchTextField" type="text" placeholder="Search Origin Address" class="k-textbox" tabindex="5" style="display:none; width:100%;">
  363. </td>
  364.  
  365. <td colspan="4" style="margin:10px;">
  366. <input id="jqautocompleteDestination" placeholder="location to search" class="k-textbox" type="text"/>
  367. <input id="destinationSearchTextField" type="text" placeholder="Search Destination Address" class="k-textbox" tabindex="7" style="display:none; width: 100%;">
  368. </td>
  369.  
  370. </tr>
  371.  
  372. <tr style="height:90px; margin:16px;">
  373. <td colspan="4" id="pickupDisplay">
  374. </td>
  375. <td colspan="4" id="dropoffDisplay">
  376. </td>
  377. </tr>
  378. <tr style="" id="">
  379. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].OriginScheduledDate)</td>
  380. <td class="l-field">
  381. @(Html.Lss().DateTimePickerFor(model => model.Trips[0].OriginScheduledDate)
  382. .HtmlAttributes(new { TabIndex = -1 }))
  383. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].OriginScheduledDate)
  384. @Html.ValidationMessageFor(model => model.Trips[0].OriginScheduledDate)
  385. </td>
  386.  
  387. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_AddressLine3)</td>
  388. <td class="l-field OriginStreetValues OriginLandmarkValues PickUpValues">
  389. @(Html.Lss().TextBoxFor(model => model.Trips[0].Origin_AddressLine3).HtmlAttributes(new { TabIndex = -1 }))
  390. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_AddressLine3)
  391. @Html.ValidationMessageFor(model => model.Trips[0].Origin_AddressLine3)
  392. </td>
  393.  
  394. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].DestinationScheduledDate)</td>
  395. <td class="l-field">
  396. @(Html.Lss().DateTimePickerFor(model => model.Trips[0].DestinationScheduledDate)
  397. .HtmlAttributes(new { TabIndex = -1 }))
  398. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].DestinationScheduledDate)
  399. @Html.ValidationMessageFor(model => model.Trips[0].DestinationScheduledDate)
  400. </td>
  401.  
  402. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_AddressLine3)</td>
  403. <td class="l-field DestinationStreetValues DestinationLandmarkValues DropOffValues">
  404. @(Html.Lss().TextBoxFor(model => model.Trips[0].Destination_AddressLine3).HtmlAttributes(new { TabIndex = -1 }))
  405. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_AddressLine3)
  406. @Html.ValidationMessageFor(model => model.Trips[0].Destination_AddressLine3)
  407. </td>
  408. </tr>
  409.  
  410. <tr style="display:none;">
  411. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_Landmark)</td>
  412. <td class="l-field TripValues">
  413. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Origin_LandmarkId)
  414. .DataSource(dataSource => dataSource
  415. .Read(read => read
  416. .Action("_GetListOriginLandmarkSegmentId", "Trip", Request.QueryString.ToRouteValueDictionary())))
  417. .Events(events => events
  418. .Change("populateOriginFromLandmarkSegment"))
  419. .DefaultValue(Model.Trips[0].Origin_Landmark).HtmlAttributes(new { TabIndex = 6 }))
  420. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_LandmarkId)
  421. @Html.ValidationMessageFor(model => model.Trips[0].Origin_LandmarkId)
  422. </td>
  423. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_Segment.StateId)</td>
  424. <td class="l-field OriginStreetValues OriginLandmarkValues DropOffValues">
  425. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Origin_Segment.StateId)
  426. .DataSource(dataSource => dataSource
  427. .Read(read => read
  428. .Action("_GetListStateId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  429. .DefaultValue(Model.Trips[0].Origin_Segment.State)
  430. .HtmlAttributes(new { TabIndex = -1, @class = "administrative_area_level_1" }))
  431. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_Segment.StateId)
  432. @Html.ValidationMessageFor(model => model.Trips[0].Origin_Segment.StateId)
  433. </td>
  434. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_Landmark)</td>
  435. <td class="l-field TripValues DropOffValues">
  436. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Destination_LandmarkId)
  437. .DataSource(dataSource => dataSource
  438. .Read(read => read
  439. .Action("_GetListDestinationLandmarkSegmentId", "Trip", Request.QueryString.ToRouteValueDictionary())))
  440. .Events(events => events
  441. .Change("populateDestinationFromLandmarkSegment"))
  442. .DefaultValue(Model.Trips[0].Destination_Landmark).HtmlAttributes(new { TabIndex = 8 }))
  443. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_LandmarkId)
  444. @Html.ValidationMessageFor(model => model.Trips[0].Destination_LandmarkId)
  445. </td>
  446. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_Segment.State)</td>
  447. <td class="l-field DestinationStreetValues DestinationLandmarkValues DropOffValues">
  448. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Destination_Segment.StateId)
  449. .DataSource(dataSource => dataSource
  450. .Read(read => read
  451. .Action("_GetListStateId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  452. .DefaultValue(Model.Trips[0].Destination_Segment.State)
  453. .HtmlAttributes(new { TabIndex = -1 }))
  454. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_SegmentId)
  455. @Html.ValidationMessageFor(model => model.Trips[0].Destination_Segment)
  456. </td>
  457. </tr>
  458. <tr style="display:none;">
  459. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_AddressLine1)</td>
  460. <td class="l-field OriginStreetValues OriginLandmarkValues PickUpValues">
  461. @(Html.Lss().TextBoxFor(model => model.Trips[0].Origin_AddressLine1).HtmlAttributes(new { TabIndex = -1, @class = "street_number" }))
  462. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_AddressLine1)
  463. @Html.ValidationMessageFor(model => model.Trips[0].Origin_AddressLine1)
  464. </td>
  465. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_Segment.CountyId)</td>
  466. <td class="l-field OriginStreetValues OriginLandmarkValues PickUpValues">
  467. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Origin_Segment.CountyId)
  468. .DataSource(dataSource => dataSource
  469. .Read(read => read
  470. .Action("_GetListCountyId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  471. .DefaultValue(Model.Trips[0].Origin_Segment.County).HtmlAttributes(new { TabIndex = -1 }))
  472. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_Segment.CountyId)
  473. @Html.ValidationMessageFor(model => model.Trips[0].Origin_Segment.CountyId)
  474. </td>
  475. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_AddressLine1)</td>
  476. <td class="l-field DestinationStreetValues DestinationLandmarkValues DropOffValues">
  477. @(Html.Lss().TextBoxFor(model => model.Trips[0].Destination_AddressLine1).HtmlAttributes(new { TabIndex = -1 }))
  478. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_AddressLine1)
  479. @Html.ValidationMessageFor(model => model.Trips[0].Destination_AddressLine1)
  480. </td>
  481. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_Segment.CountyId)</td>
  482. <td class="l-field DestinationStreetValues DestinationLandmarkValues DropOffValues">
  483. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Destination_Segment.CountyId)
  484. .DataSource(dataSource => dataSource
  485. .Read(read => read
  486. .Action("_GetListCountyId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  487. .DefaultValue(Model.Trips[0].Destination_Segment.County).HtmlAttributes(new { TabIndex = -1 }))
  488. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_SegmentId)
  489. @Html.ValidationMessageFor(model => model.Trips[0].Destination_SegmentId)
  490. </td>
  491. </tr>
  492. <tr style="display:none;">
  493. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_AddressLine2)</td>
  494. <td class="l-field OriginStreetValues OriginLandmarkValues PickUpValues">
  495. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Origin_AddressLine2)
  496. .DataSource(dataSource => dataSource
  497. .Read(read => read
  498. .Action("_GetListOrigin_SegmentId", "Trip", Request.QueryString.ToRouteValueDictionary())
  499. .Data("getOriginStreetValue")))
  500. .Events(events => events
  501. .Change("populateOriginFromStreetSegment"))
  502. .DefaultValue<StreetSegment>(Model.Trips[0].Origin_Segment.EntityState == Mindscape.LightSpeed.EntityState.New ? null : Model.Trips[0].Origin_Segment)
  503. .HtmlAttributes(new { TabIndex = -1 }))
  504. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_SegmentId)
  505. @Html.ValidationMessageFor(model => model.Trips[0].Origin_SegmentId)
  506. </td>
  507. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_Segment.CityId)</td>
  508. <td class="l-field OriginStreetValues OriginLandmarkValues PickUpValues">
  509. @(Html.Lss().ComboBoxFor(mode => Model.Trips[0].Origin_Segment.CityId)
  510. .DataSource(dataSource => dataSource
  511. .Read(read => read
  512. .Action("_GetListCityId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  513. .DefaultValue(Model.Trips[0].Origin_Segment.City).HtmlAttributes(new { TabIndex = -1, @class = "locality" }))
  514. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_Segment.CityId)
  515. @Html.ValidationMessageFor(model => model.Trips[0].Origin_Segment.CityId)
  516. </td>
  517. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_AddressLine2)</td>
  518. <td class="l-field DestinationStreetValues DestinationLandmarkValues DropOffValues">
  519. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Destination_AddressLine2)
  520. .DataSource(dataSource => dataSource
  521. .Read(read => read
  522. .Action("_GetListDestination_SegmentId", "Trip", Request.QueryString.ToRouteValueDictionary())
  523. .Data("getDestinationStreetValue")))
  524. .Events(events => events
  525. .Change("populateDestinationFromStreetSegment")).HtmlAttributes(new { TabIndex = -1 }))
  526. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_SegmentId)
  527. @Html.ValidationMessageFor(model => model.Trips[0].Destination_SegmentId)
  528. </td>
  529. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_Segment.CityId)</td>
  530. <td class="l-field DestinationStreetValues DestinationLandmarkValues DropOffValues">
  531. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Destination_Segment.CityId)
  532. .DataSource(dataSource => dataSource
  533. .Read(read => read
  534. .Action("_GetListCityId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  535. .DefaultValue(Model.Trips[0].Destination_Segment.City).HtmlAttributes(new { TabIndex = -1 }))
  536. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_SegmentId)
  537. @Html.ValidationMessageFor(model => model.Trips[0].Destination_SegmentId)
  538. </td>
  539. </tr>
  540. <tr style="display:none;">
  541. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_Segment.Country)</td>
  542. <td class="l-field OriginStreetValues OriginLandmarkValues PickUpValues">
  543. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Origin_Segment.CountryId)
  544. .DataSource(dataSource => dataSource
  545. .Read(read => read
  546. .Action("_GetListCountryId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  547. .DefaultValue(Model.Trips[0].Origin_Segment.Country).HtmlAttributes(new { TabIndex = -1 }))
  548. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_Segment.CountryId)
  549. @Html.ValidationMessageFor(model => model.Trips[0].Origin_Segment.CountryId)
  550. </td>
  551. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_Segment.PostalCodeId)</td>
  552. <td class="l-field OriginStreetValues OriginLandmarkValues PickUpValues">
  553. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Origin_Segment.PostalCodeId)
  554. .DataSource(dataSource => dataSource
  555. .Read(read => read
  556. .Action("_GetListPostalCodeId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  557. .DefaultValue(Model.Trips[0].Origin_Segment.PostalCode)
  558. .HtmlAttributes(new { TabIndex = -1, @class = "postal_code" }))
  559. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_Segment.PostalCodeId)
  560. @Html.ValidationMessageFor(model => model.Trips[0].Origin_Segment.PostalCodeId)
  561. </td>
  562.  
  563. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_Segment.CountryId)</td>
  564. <td class="l-field DestinationStreetValues DestinationLandmarkValues DropOffValues">
  565. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Destination_Segment.CountryId)
  566. .DataSource(dataSource => dataSource
  567. .Read(read => read
  568. .Action("_GetListCountryId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  569. .DefaultValue(Model.Trips[0].Destination_Segment.Country).HtmlAttributes(new { TabIndex = -1 }))
  570. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_SegmentId)
  571. @Html.ValidationMessageFor(model => model.Trips[0].Destination_Segment)
  572. </td>
  573. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_Segment.PostalCodeId)</td>
  574. <td class="l-field DestinationStreetValues DestinationLandmarkValues DropOffValues">
  575. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Destination_Segment.PostalCodeId)
  576. .DataSource(dataSource => dataSource
  577. .Read(read => read
  578. .Action("_GetListPostalCodeId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  579. .DefaultValue(Model.Trips[0].Destination_Segment.PostalCode).HtmlAttributes(new { TabIndex = -1 }))
  580. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_SegmentId)
  581. @Html.ValidationMessageFor(model => model.Trips[0].Destination_SegmentId)
  582. </td>
  583. </tr>
  584.  
  585. <tr style="display:none;">
  586. <td></td>
  587. <td class="l-field OriginStreetValues OriginLandmarkValues PickUpValues">
  588. @(Html.Lss().TextBoxFor(model => model.Trips[0].OriginLatitude)
  589. .HtmlAttributes(new { TabIndex = -1 ,style = "width: 50%; border-style: hidden; background-color:transparent"})
  590. .ReadOnly(true))
  591. @(Html.Lss().TextBoxFor(model => model.Trips[0].OriginLongitude)
  592. .HtmlAttributes(new { TabIndex = -1 ,style = "width: 50%; border-style: hidden; background-color:transparent" })
  593. .ReadOnly(true))
  594. </td>
  595.  
  596. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Origin_Segment.Primary_ZoneId)</td>
  597. <td class="l-field OriginStreetValues OriginLandmarkValues PickUpValues">
  598. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Origin_Segment.Primary_ZoneId)
  599. .DataSource(dataSource => dataSource
  600. .Read(read => read
  601. .Action("_GetListPrimary_ZoneId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  602. .DefaultValue(Model.Trips[0].Origin_Segment.Primary_Zone)
  603. .HtmlAttributes(new { TabIndex = -1 }))
  604. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Origin_Segment.Primary_ZoneId)
  605. @Html.ValidationMessageFor(model => model.Trips[0].Origin_Segment.Primary_ZoneId)
  606. </td>
  607. <td></td>
  608. <td class="l-field DestinationStreetValues DestinationLandmarkValues PickUpValues">
  609. @(Html.Lss().TextBoxFor(model => model.Trips[0].DestinationLatitude)
  610. .HtmlAttributes(new { TabIndex = -1 ,style = "width: 50%; border-style: hidden; background-color:transparent" })
  611. .ReadOnly(true))
  612. @(Html.Lss().TextBoxFor(model => model.Trips[0].DestinationLongitude)
  613. .HtmlAttributes(new { TabIndex = -1 ,style = "width: 50%; border-style: hidden; background-color:transparent" })
  614. .ReadOnly(true))
  615. </td>
  616.  
  617. <td class="l-label">@Html.Lss().LabelFor(model => model.Trips[0].Destination_Segment.Primary_ZoneId)</td>
  618. <td class="l-field DestinationStreetValues DestinationLandmarkValues PickUpValues">
  619. @(Html.Lss().ComboBoxFor(model => model.Trips[0].Destination_Segment.Primary_ZoneId)
  620. .DataSource(dataSource => dataSource
  621. .Read(read => read
  622. .Action("_GetListPrimary_ZoneId", "StreetSegment", Request.QueryString.ToRouteValueDictionary())))
  623. .DefaultValue(Model.Trips[0].Destination_Segment.Primary_Zone)
  624. .HtmlAttributes(new { TabIndex = -1 }))
  625. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].Destination_Segment.Primary_ZoneId)
  626. @Html.ValidationMessageFor(model => model.Trips[0].Destination_Segment.Primary_ZoneId)
  627. </td>
  628. </tr>
  629. <tr >
  630. <td class="l-label">Comments</td>
  631. <td class="l-field" colspan="3">
  632. @(Html.Lss().TextAreaFor(model => model.Trips[0].OriginComments)
  633. .AddCssClass("k-input l-input-fs-wide").HtmlAttributes(new { TabIndex = -1, style = "width: 100%" }))
  634. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].OriginComments)
  635. @Html.ValidationMessageFor(model => model.Trips[0].OriginComments)
  636. </td>
  637. <td class="l-label">Comments</td>
  638. <td class="l-field DropOffValues" colspan="3">
  639. @(Html.Lss().TextAreaFor(model => model.Trips[0].DestinationComments)
  640. .AddCssClass("k-input l-input-fs-wide").HtmlAttributes(new { TabIndex = -1, style = "width: 100%" }))
  641. @Html.Lss().RequiredFieldIndicatorFor(model => model.Trips[0].DestinationComments)
  642. @Html.ValidationMessageFor(model => model.Trips[0].DestinationComments)
  643. </td>
  644. </tr>
  645. </table>
  646. </td>
  647. </tr>
  648. </table>
  649. <script type="text/javascript">
  650. $(document).ready(function () {
  651.  
  652. $.getScript("https://webservices.tranware.net/SaaS/customJS/MCCS.js");
  653.  
  654. $('head').append( $('<link rel="stylesheet" type="text/css" />').attr('href', "https://webservices.tranware.net/SaaS/customJS/standard.css") );
  655. });
  656.  
  657. function btnGetPriceEstimate_Click() {
  658. var rateId = $('#RateId').val();
  659. var tripId = $('#Trips_0__Id').val();
  660. var originLandmarkId = $('#Trips_0__Origin_LandmarkId').val();
  661. var destinationLandmarkId = $('#Trips_0__Destination_LandmarkId').val();
  662. var originSegmentId = $('#Trips_0__Origin_AddressLine2').val();
  663. var destinationSegmentId = $('#Trips_0__Destination_AddressLine2').val();
  664. var originZoneId = $('#Trips_0__Origin_Segment_Primary_ZoneId').val();
  665. var destinationZoneId = $('#Trips_0__Destination_Segment_Primary_ZoneId').val();
  666. var mileage = $('#Trips_0__TripMileage').val();
  667. if (mileage === '') {
  668. mileage = 0.0;
  669. }
  670. var originLatitude = $('#Trips_0__OriginLatitude').val();
  671. var originLongitude = $('#Trips_0__OriginLongitude').val();
  672. var destinationLatitude = $('#Trips_0__DestinationLatitude').val();
  673. var destinationLongitude = $('#Trips_0__DestinationLongitude').val();
  674. var additionalPassengers = $('#Trips_0__AdditionalPassengers').val();
  675.  
  676.  
  677. //$.lss.window.openPopup({ url: tempTripPriceUrl + '?rateId=' + rateId + '&tripId=' + tripId});
  678. var data = {
  679. rateId: rateId, tripId: tripId, originLandmarkId: originLandmarkId, destinationLandmarkId: destinationLandmarkId,
  680. originSegmentId: originSegmentId, destinationSegmentId: destinationSegmentId, originZoneId: originZoneId, destinationZoneId: destinationZoneId,
  681. mileage: mileage, originLatitude: originLatitude, originLongitude: originLongitude, destinationLatitude: destinationLatitude, destinationLongitude: destinationLongitude,
  682. additionalPassengers: additionalPassengers
  683. };
  684. var url = '@Url.Action("Estimate","Trip_PriceTemp")';
  685.  
  686. $.get(url, data)
  687. .done(function (d) {
  688. $('.l-trip-cost').html(kendo.toString(d.Estimate, "c"));
  689. $('#Trips_0__TripMileage').data('kendoNumericTextBox').value(d.Mileage);
  690. })
  691. .fail(function () {
  692. $.lss.notify.error();
  693. });
  694. }
  695.  
  696.  
  697.  
  698. </script>
  699. <script src="https://webservices.tranware.net/SaaS/customJS/reservationtrip.js"></script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement