Advertisement
edenlavieille

Untitled

Jun 7th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.26 KB | None | 0 0
  1. model IEnumerable<PortfolioLib.Models.M_corpbonddeals>
  2.  
  3.  
  4. @using (Html.BeginForm(FormMethod.Post))
  5. {
  6. <div class="form-horizontal row justify-content-center containerTab">
  7. <div class="form-group">
  8. <div class="col-lg-12 col-md-12 col-sm-12">
  9. <label class="control-label labelInput" for="name">Portfolio</label>
  10. @Html.DropDownList("portfolioid", null, htmlAttributes: new { @class = "form-control labelInput secondDetailSpace" })
  11. </div>
  12. </div>
  13. </div>
  14.  
  15. }
  16.  
  17. <div class="divCreateNewDeals">
  18. <a class="createNewDeals" href="/CorporateBondDeals/Create">Create new<i class="plusCreateNew fas fa-plus"></i></a>
  19. </div>
  20.  
  21. <div class="marginBetweenLine iconBar container">
  22. <div class="row justify-content-center">
  23. <div class="col-lg-2 col-md-2 col-sm-2">
  24. <i class="fas fa-cloud-upload-alt"></i> : Validated
  25. </div>
  26. <div class="col-lg-2 col-md-2 col-sm-2">
  27. <i class="fas fa-check"></i> : Confirmed
  28. </div>
  29. <div class="col-lg-2 col-md-2 col-sm-2">
  30. <i class="fas fa-lock"></i> : Cancelled
  31. </div>
  32. <div class="col-lg-2 col-md-2 col-sm-2">
  33. <i class="fas fa-times"></i> : Settled
  34. </div>
  35. </div>
  36. </div>
  37.  
  38.  
  39.  
  40. @foreach (var trade_date in Model.GroupBy(i => i.trade_date.Date).OrderByDescending(g => g.Key))
  41. {
  42. <p class="dateTableTop">@trade_date.Key.ToShortDateString()</p>
  43. <div class="form-group">
  44. <div class="row justify-content-center secondDetailSpace">
  45. <div class="col-xl-9 col-lg-11 col-md-11 col-sm-11 table-striped table-hover">
  46. <table class="table">
  47. <tr>
  48. <th class="thSize thCenter background_title_tab titlet_tab table-bordered">Trade Date</th>
  49. <th class="thSize thCenter background_title_tab titlet_tab table-bordered">Security Description</th>
  50. <th class="thSize thCenter background_title_tab titlet_tab table-bordered">Bond</th>
  51. <th class="thSize thCenter background_title_tab titlet_tab table-bordered">Direction</th>
  52. <th class="thSize thCenter background_title_tab titlet_tab table-bordered">Nominal Amount</th>
  53. <th class="thSize thCenter background_title_tab titlet_tab table-bordered">Price</th>
  54. <th class="thSize thCenter background_title_tab titlet_tab table-bordered">Invested Amount Local</th>
  55. <th class="thSize thCenter background_title_tab titlet_tab table-bordered">Status</th>
  56. <th class="thSize thCenter background_title_tab titlet_tab table-bordered">Settled</th>
  57. <th class="thSize thCenter background_title_tab titlet_tab table-bordered"></th>
  58. </tr>
  59.  
  60. @foreach (var item in trade_date)
  61. {
  62. bool? coco = item.M_corporatebonds.is_coco;
  63.  
  64. <tr class="normal">
  65. <td class="tdCenter">@item.trade_date.ToString("yyyy-MM-dd")</td>
  66. <td class="tdCenter" style="@(coco.Value ? "color:blue; font-weight:bold;" : "color:black");">@item.M_corporatebonds.security_description</td>
  67. <td class="tdCenter">@Html.ActionLink(item.M_corporatebonds.isincode, "Details", "CorporateBonds", new { item.M_corporatebonds.id }, null)</td>
  68. <td class="tdCenter">@item.direction.label</td>
  69. <td class="tdCenter">@item.nominal_amount.ToString("### ### ##0")</td>
  70. <td class="tdCenter">@item.trade_price.ToString("### ### ##0.00")</td>
  71. <td class="tdCenter">@item.invested_amount_loc.Value.ToString("### ### ##0")</td>
  72. <td>
  73. @{
  74.  
  75. if (item.is_settled)
  76. {
  77. <i class="fas fa-lock"></i>
  78. }
  79.  
  80. else if (item.is_cancelled)
  81. {
  82. <i class="fas fa-times"></i>
  83. }
  84.  
  85. else if (item.isconfirmed)
  86. {
  87. <i class="fas fa-check"></i>
  88. }
  89. else if (item.isvalidated)
  90. {
  91. <i class="fas fa-cloud-upload-alt"></i>
  92. }
  93. }
  94. </td>
  95. <td class="tdCenter">
  96. <div class="material-switch pull-right">
  97. <input data-val="true" data-val-required="The settle field is required." htmlAttributes="{ class = label_primary }" id="@item.id" name="@item.id" type="checkbox" checked="@item.is_settled" onclick="settleTrade('@item.id','M_corpbonddeals')" />
  98. <label for="@item.id" class="label-primary"></label>
  99. </div>
  100. </td>
  101. <td>
  102. @{
  103. if (!item.isconfirmed)
  104. {
  105. @Html.ActionLink("Edit", "Edit", new { id = item.id, returnUrl = HttpContext.Current.Request.Url.PathAndQuery })<text> |</text>
  106. }
  107. }
  108. @Html.ActionLink("Details", "Details", new { id = item.id, returnUrl = HttpContext.Current.Request.Url.PathAndQuery })
  109.  
  110. @{
  111. if (!item.isconfirmed)
  112. {
  113. <text> | </text>@Html.ActionLink("Delete", "Delete", new { id = item.id, returnUrl = HttpContext.Current.Request.Url.PathAndQuery })
  114. }
  115. }
  116. </td>
  117. </tr>
  118. }
  119. </table>
  120. </div>
  121. </div>
  122. </div>
  123. }
  124.  
  125. <script type="text/javascript">
  126. $(document).ready(function () {
  127. $("form").bind("keypress", function (e) {
  128. if (e.keyCode == 13)
  129. return false;
  130. });
  131. });
  132.  
  133. $(document).ready(function () {
  134. $('#portfolioid').change(function () {
  135. uploadPtfid();
  136. });
  137. });
  138.  
  139. function uploadPtfid() {
  140. var ptfid = $('#portfolioid option:selected').val()
  141.  
  142. var parameters = ptfid;
  143.  
  144. $.ajax({
  145. url: '/CorporateBondDeals/Update',
  146. type: "Post",
  147. async: false,
  148. data: ({ parameters: parameters }),
  149. success: function (response) {
  150. window.location.reload();
  151. },
  152. error: function (response, status, error) {
  153. alert("Error while checking portfolio");
  154. }
  155. });
  156. }
  157. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement