Advertisement
edenlavieille

Untitled

Jun 12th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.49 KB | None | 0 0
  1. @model IEnumerable<PortfolioLib.Models.M_trsdeals>
  2.  
  3. @{
  4. ViewBag.Title = "Trs Deals from " + ViewBag.portfolio.label;
  5. Html.RenderAction("PortfolioMenu", "Trading", new { ViewBag.portfolio, modelName = "FXDeals", actionName = "FromPortfolio" });
  6. <link href="@Url.Content("~/bootstrap/css/bootstrap.min.css")" rel="stylesheet" type="text/css">
  7. }
  8.  
  9.  
  10. @using (Html.BeginForm(FormMethod.Post))
  11. {
  12. <div class="form-horizontal row justify-content-center containerTab">
  13. <div class="form-group">
  14. <div class="col-lg-12 col-md-12 col-sm-12">
  15. <label class="control-label labelInput" for="name">Portfolio</label>
  16. @Html.DropDownList("portfolioid", null, htmlAttributes: new { @class = "form-control labelInput secondDetailSpace" })
  17. </div>
  18. </div>
  19. </div>
  20. }
  21.  
  22. <p>
  23. @Html.ActionLink("Create New", "Create")
  24. </p>
  25. <div class="divCreateNewDeals">
  26. <a class="createNewDeals" href="/trsdeals/Create">Create new<i class="plusCreateNew fas fa-plus"></i></a>
  27. </div>
  28.  
  29.  
  30. <div class="marginBetweenLine iconBar container">
  31. <div class="row justify-content-center">
  32. <div class="col-lg-2 col-md-2 col-sm-2">
  33. <i class="fas fa-cloud-upload-alt"></i> : Validated
  34. </div>
  35. <div class="col-lg-2 col-md-2 col-sm-2">
  36. <i class="fas fa-check"></i> : Confirmed
  37. </div>
  38. <div class="col-lg-2 col-md-2 col-sm-2">
  39. <i class="fas fa-lock"></i> : Cancelled
  40. </div>
  41. </div>
  42. </div>
  43. @foreach (var trade_date in Model.GroupBy(i => i.trade_date.Date).OrderByDescending(g => g.Key))
  44. {
  45. <p class="dateTableTop">@trade_date.Key.ToShortDateString()</p>
  46. <div class="form-group">
  47. <div class="row justify-content-center secondDetailSpace">
  48. <div class="col-xl-9 col-lg-11 col-md-11 col-sm-11 table-striped table-hover">
  49. <table class="table">
  50.  
  51. <tr>
  52. <th class="thSize thcenter background_title_tab titlet_tab table-bordered">Trade Date</th>
  53. <th class="thSize thcenter background_title_tab titlet_tab table-bordered">@Html.DisplayNameFor(model => model.trs_code)</th>
  54. <th class="thSize thcenter background_title_tab titlet_tab table-bordered">Name</th>
  55. <th class="thSize thcenter background_title_tab titlet_tab table-bordered">Direction</th>
  56. <th class="thSize thcenter background_title_tab titlet_tab table-bordered">Quantity or Notional</th>
  57. <th class="thSize thcenter background_title_tab titlet_tab table-bordered">Actual Notional</th>
  58. <th class="thSize thcenter background_title_tab titlet_tab table-bordered">Underlying Price</th>
  59. <th class="thSize thcenter background_title_tab titlet_tab table-bordered">Fixed Rate Price</th>
  60. <th class="thSize thcenter background_title_tab titlet_tab table-bordered">Invested Amount Local</th>
  61. <th class="thSize thcenter background_title_tab titlet_tab table-bordered">Compensation Amount</th>
  62. <th class="thSize thcenter background_title_tab titlet_tab table-bordered">Validated</th>
  63. <th class="thSize thcenter background_title_tab titlet_tab table-bordered"></th>
  64. </tr>
  65. @foreach (var item in trade_date)
  66. {
  67. <tr class="normal">
  68. <td class="tdCenter">@item.trade_date.ToString("yyyy-MM-dd")</td>
  69. <td class="tdCenter">@Html.ActionLink(item.M_trss.code, "Details", "Trss", new { item.M_trss.id }, null)</td>
  70. <td class="tdCenter">@item.name</td>
  71. <td class="tdCenter">@item.direction.label</td>
  72. <td class="tdCenter">@item.notional_quantity.ToString("### ### ##0")</td>
  73. <td class="tdCenter">@item.actual_notional.ToString("### ### ##0.00")</td>
  74. <td class="tdCenter">@item.underlying_initial_price.ToString("### ### ##0.00")</td>
  75. <td class="tdCenter">@item.fixed_rate_initial_price.ToString("### ### ##0.00")</td>
  76. <td class="tdCenter">@item.initial_contract_value_loc.ToString("### ### ##0.00")</td>
  77. <td class="tdCenter">@(item.compensation_amount == null ? "" : item.compensation_amount.Value.ToString("### ### ##0.00") )</td>
  78. <td class="tdCenter">
  79. @{
  80.  
  81. if (item.is_settled)
  82. {
  83. <i class="fas fa-lock"></i>
  84. }
  85.  
  86. else if (item.is_cancelled)
  87. {
  88. <i class="fas fa-times"></i>
  89. }
  90. else if (item.is_confirmed)
  91. {
  92. <i class="fas fa-check"></i>
  93. }
  94. }
  95. </td>
  96. <td class="tdCenter">
  97. @Html.ActionLink("Edit", "Edit", new { id = item.id, returnUrl = HttpContext.Current.Request.Url.PathAndQuery })|
  98. @Html.ActionLink("Details", "Details", new { id = item.id, returnUrl = HttpContext.Current.Request.Url.PathAndQuery })|
  99. @Html.ActionLink("Delete", "Delete", new { id = item.id, returnUrl = HttpContext.Current.Request.Url.PathAndQuery })
  100. </td>
  101. </tr>
  102. }
  103. </table>
  104. </div>
  105. </div>
  106. </div>
  107. }
  108. <div style="clear:both"></div>
  109.  
  110. <script type="text/javascript">
  111. $(document).ready(function () {
  112. $('#portfolioid').change(function () {
  113. uploadPtfid();
  114. });
  115. });
  116.  
  117. function uploadPtfid() {
  118.  
  119. var ptfid = $('#portfolioid option:selected').val();
  120.  
  121. var parameters = ptfid;
  122.  
  123. $.ajax({
  124. url: '/FxDeals2/UpdatePtfid',
  125. type: "Post",
  126. async: false,
  127. data: ({ parameters: parameters }),
  128. success: function (response) {
  129. window.location.reload();
  130. },
  131. error: function (response, status, error) {
  132. alert("Error while checking portfolio");
  133. }
  134. });
  135. }
  136. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement