Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="checkbox">
- <label class="col-sm-4 control-label">
- <input type="checkbox" name="inputNewBornKMC" value="inputNewBornKMC" id="inputNewBornKMCCheckbox"> New Born in KMC
- </label>
- </div>
- <div Class="modal fade" id="inputNewBornKMC" role="dialog"></div>
- $(document).ready(function () {
- $('#inputNewBornKMCCheckbox').on('change', function (e) {
- var _this = $(this);
- // if checked
- if (_this.is(':checked')) {
- $('#inputNewBornKMC').modal('show');
- $(this).load('@Url.Action("AddPartialRegistration", "consultation")');
- $('#SearchMother').on('click', function () {
- var popupMotherMRN = $("#popupMotherMRN").val();
- var popupICNo = $("#popupICNo").val();
- var popupMotherName = $("#popupMotherName").val();
- $.ajax({
- url: '/consultation/AddPartialRegistrationSearch',
- type: 'GET',
- data: { popupMotherMRN: popupMotherMRN, popupICNo: popupICNo, popupMotherName: popupMotherName },
- success: function (data) {
- alert("yay!!");
- },
- error: function () {
- alert("something seems wrong");
- }
- });
- });
- $('#btnSelectMother').on('click', function () {
- $.ajax({
- 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.
- type: 'POST',
- data: self.closest('form').serialize(),
- success: function (data) {
- if (data.success == true) {
- document.getElementById("inputMotherMRN").style.display = 'block'; document.getElementById("inputMotherMRNlabel").style.display = 'block';
- var value = $('#popupMotherMRN').val();
- $('#inputMotherMRN').val(value);
- var value2 = $('#popupMotherName').val();
- $('#inputMotherName').val(value2);
- $('#inputNewBornKMC').modal('hide');
- //location.reload(false)
- } else {
- $('#inputNewBornKMC').html(data);
- }
- },
- error: function () {
- alert("something seems wrong");
- }
- });
- });
- } // end if(:checked)
- if (!_this.is(':checked')) {
- document.getElementById("inputMotherMRN").style.display = 'none';
- document.getElementById("inputMotherMRNlabel").style.display = 'none';
- $('#inputMotherMRN').val() = '';
- }
- });
- });
- <form class="form-horizontal" role="form">
- <!-- Modal -->
- <div Class="modal fade" id="inputNewBornKMC" role="dialog">
- <div class="modal-dialog">
- <!-- Modal content-->
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal">×</button>
- <h4 class="modal-title">Patient Profile</h4>
- </div>
- <div class="modal-body">
- Mother's MRN
- <input type="text" class="form-control input-sm" id="popupMotherMRN" name="popupMotherMRN" />
- IC/ID No
- <input type="text" class="form-control input-sm" id="popupICNo" name="popupICNo" />
- Mother's Name
- <input type="text" class="form-control input-sm" id="popupMotherName" name="popupMotherName" />
- <button type="button" class="btn btn-default" id="SearchMother" >Search</button>
- <br />
- <div Class="modal fade" id="tableSearchMother" role="dialog"></div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
- @*<button type="button" class="btn btn-default" id="AddGP">Save changes</button>*@
- </div>
- </div> <!-- Modal content-->
- </div>
- </div> <!-- Modal -->
- @ModelType CMS.PatientLookupVM
- <div Class="modal fade" id="tableSearchMother" role="dialog">
- <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
- <thead>
- <tr>
- <th>No.</th>
- <th>MRN</th>
- <th>Mother's IC No</th>
- <th>Mother's Name</th>
- <th></th>
- </tr>
- </thead>
- @code
- Dim rowNo = 0
- End Code
- <tbody>
- @For Each item In Model.LoadNewbornMother
- @code
- rowNo += 1
- End Code
- @<tr Class="even gradeC">
- <td>@rowNo</td>
- <td>@item.paid</td>
- <td>@item.pidno</td>
- <td>@item.pname</td>
- <td style="text-align: center; vertical-align: middle;">
- <form Class="form-horizontal" role="form">
- <input type="hidden" id="popupMotherMRN" name="popupMotherMRN" value="@item.paid"/>
- <input type="hidden" id="popupMotherName" name="popupMotherName" value="@item.pname"/>
- <Button type="submit" Class="btn btn-default" id="btnSelectMother" name="btnSelectMother" >Select</Button>
- </form>
- </td>
- </tr>
- Next
- </tbody>
- </table>
- Public Function AddPartialRegistration() As PartialViewResult
- Return PartialView("_PartialRegistration")
- End Function
- Public Function AddPartialRegistrationSearch(popupMotherMRN As String, popupICNo As String, popupMotherName As String) As PartialViewResult
- Dim Patient As New PatientLookupVM()
- Dim NewBornList = Patient.GetNewbornMother(popupMotherMRN, popupICNo, popupMotherName)
- Return PartialView("_PartialRegistrationSearch", NewBornList)
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement