Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.27 KB | None | 0 0
  1. <div class="checkbox">
  2. <label class="col-sm-4 control-label">
  3. <input type="checkbox" name="inputNewBornKMC" value="inputNewBornKMC" id="inputNewBornKMCCheckbox"> New Born in KMC
  4. </label>
  5. </div>
  6. <div Class="modal fade" id="inputNewBornKMC" role="dialog"></div>
  7.  
  8. $(document).ready(function () {
  9.  
  10. $('#inputNewBornKMCCheckbox').on('change', function (e) {
  11. var _this = $(this);
  12.  
  13. // if checked
  14. if (_this.is(':checked')) {
  15. $('#inputNewBornKMC').modal('show');
  16. $(this).load('@Url.Action("AddPartialRegistration", "consultation")');
  17. $('#SearchMother').on('click', function () {
  18. var popupMotherMRN = $("#popupMotherMRN").val();
  19. var popupICNo = $("#popupICNo").val();
  20. var popupMotherName = $("#popupMotherName").val();
  21.  
  22. $.ajax({
  23. url: '/consultation/AddPartialRegistrationSearch',
  24. type: 'GET',
  25. data: { popupMotherMRN: popupMotherMRN, popupICNo: popupICNo, popupMotherName: popupMotherName },
  26. success: function (data) {
  27. alert("yay!!");
  28. },
  29. error: function () {
  30. alert("something seems wrong");
  31. }
  32. });
  33. });
  34.  
  35. $('#btnSelectMother').on('click', function () {
  36. $.ajax({
  37. url: '/consultation/registration', //i'm not sure what i should put here to make so that the values will be passed to the registration view and closes the popup modal.
  38. type: 'POST',
  39. data: self.closest('form').serialize(),
  40. success: function (data) {
  41. if (data.success == true) {
  42. document.getElementById("inputMotherMRN").style.display = 'block'; document.getElementById("inputMotherMRNlabel").style.display = 'block';
  43.  
  44. var value = $('#popupMotherMRN').val();
  45. $('#inputMotherMRN').val(value);
  46. var value2 = $('#popupMotherName').val();
  47. $('#inputMotherName').val(value2);
  48.  
  49. $('#inputNewBornKMC').modal('hide');
  50. //location.reload(false)
  51. } else {
  52. $('#inputNewBornKMC').html(data);
  53. }
  54. },
  55. error: function () {
  56. alert("something seems wrong");
  57. }
  58. });
  59. });
  60.  
  61. } // end if(:checked)
  62.  
  63. if (!_this.is(':checked')) {
  64. document.getElementById("inputMotherMRN").style.display = 'none';
  65. document.getElementById("inputMotherMRNlabel").style.display = 'none';
  66. $('#inputMotherMRN').val() = '';
  67. }
  68.  
  69. });
  70. });
  71.  
  72. <form class="form-horizontal" role="form">
  73. <!-- Modal -->
  74. <div Class="modal fade" id="inputNewBornKMC" role="dialog">
  75. <div class="modal-dialog">
  76. <!-- Modal content-->
  77. <div class="modal-content">
  78. <div class="modal-header">
  79. <button type="button" class="close" data-dismiss="modal">&times;</button>
  80. <h4 class="modal-title">Patient Profile</h4>
  81. </div>
  82. <div class="modal-body">
  83. Mother's MRN
  84. <input type="text" class="form-control input-sm" id="popupMotherMRN" name="popupMotherMRN" />
  85. IC/ID No
  86. <input type="text" class="form-control input-sm" id="popupICNo" name="popupICNo" />
  87. Mother's Name
  88. <input type="text" class="form-control input-sm" id="popupMotherName" name="popupMotherName" />
  89. <button type="button" class="btn btn-default" id="SearchMother" >Search</button>
  90. <br />
  91. <div Class="modal fade" id="tableSearchMother" role="dialog"></div>
  92. </div>
  93. <div class="modal-footer">
  94. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  95. @*<button type="button" class="btn btn-default" id="AddGP">Save changes</button>*@
  96. </div>
  97. </div> <!-- Modal content-->
  98. </div>
  99. </div> <!-- Modal -->
  100.  
  101. @ModelType CMS.PatientLookupVM
  102.  
  103. <div Class="modal fade" id="tableSearchMother" role="dialog">
  104.  
  105. <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
  106. <thead>
  107. <tr>
  108. <th>No.</th>
  109. <th>MRN</th>
  110. <th>Mother's IC No</th>
  111. <th>Mother's Name</th>
  112. <th></th>
  113. </tr>
  114. </thead>
  115. @code
  116. Dim rowNo = 0
  117. End Code
  118. <tbody>
  119.  
  120. @For Each item In Model.LoadNewbornMother
  121. @code
  122. rowNo += 1
  123. End Code
  124. @<tr Class="even gradeC">
  125. <td>@rowNo</td>
  126. <td>@item.paid</td>
  127. <td>@item.pidno</td>
  128. <td>@item.pname</td>
  129. <td style="text-align: center; vertical-align: middle;">
  130. <form Class="form-horizontal" role="form">
  131. <input type="hidden" id="popupMotherMRN" name="popupMotherMRN" value="@item.paid"/>
  132. <input type="hidden" id="popupMotherName" name="popupMotherName" value="@item.pname"/>
  133. <Button type="submit" Class="btn btn-default" id="btnSelectMother" name="btnSelectMother" >Select</Button>
  134. </form>
  135. </td>
  136. </tr>
  137.  
  138. Next
  139.  
  140. </tbody>
  141. </table>
  142.  
  143. Public Function AddPartialRegistration() As PartialViewResult
  144. Return PartialView("_PartialRegistration")
  145. End Function
  146.  
  147. Public Function AddPartialRegistrationSearch(popupMotherMRN As String, popupICNo As String, popupMotherName As String) As PartialViewResult
  148. Dim Patient As New PatientLookupVM()
  149. Dim NewBornList = Patient.GetNewbornMother(popupMotherMRN, popupICNo, popupMotherName)
  150. Return PartialView("_PartialRegistrationSearch", NewBornList)
  151. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement