Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- model IEnumerable<PortfolioLib.Models.M_corpbonddeals>
- @using (Html.BeginForm(FormMethod.Post))
- {
- <div class="form-horizontal row justify-content-center containerTab">
- <div class="form-group">
- <div class="col-lg-12 col-md-12 col-sm-12">
- <label class="control-label labelInput" for="name">Portfolio</label>
- @Html.DropDownList("portfolioid", null, htmlAttributes: new { @class = "form-control labelInput secondDetailSpace" })
- </div>
- </div>
- </div>
- }
- <div class="divCreateNewDeals">
- <a class="createNewDeals" href="/CorporateBondDeals/Create">Create new<i class="plusCreateNew fas fa-plus"></i></a>
- </div>
- <div class="marginBetweenLine iconBar container">
- <div class="row justify-content-center">
- <div class="col-lg-2 col-md-2 col-sm-2">
- <i class="fas fa-cloud-upload-alt"></i> : Validated
- </div>
- <div class="col-lg-2 col-md-2 col-sm-2">
- <i class="fas fa-check"></i> : Confirmed
- </div>
- <div class="col-lg-2 col-md-2 col-sm-2">
- <i class="fas fa-lock"></i> : Cancelled
- </div>
- <div class="col-lg-2 col-md-2 col-sm-2">
- <i class="fas fa-times"></i> : Settled
- </div>
- </div>
- </div>
- @foreach (var trade_date in Model.GroupBy(i => i.trade_date.Date).OrderByDescending(g => g.Key))
- {
- <p class="dateTableTop">@trade_date.Key.ToShortDateString()</p>
- <div class="form-group">
- <div class="row justify-content-center secondDetailSpace">
- <div class="col-xl-9 col-lg-11 col-md-11 col-sm-11 table-striped table-hover">
- <table class="table">
- <tr>
- <th class="thSize thCenter background_title_tab titlet_tab table-bordered">Trade Date</th>
- <th class="thSize thCenter background_title_tab titlet_tab table-bordered">Security Description</th>
- <th class="thSize thCenter background_title_tab titlet_tab table-bordered">Bond</th>
- <th class="thSize thCenter background_title_tab titlet_tab table-bordered">Direction</th>
- <th class="thSize thCenter background_title_tab titlet_tab table-bordered">Nominal Amount</th>
- <th class="thSize thCenter background_title_tab titlet_tab table-bordered">Price</th>
- <th class="thSize thCenter background_title_tab titlet_tab table-bordered">Invested Amount Local</th>
- <th class="thSize thCenter background_title_tab titlet_tab table-bordered">Status</th>
- <th class="thSize thCenter background_title_tab titlet_tab table-bordered">Settled</th>
- <th class="thSize thCenter background_title_tab titlet_tab table-bordered"></th>
- </tr>
- @foreach (var item in trade_date)
- {
- bool? coco = item.M_corporatebonds.is_coco;
- <tr class="normal">
- <td class="tdCenter">@item.trade_date.ToString("yyyy-MM-dd")</td>
- <td class="tdCenter" style="@(coco.Value ? "color:blue; font-weight:bold;" : "color:black");">@item.M_corporatebonds.security_description</td>
- <td class="tdCenter">@Html.ActionLink(item.M_corporatebonds.isincode, "Details", "CorporateBonds", new { item.M_corporatebonds.id }, null)</td>
- <td class="tdCenter">@item.direction.label</td>
- <td class="tdCenter">@item.nominal_amount.ToString("### ### ##0")</td>
- <td class="tdCenter">@item.trade_price.ToString("### ### ##0.00")</td>
- <td class="tdCenter">@item.invested_amount_loc.Value.ToString("### ### ##0")</td>
- <td>
- @{
- if (item.is_settled)
- {
- <i class="fas fa-lock"></i>
- }
- else if (item.is_cancelled)
- {
- <i class="fas fa-times"></i>
- }
- else if (item.isconfirmed)
- {
- <i class="fas fa-check"></i>
- }
- else if (item.isvalidated)
- {
- <i class="fas fa-cloud-upload-alt"></i>
- }
- }
- </td>
- <td class="tdCenter">
- <div class="material-switch pull-right">
- <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')" />
- <label for="@item.id" class="label-primary"></label>
- </div>
- </td>
- <td>
- @{
- if (!item.isconfirmed)
- {
- @Html.ActionLink("Edit", "Edit", new { id = item.id, returnUrl = HttpContext.Current.Request.Url.PathAndQuery })<text> |</text>
- }
- }
- @Html.ActionLink("Details", "Details", new { id = item.id, returnUrl = HttpContext.Current.Request.Url.PathAndQuery })
- @{
- if (!item.isconfirmed)
- {
- <text> | </text>@Html.ActionLink("Delete", "Delete", new { id = item.id, returnUrl = HttpContext.Current.Request.Url.PathAndQuery })
- }
- }
- </td>
- </tr>
- }
- </table>
- </div>
- </div>
- </div>
- }
- <script type="text/javascript">
- $(document).ready(function () {
- $("form").bind("keypress", function (e) {
- if (e.keyCode == 13)
- return false;
- });
- });
- $(document).ready(function () {
- $('#portfolioid').change(function () {
- uploadPtfid();
- });
- });
- function uploadPtfid() {
- var ptfid = $('#portfolioid option:selected').val()
- var parameters = ptfid;
- $.ajax({
- url: '/CorporateBondDeals/Update',
- type: "Post",
- async: false,
- data: ({ parameters: parameters }),
- success: function (response) {
- window.location.reload();
- },
- error: function (response, status, error) {
- alert("Error while checking portfolio");
- }
- });
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement