Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- model IEnumerable<PortfolioLib.Models.F_PerformancesSummary_Result>
- <table id="tableAssetGrossPerf" class="table table-bordered table-striped table-hover">
- <tr class="background_title_tab">
- <th colspan="6" class="titlet_tab">GROSS PERFORMANCES</th>
- </tr>
- <tr>
- <th colspan="1"></th>
- <th class="thcenter thSize">
- @Html.DisplayNameFor(model => model.DAY)
- </th>
- <th class="thcenter thSize">
- 5D
- </th>
- <th class="thcenter thSize">
- @Html.DisplayNameFor(model => model.MTD)
- </th>
- <th class="thcenter thSize">
- @Html.DisplayNameFor(model => model.YTD)
- </th>
- <th class="thcenter thSize">
- @Html.DisplayNameFor(model => model.ITD)
- </th>
- </tr>
- @{ int i = 0;
- Layout = null;
- double totalDAY = ViewBag.TotalDAY;
- double totalMTD = ViewBag.TotalMTD;
- double totalYTD = ViewBag.TotalYTD;
- double totalITD = ViewBag.TotalITD;
- double TotalFiveD = ViewBag.TotalFiveD;
- }
- @foreach (var item in Model)
- {
- double? day = item.DAY;
- double? mtd = item.MTD;
- double? ytd = item.YTD;
- double? itd = item.ITD;
- double? FiveD = item.FiveD;
- <tr>
- <td>
- @Html.DisplayFor(modelItem => item.typeinstrum)
- </td>
- <td style="@(day < 0 ? "color:red" : "color:green");" class="tdBold tdCenter tdTableAssets">
- @Html.DisplayFor(modelItem => item.DAY)
- </td>
- <td style="@(FiveD < 0 ? "color:red" : "color:green");" class="tdBold tdCenter tdTableAssets">
- @Html.DisplayFor(modelItem => item.FiveD)
- </td>
- <td style="@(mtd < 0 ? "color:red" : "color:green");" class="tdBold tdCenter tdTableAssets">
- @Html.DisplayFor(modelItem => item.MTD)
- </td>
- <td style="@(ytd < 0 ? "color:red" : "color:green");" class="tdBold tdCenter tdTableAssets">
- @Html.DisplayFor(modelItem => item.YTD)
- </td>
- <td style="@(itd < 0 ? "color:red" : "color:green");" class="tdBold tdCenter tdTableAssets">
- @Html.DisplayFor(modelItem => item.ITD)
- </td>
- </tr>
- i++;
- }
- <tr class="Footer">
- <td class="tdBold">TOTAL</td>
- <td class="tdBold tdCenter"style="@(totalDAY < 0 ? "color:red" : "color:green");">@String.Format("{0:0.000%}", totalDAY)</td>
- <td class="tdBold tdCenter"style="@(TotalFiveD < 0 ? "color:red" : "color:green");">@String.Format("{0:0.000%}", TotalFiveD)</td>
- <td class="tdBold tdCenter"style="@(totalMTD < 0 ? "color:red" : "color:green");">@String.Format("{0:0.000%}", totalMTD)</td>
- <td class="tdBold tdCenter"style="@(totalYTD < 0 ? "color:red" : "color:green");">@String.Format("{0:0.000%}", totalYTD)</td>
- <td class="tdBold tdCenter"style="@(totalITD < 0 ? "color:red" : "color:green");">@String.Format("{0:0.000%}", totalITD)</td>
- </tr>
- </table>
- @*<script type="text/javascript">
- var count = 0;
- var i = 0;
- var array = [''];
- var test = [''];
- @foreach(var item in Model)
- {
- <text>
- count++
- </text>
- }
- while (i < count) {
- @foreach(var item in Model)
- {
- <text>
- array[i] = @item.YTD;
- test[i] = '@item.typeinstrum';
- array[i] = array[i] * 100;
- array[i] = Math.round(array[i]);
- i++;
- </text>
- }
- }
- </script>
- <script>
- var color = [''];
- var s = 51;
- var a = 0;
- var z = 0;
- for (x = 0; x < 765; x += 51) {
- color[a] = "rgb(0, 0, " + x + ")";
- if (x > 255) {
- color[a] = "rgb(0, " + s + ", 255)";
- s += 51;
- }
- if (s > 255) {
- color[a] = "rgb(" + z + ", 255, 255)";
- z += 51;
- }
- a++;
- }
- color[a] = "rgb(255,255,255)";
- </script>*@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement