Advertisement
Guest User

Untitled

a guest
Dec 12th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.62 KB | None | 0 0
  1.  
  2. @using Domain.Entities.DataCapture;
  3. @using Service.Interfaces;
  4. @using Service.Interfaces.ServiceResult;
  5. @using Service.Interfaces.ViewModels;
  6. @using UI.Utils
  7. @model ServiceResult<QuoteMultipleViewModel>
  8. @section styles
  9. {
  10. <link href="~/Content/motorcycle.css" rel="stylesheet">
  11. <link href="~/Content/Site.css" rel="stylesheet">
  12. }
  13.  
  14.  
  15. @{ Html.RenderPartial("_PartialSteps", 3); }
  16. <div class="row setup-content step activeStepInfo" id="step-2">
  17. <div class="col-xs-12">
  18. <div class="col-md-12 well @((Session["Theme"] != null && (bool)Session["Theme"] == true)?"rider-color":"light-color") text-center">
  19. <form method="post" action="/DataCapture/PostQuotation" novalidate>
  20. <div class="row">
  21. <div class="col-md-12">
  22. <div class="form-group row">
  23. <h2 class="data-capture-title col-md-12">Your Quotation</h2>
  24. <hr class="title-hr" />
  25. </div>
  26. <div class="form-group">
  27. <div class="row">
  28. <div class="col-md-3">
  29. <label class="pull-left" style="color:#095689">Total premium</label>
  30. </div>
  31. <div class="col-md-3">
  32. <label id="lblTotalPremium" style="color:#095689"> £ 984,000</label>
  33. </div>
  34. </div>
  35. </div>
  36. <div class="form-group pointer-hover">
  37. <table id="policyTableId" class="table table-responsive">
  38. <thead>
  39. <tr>
  40. <th>Insurer Details</th>
  41. <th>Premium</th>
  42. <th>Policy Information</th>
  43. <th><span class="glyphicon glyphicon-record"></span></th>
  44. </tr>
  45. </thead>
  46. <tbody>
  47. @foreach (var item in Model.Data.Model)
  48. {
  49. <tr>
  50. <td>@item.Insurer</td>
  51. <td>@item.GrossPremium £</td>
  52. <td>@((item.Excesses != null && item.Excesses.Count > 0) ? item.Excesses.Sum(i => i.Amount) + " £" : 0 + " £") </td>
  53. <td>
  54. <input id="policyRadioBtnId" type="radio" name="policySelect">
  55. </td>
  56. </tr>
  57. }
  58. </tbody>
  59. </table>
  60. </div>
  61. <div id="optionalExtrasDiv" style="display:none">
  62. <div class="form-group row">
  63. <h3 class="data-capture-title col-md-12">Optional Extras</h3>
  64. <hr class="title-hr" />
  65. </div>
  66. <div class="form-group pointer-hover">
  67. <table id="optionalextras" class="table table-responsive">
  68. <thead>
  69. <tr>
  70. <th>Your Policy</th>
  71. <th>Price</th>
  72. <th><span class="glyphicon glyphicon-ok"></span></th>
  73. </tr>
  74. </thead>
  75. <tbody onclick="sumResults()">
  76. @foreach (var item in Model.Data.Model)
  77. {
  78. <tr>
  79. <td>@item.Insurer</td>
  80. <td>@item.GrossPremium £</td>
  81. <td><input type="checkbox" name="" value=""></td>
  82. </tr>
  83. }
  84. </tbody>
  85. </table>
  86. </div>
  87. </div>
  88. </div>
  89. @*<div class="form-group">
  90. <a class="terms">Terms &amp; Conditions</a>
  91. </div>
  92. <h3 class="login-details">Login Details</h3>
  93. <div class="form-group">
  94. <p class="details login-details">
  95. Your quote details have been saved, so if you wish to return to your quote you won’t have to re-enter your details (though you should check each time whether anything, including start date, needs updating).
  96. Please use the following login details to revisit your quote.
  97. </p>
  98. <strong class="user-login-details">Username:user@@outlook.com; Password:CYJ56C9 </strong>
  99. </div>*@
  100. <div class="form-group">
  101. <button class="btn btn-lg btn-primary" type="button">Go On Cover</button>
  102. <a class="btn btn-lg btn-primary" href="/Home/Index">Save Quote</a>
  103. <a class="btn btn-lg btn-primary" href="/DataCapture/OtherDetails">Change Quote Details</a>
  104. </div>
  105. </div>
  106. </form>
  107. </div>
  108. </div>
  109. </div>
  110.  
  111. @section scripts {
  112. <script>
  113. function sumResults()
  114. {
  115.  
  116. var totalPremium=0;
  117. for (var item in Model.Data.Model)
  118. {
  119. totalPremium = totalPremium + item.GrossPremium;
  120. }
  121.  
  122. $("#lblTotalPremium").text(totalPremium);
  123. }
  124.  
  125. $(document).ready(function () {
  126. $($(".step > div")[4]).click();
  127.  
  128. $('#optionalextras tbody tr').click(function () {
  129. var checked = $(this).find('td input:checkbox').prop('checked', true);
  130. if (checked) {
  131. var selected = $(this).hasClass("highlightTable");
  132. if (!selected) {
  133. $(this).addClass("highlightTable");
  134. } else {
  135. $(this).removeClass("highlightTable");
  136. $(this).find('td input:checkbox').prop('checked', false);
  137. }
  138. }
  139. });
  140.  
  141. $('#policyTableId tbody tr').click(function () {
  142. var checked = $(this).find('td input:radio').prop('checked', true);
  143. if (checked) {
  144. var selected = $(this).hasClass("highlightTable");
  145. if (!selected) {
  146. $("#policyTableId tbody tr").removeClass("highlightTable");
  147. $(this).addClass("highlightTable");
  148.  
  149. }
  150. showTable();
  151. }
  152. })
  153. });
  154.  
  155. function showTable() {
  156. $('#optionalExtrasDiv').css('display', 'block');
  157. }
  158. </script>
  159. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement