예제 #1
0
        private void Update_UpdatePanelPermissions(string nric)
        {
            Classes.Entity.Therapist therapist = patientBLL.GetTherapistPermission(nric);

            LabelTherapistName.Text = therapist.lastName + " " + therapist.firstName;

            CheckBoxTypeHeightMeasurementApproved.Checked    = therapist.hasHeightMeasurementPermissionsApproved;
            CheckBoxTypeWeightMeasurementApproved.Checked    = therapist.hasWeightMeasurementPermissionsApproved;
            CheckBoxTypeTemperatureReadingApproved.Checked   = therapist.hasTemperatureReadingPermissionsApproved;
            CheckBoxTypeBloodPressureReadingApproved.Checked = therapist.hasBloodPressureReadingPermissionsApproved;
            CheckBoxTypeECGReadingApproved.Checked           = therapist.hasECGReadingPermissionsApproved;
            CheckBoxTypeMRIApproved.Checked  = therapist.hasMRIPermissionsApproved;
            CheckBoxTypeXRayApproved.Checked = therapist.hasXRayPermissionsApproved;
            CheckBoxTypeGaitApproved.Checked = therapist.hasGaitPermissionsApproved;

            CheckBoxTypeHeightMeasurement.Checked    = therapist.hasHeightMeasurementPermissions;
            CheckBoxTypeWeightMeasurement.Checked    = therapist.hasWeightMeasurementPermissions;
            CheckBoxTypeTemperatureReading.Checked   = therapist.hasTemperatureReadingPermissions;
            CheckBoxTypeBloodPressureReading.Checked = therapist.hasBloodPressureReadingPermissions;
            CheckBoxTypeECGReading.Checked           = therapist.hasECGReadingPermissions;
            CheckBoxTypeMRI.Checked  = therapist.hasMRIPermissions;
            CheckBoxTypeXRay.Checked = therapist.hasXRayPermissions;
            CheckBoxTypeGait.Checked = therapist.hasGaitPermissions;

            if (therapist.requestTime == null)
            {
                if (therapist.approvedTime == null)
                {
                    DivModalPermissionStatus.Attributes.Add("class", "alert alert-secondary my-2 text-center small");
                    modalPermissionStatus.Text = therapist.lastName + " " + therapist.firstName + " has no permissions.";
                }
                else
                {
                    DivModalPermissionStatus.Attributes.Add("class", "alert alert-info my-2 text-center small");
                    modalPermissionStatus.Text = therapist.lastName + " " + therapist.firstName + " has permissions and has not submitted any new request.";
                }
            }
            else
            {
                if (therapist.approvedTime == null)
                {
                    DivModalPermissionStatus.Attributes.Add("class", "alert alert-danger my-2 text-center small");
                    modalPermissionStatus.Text = therapist.lastName + " " + therapist.firstName + " has no permissions and has requested for permissions sent on " + therapist.requestTime;
                }
                else
                {
                    DivModalPermissionStatus.Attributes.Add("class", "alert alert-warning my-2 text-center small");
                    modalPermissionStatus.Text = therapist.lastName + " " + therapist.firstName + " has permissions and has requested for new permissions sent on " + therapist.requestTime;
                }
            }

            UpdatePanelPermissions.Update();
        }
        private void Update_UpdatePanelPermissions(string nric)
        {
            Classes.Entity.Patient patient = therapistBLL.GetPatientPermissions(nric);

            LabelPatientNRIC.Text = patient.nric;

            CheckBoxTypeHeightMeasurementApproved.Checked    = patient.hasHeightMeasurementPermissionsApproved;
            CheckBoxTypeWeightMeasurementApproved.Checked    = patient.hasWeightMeasurementPermissionsApproved;
            CheckBoxTypeTemperatureReadingApproved.Checked   = patient.hasTemperatureReadingPermissionsApproved;
            CheckBoxTypeBloodPressureReadingApproved.Checked = patient.hasBloodPressureReadingPermissionsApproved;
            CheckBoxTypeECGReadingApproved.Checked           = patient.hasECGReadingPermissionsApproved;
            CheckBoxTypeMRIApproved.Checked  = patient.hasMRIPermissionsApproved;
            CheckBoxTypeXRayApproved.Checked = patient.hasXRayPermissionsApproved;
            CheckBoxTypeGaitApproved.Checked = patient.hasGaitPermissionsApproved;

            CheckBoxTypeHeightMeasurement.Checked    = patient.hasHeightMeasurementPermissions;
            CheckBoxTypeWeightMeasurement.Checked    = patient.hasWeightMeasurementPermissions;
            CheckBoxTypeTemperatureReading.Checked   = patient.hasTemperatureReadingPermissions;
            CheckBoxTypeBloodPressureReading.Checked = patient.hasBloodPressureReadingPermissions;
            CheckBoxTypeECGReading.Checked           = patient.hasECGReadingPermissions;
            CheckBoxTypeMRI.Checked  = patient.hasMRIPermissions;
            CheckBoxTypeXRay.Checked = patient.hasXRayPermissions;
            CheckBoxTypeGait.Checked = patient.hasGaitPermissions;

            if (patient.requestTime != null)
            {
                modalPermissionStatus.Text = "Request for Permissions were sent on " + patient.requestTime;
            }
            else
            {
                modalPermissionStatus.Text = "No Request sent to " + patient.nric;
            }

            if (patient.requestTime == null)
            {
                if (patient.approvedTime == null)
                {
                    DivModalPermissionStatus.Attributes.Add("class", "alert alert-secondary my-2 text-center small");
                    modalPermissionStatus.Text = "You have no approved permissions.";
                }
                else
                {
                    DivModalPermissionStatus.Attributes.Add("class", "alert alert-info my-2 text-center small");
                    modalPermissionStatus.Text = "You have been granted permissions and have not submitted any new requests for permissions.";
                }
            }
            else
            {
                if (patient.approvedTime == null)
                {
                    DivModalPermissionStatus.Attributes.Add("class", "alert alert-danger my-2 text-center small");
                    modalPermissionStatus.Text = "You have not been granted permissions and have requested for permissions sent on " + patient.requestTime + ".";
                }
                else
                {
                    DivModalPermissionStatus.Attributes.Add("class", "alert alert-warning my-2 text-center small");
                    modalPermissionStatus.Text = "You have been granted permissions and have requested for permissions sent on " + patient.requestTime + ".";
                }
            }

            UpdatePanelPermissions.Update();
        }