Payment.cshtml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. @{
  2. ViewData["Title"] = "ChooseNumber";
  3. Layout = "~/Views/Shared/_NothingLayout.cshtml";
  4. }
  5. @using LotteryWebApp.Languages;
  6. @using LotteryWebApp.Controllers;
  7. @using LotteryWebApp.Common;
  8. @model BuyTicketPayment_ViewModel
  9. <div class="app-content content" style="position:relative">
  10. <div class="card-title text-center ">
  11. <div class="news-button-header-container" style="text-align: start; margin: 0 10px;">
  12. @await Component.InvokeAsync("SmallHeader", new { title = @Lang.review_payment.ToUpper(), url ="BuyTicket"})
  13. </div>
  14. </div>
  15. <div class="content-wrapper" style="margin-top:80px; margin-bottom:60px;">
  16. <div class="content-body">
  17. <section class="flexbox-container">
  18. <div class="col-12 align-items-center justify-content-center">
  19. @{
  20. if (Model.step == Constants.PAYMENT_SHOW)
  21. {
  22. <input type="hidden" value="1" id="payment-status" />
  23. <div class="header-choose-container">
  24. <div class="row">
  25. <div class="col-6 date-choose-box text-style-start-2">
  26. <h6>@Lang.your_number</h6>
  27. </div>
  28. <div class="col-6 button-choose-box text-style-end-2">
  29. <h6>@Lang.money (HTG)</h6>
  30. </div>
  31. </div>
  32. </div>
  33. <div>
  34. @{
  35. string[] ticketNumber = Model.tickets.Split(",");
  36. for (int i = 0; i < ticketNumber.Length; i++)
  37. {
  38. <div>
  39. @await Component.InvokeAsync("PaymentForm", new {data= ticketNumber[i], ticketType=Model.ticketType})
  40. </div>
  41. }
  42. }
  43. </div>
  44. <hr class="line2" />
  45. <div style="margin:30px 0;">
  46. <div class="row">
  47. <div class="col-6 text-style-start-2">
  48. <h6>@Lang.term</h6>
  49. </div>
  50. <div class="col-6 date-choose-box">
  51. <div class="date-choose-confirm">
  52. <h5 class="text-bold-700">@DateTime.Now.ToString("dd/MM/yyyy")</h5>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. <hr class="line2" />
  58. <div style="margin:30px 0;">
  59. <div class="row">
  60. <div class="col-6 text-style-start-2">
  61. <h6>@Lang.total_ticket</h6>
  62. </div>
  63. <div class="col-6 text-style-end-2">
  64. <h5 class="text-bold-700">@Model.tickets.Split(",").Length</h5>
  65. </div>
  66. </div>
  67. <hr class="line2" />
  68. <div class="row">
  69. <div class="col-6 text-style-start-3">
  70. <h6>@Lang.total_money: </h6>
  71. </div>
  72. <div class="col-6 text-style-end-3">
  73. <h5 id="total-money" class="text-bold-700">@(Model.tickets.Split(",").Length * 10) HTG</h5>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="row button-on-footer" style="margin-top:50px;">
  78. <div class="col-6">
  79. <button type="button" class="btn btn-outline-primary btn-block button-style-2"
  80. onclick="reorderButton_Click()">
  81. <i class="ft-unlock"></i> @Lang.reorder.ToUpper()
  82. </button>
  83. </div>
  84. <div class="col-6">
  85. <button type="button" class="btn btn-outline-primary btn-block login-button payment-button"
  86. onclick="paymentSendOTPButton_Click('@Lang.enter_amount_1_1000')">
  87. <i class="ft-unlock"></i> @Lang.payment.ToUpper()
  88. </button>
  89. </div>
  90. </div>
  91. }
  92. else if (Model.step == Constants.PAYMENT_RESULT)
  93. {
  94. <div class="card-header border-0 card-box">
  95. <div class="card-title text-center ">
  96. <div>
  97. <div style=" margin-top: 50px;">
  98. <img class="logo-app" src="~/img/Group854.png" />
  99. </div>
  100. <div style="position: relative; margin-top: 10px;">
  101. <h2 class="text-style-main-large">
  102. @Lang.success
  103. </h2>
  104. </div>
  105. <div style="position: relative; margin-top: 10px;">
  106. <h4 class="text-style-blue-normal">
  107. @Lang.brought_success
  108. </h4>
  109. </div>
  110. <div style=" margin-top: 30px;">
  111. <div class="row text-box-row">
  112. <div class="col-6 text-start">
  113. <h6>@Lang.number</h6>
  114. </div>
  115. <div class="col-6 text-end-bold">
  116. @Model.profile.users
  117. </div>
  118. </div>
  119. <hr class="line-2" style="margin: 0px 15px 20px 15px; top:0px;">
  120. <div class="row text-box-row">
  121. <div class="col-6 text-start">
  122. <h6>@Lang.ticket_code</h6>
  123. </div>
  124. <div class="col-6 text-end-bold">
  125. @Model.confirmBuyingTicketResponse.listTiketId
  126. </div>
  127. </div>
  128. <hr class="line-2" style="margin: 0px 15px 20px 15px; top:0px;">
  129. <div class="row text-box-row">
  130. <div class="col-6 text-start">
  131. <h6>@Lang.order_code</h6>
  132. </div>
  133. <div class="col-6 text-end-bold">
  134. #@Model.confirmBuyingTicketResponse.orderId
  135. </div>
  136. </div>
  137. <hr class="line-2" style="margin: 0px 15px 20px 15px; top:0px;">
  138. <div class="row text-box-row">
  139. <div class="col-6 text-start">
  140. <h6>@Lang.payment</h6>
  141. </div>
  142. <div class="col-6 text-end-bold">
  143. @string.Format("{0:#,0}", double.Parse(Model.confirmTicketDataResponse.totalMoney)) HTG
  144. </div>
  145. </div>
  146. <hr class="line-2" style="margin: 0px 15px 20px 15px; top:0px;">
  147. <div class="row text-box-row">
  148. <div class="col-6 text-start">
  149. <h6>@Lang.content</h6>
  150. </div>
  151. @{
  152. string content = Lang.buy;
  153. if (Model.ticketType == Constants.BOLET_CODE)
  154. {
  155. content += " Bolet of ";
  156. }
  157. else if (Model.ticketType == Constants.MAYRAJ_CODE)
  158. {
  159. content += " Mayraj of ";
  160. }
  161. else if (Model.ticketType == Constants.BOULCHANS_CODE)
  162. {
  163. content += " Boulchans of ";
  164. }
  165. else
  166. {
  167. content += " Lotto3 of ";
  168. }
  169. if (Model.termType == Constants.NEW_YORK_BOLET_CODE || Model.termType == Constants.NEW_YORK_MAYRAJ_CODE || Model.termType == Constants.NEW_YORK_LOTTO3_CODE)
  170. {
  171. content += " - New York ";
  172. }
  173. else if (Model.ticketType == Constants.BOULCHANS_CODE)
  174. {
  175. content += " Natcom Loto ";
  176. }
  177. else
  178. {
  179. content += " - Florida ";
  180. }
  181. content += Model.confirmTicketDataResponse.termObj.endDate;
  182. <div class="col-6 text-end-bold">
  183. @content
  184. </div>
  185. }
  186. </div>
  187. <hr class="line-2" style="margin: 0px 15px 20px 15px; top:0px;">
  188. </div>
  189. </div>
  190. <div class="row button-on-footer" style="margin-top:50px;">
  191. <div class="col-12">
  192. <form class="form-horizontal" action="@ViewBag.MyConfig.MyValue/Home" method="get">
  193. <button type="submit" class="btn btn-outline-primary btn-block login-button">
  194. <i class="ft-unlock"></i> @Lang.return_home_page
  195. </button>
  196. </form>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. }
  202. }
  203. </div>
  204. </section>
  205. </div>
  206. </div>
  207. </div>
  208. <script>
  209. stopLoading();
  210. </script>
  211. <script>
  212. var moneyEach = 1;
  213. $(".ticket-money").on("change", function(event) {
  214. console.log("change money");
  215. let totalMoney = 0;
  216. let check = 1;
  217. var elements = document.getElementsByClassName("ticket-money");
  218. for (let i = 0; i < elements.length; i++) {
  219. let val = elements[i].value;
  220. console.log("val: " + val);
  221. if (val == "" || val == null || val == undefined || val == "0") {
  222. check *= 0;
  223. } else {
  224. totalMoney += parseInt(elements[i].value);
  225. }
  226. }
  227. console.log("totalMoney: " + totalMoney + " check: " + check);
  228. var selectElement = event.target;
  229. if (totalMoney > 5000 || check == 0) {
  230. $("#payment-status").val("0");
  231. let old = $(this).attr("oldvalue");
  232. $(".payment-button").addClass("inactive");
  233. //selectElement.value = old;
  234. if (check == 0) {
  235. //console.log("money error: " + old);
  236. //toastr.error("Your money must be in range from 1 to 1000 HTG. Please check again.");
  237. } else {
  238. //console.log("money each over: " + old);
  239. toastr.error('@Lang.over_1000HTG_transfer');
  240. }
  241. } else {
  242. $(".payment-button").removeClass("inactive");
  243. $("#payment-status").val("1");
  244. moneyEach = selectElement.value;
  245. $(this).attr("oldvalue").value = moneyEach;
  246. console.log("money each: " + moneyEach);
  247. $("#total-money").text(totalMoney + " HTG");
  248. }
  249. })
  250. </script>