Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. @using (Html.BeginForm(null, null, FormMethod.Post, new { id = "submitForm", onload = "toggleTable()" }))
  2. {
  3. <div class="row">
  4. @*<input type="text" name="CasinoID" placeholder="Enter Casino ID" id="cIdSearch" />*@
  5. @*<div>
  6. @Html.DropDownList("CasinoID", Model.TerminalReceiptPostData.CasinoIdDDL, "Select Casino", new { id = "cIdSearch", @class = "custom-class-for-dropdown card" })
  7. </div>*@
  8. <div>
  9. @Html.DropDownList("CasinoID", Model.TerminalReceiptPostData.CasinoIdDDL, "Select Casino", new { id = "cIdSearch", @class = "custom-class-for-dropdown card" })
  10. </div>
  11. &nbsp;
  12. <div>
  13. <input id="datepicker" class="datepicker-base card" name="Date" placeholder="MM/DD/YYY" type="text" />
  14. </div>
  15. &nbsp;
  16. <div>
  17. <button type="submit" class="btn btn-sm btn-primary" id="search" onclick="toggleTable()" > Search Transactions</button>
  18. </div>
  19. </div>
  20. }
  21.  
  22. <hr />
  23. <div class="row " id="ReceiptsMainDiv">
  24. <div class="col-md-12" style="overflow-y:scroll">
  25. <table class="table table-striped table-hover table-bordered" id="terminalReceipts">
  26. <thead>
  27. <tr>
  28. <th>Terminal ID</th>
  29. <th>Local Transaction Time</th>
  30. <th>Amount</th>
  31. <th>Receipt</th>
  32. <td class="hidden"></td>
  33. </tr>
  34. </thead>
  35. <tbody>
  36.  
  37. @foreach (var item in Model.TransactionsTests)
  38. {
  39. <tr id="@String.Concat("rowIndex", Model.TransactionsTests.IndexOf(item))">
  40. <td>@item.TerminalID</td>
  41. <td>@item.TransactionTime</td>
  42. <td>@item.Amount</td>
  43. @*<td>@Html.ActionLink("View Receipt", "ViewReceipt", new { id = item.Id }, new { @class = "btn btn-primary btn-sm" }) <br /></td>*@
  44. <td class="transactionID hidden">@item.Id</td>
  45. <td>
  46. @if (item.ReceiptData == null)
  47. {
  48. <button class="btn btn-sm btn-primary viewReceipt" disabled>View Receipt</button>
  49. }
  50. else
  51. {
  52. <button class="btn btn-sm btn-primary viewReceipt" data-rowindex="@String.Concat("rowIndex", Model.TransactionsTests.IndexOf(item))">View Receipt</button>
  53. }
  54. </td>
  55. </tr>
  56. }
  57. </tbody>
  58. </table>
  59. </div>
  60. </div>
  61.  
  62. [HttpPost]
  63. public ActionResult Index(string CasinoID, DateTime Date)
  64. {
  65.  
  66. //var id = Int32.Parse(Request.Form["CasinoID"].ToString());
  67.  
  68. var Cid = Request.Form["CasinoID"];
  69. Cid = GetNumbers(Cid);
  70.  
  71. var id = Int32.Parse(Cid);
  72.  
  73. var model = TRBL.GetTransactionTestsData(id, Date);
  74. model.TerminalReceiptPostData = TRBL.GetCasinosDDL();
  75. return View(model);
  76. }
  77.  
  78. function toggleTable() {
  79.  
  80. $("#ReceiptsMainDiv").toggle();
  81.  
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement