TicketForm.cshtml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. @*
  2. For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
  3. *@
  4. @using LotteryWebApp.Languages;
  5. @using LotteryWebApp.Controllers;
  6. @using LotteryWebApp.Components;
  7. @using LotteryWebApp.Common;
  8. @using LotteryWebApp.Service;
  9. @using System.Globalization;
  10. @model TicketFormModel
  11. @{
  12. string ticketType = null;
  13. string drawnDate = Lang.draw_date;
  14. string dateEnd = Lang.draw_date;
  15. if (Model.data != null && Model.data.Count > 0)
  16. {
  17. drawnDate = DateTime.ParseExact(Model.data[0].date_random, "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture).ToString("dd/MM/yyyy");
  18. dateEnd = DateTime.ParseExact(Model.data[0].date_random, "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture).ToString("dd/MM/yyyy HH:mm");
  19. }
  20. }
  21. <div style=" margin:10px 0;">
  22. <div style="position:relative;">
  23. <img class="header-img-buy-ticket-retangle-above" src="~/img/Rectangle 132.png" />
  24. <div class="ticket-container">
  25. <div class="row">
  26. <div class="col-4 ticket-info">
  27. @{
  28. if (Model.type == Constants.NEW_YORK_BOLET_CODE || Model.type == Constants.FLORIDA_BOLET_CODE)
  29. {
  30. ticketType = Constants.BOLET_CODE;
  31. <img class="image-w-78" src="~/img/Group 83775.png" />
  32. }
  33. else if (Model.type == Constants.NEW_YORK_MAYRAJ_CODE || Model.type == Constants.FLORIDA_MAYRAJ_CODE)
  34. {
  35. ticketType = Constants.MAYRAJ_CODE;
  36. <img class="image-w-71" src="~/img/MARYAJ.png" />
  37. }
  38. else if (Model.type == Constants.NEW_YORK_LOTTO3_CODE || Model.type == Constants.FLORIDA_LOTTO3_CODE)
  39. {
  40. ticketType = Constants.LOTTO3_CODE;
  41. <img class="image-w-71" src="~/img/LOTTO3.png" />
  42. }
  43. else if (Model.type == Constants.BOULCHANS_CODE)
  44. {
  45. ticketType = Constants.BOULCHANS_CODE;
  46. //<img class="image-w-71" src="~/img/LOTTO3.png" />
  47. <div style="color: #DA5C5C; font-weight: 900;">BOULCHANS</div>
  48. }
  49. }
  50. @{
  51. if (Model.type == Constants.BOULCHANS_CODE)
  52. {
  53. <h6>#@Model.data[0].id</h6>
  54. }
  55. else
  56. {
  57. <h6>@drawnDate</h6>
  58. }
  59. }
  60. </div>
  61. @{
  62. if (Model.type != Constants.BOULCHANS_CODE)
  63. {
  64. <div class="col-1">
  65. @{
  66. for (int i = 0; i < Model.data.Count; i++)
  67. {
  68. if (Model.data[i].isEvening == Constants.MORNING_CODE || Model.data[i].isEvening == Constants.MIDDAY_CODE)
  69. {
  70. <div class="scroll-box-margin" style="height:50%;">
  71. <img src="~/img/ico-sun 1.png" />
  72. </div>
  73. }
  74. else
  75. {
  76. <div class="scroll-box-margin" style="height:50%;">
  77. <img src="~/img/moon-lg 7.png" />
  78. </div>
  79. }
  80. }
  81. }
  82. </div>
  83. }
  84. else
  85. {
  86. <div class="col-3">
  87. <div class="row">
  88. <div class="col-2" style="padding: 0;">
  89. <img style="padding-top: 10px;" src="~/img/Arrow 29.png" />
  90. </div>
  91. <div class="col-7" style="padding: 0;">
  92. <div class="text-main-color">
  93. @dateEnd
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. }
  99. }
  100. <div class="@(Model.type != Constants.BOULCHANS_CODE ? "col-7" : "col-5") ticket-number" style="margin: auto;">
  101. @{
  102. for (int i = 0; i < Model.data.Count; i++)
  103. {
  104. Term term = Model.data[i];
  105. if (term.result == "" && term.status == "1")
  106. {
  107. <div class="loader2"></div>
  108. <div>@Lang.buying ...</div>
  109. }
  110. else if (term.result == "" && term.status == "2")
  111. {
  112. <div class="loader2"></div>
  113. <div>@Lang.waiting_for_result ...</div>
  114. }
  115. else
  116. {
  117. <div class="scroll-box-margin">
  118. <div class="scroll-item-container">
  119. @{
  120. string[] listBall = new string[] { };
  121. if (Model.type == Constants.NEW_YORK_BOLET_CODE || Model.type == Constants.FLORIDA_BOLET_CODE)
  122. {
  123. listBall = term.bolet.Split(term.split);
  124. }
  125. else if (Model.type == Constants.NEW_YORK_MAYRAJ_CODE || Model.type == Constants.FLORIDA_MAYRAJ_CODE)
  126. {
  127. listBall = term.mariaj.Split(term.split);
  128. }
  129. else if (Model.type == Constants.NEW_YORK_LOTTO3_CODE || Model.type == Constants.FLORIDA_LOTTO3_CODE)
  130. {
  131. listBall = term.lotto3.Split(term.split);
  132. }
  133. else if (Model.type == Constants.BOULCHANS_CODE)
  134. {
  135. var myList = new List<string>();
  136. myList.Add(term.result);
  137. var myArray = myList.ToArray();
  138. listBall = term.result.Split("-");
  139. }
  140. for (int j = 0; j < listBall.Length; j++)
  141. {
  142. <div class="ball-container" style="margin: 0px 2px;">
  143. @{
  144. if (Model.type == Constants.NEW_YORK_BOLET_CODE || Model.type == Constants.FLORIDA_BOLET_CODE)
  145. {
  146. <img src="~/img/Group 83776.png" />
  147. }
  148. else if (Model.type == Constants.NEW_YORK_MAYRAJ_CODE || Model.type == Constants.FLORIDA_MAYRAJ_CODE)
  149. {
  150. <img src="~/img/Group 83779.png" />
  151. }
  152. else if (Model.type == Constants.NEW_YORK_LOTTO3_CODE || Model.type == Constants.FLORIDA_LOTTO3_CODE)
  153. {
  154. <img src="~/img/Group 83782.png" />
  155. }
  156. else if (Model.type == Constants.BOULCHANS_CODE)
  157. {
  158. if (j == 0)
  159. {
  160. <img src="~/img/Group 83774.png" />
  161. }
  162. else
  163. {
  164. <img src="~/img/Group 83782.png" />
  165. }
  166. }
  167. }
  168. <div class="ball-number">
  169. @listBall[j]
  170. </div>
  171. </div>
  172. }
  173. }
  174. </div>
  175. </div>
  176. }
  177. }
  178. }
  179. </div>
  180. </div>
  181. </div>
  182. </div>
  183. <div style="position:relative; top: -8px;">
  184. <img class="header-img-buy-ticket-retangle-above" src="~/img/Rectangle 133.png" />
  185. <div class="ticket-below-container">
  186. <div>
  187. <button type="button" class="btn btn-outline-primary btn-block button-style-4"
  188. onclick="actionButton_Click('BuyTicket/Choose?ticketType=@ticketType')">
  189. <i class="ft-unlock"></i> @Lang.buy_ticket.ToUpper()
  190. </button>
  191. </div>
  192. </div>
  193. </div>
  194. </div>