/// <summary>
        /// Sets the SelectedPatientID to the current patient selected
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PatientListView_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.patientListView.SelectedItems.Count == 0)
            {
                return;
            }
            NurseDashboard dashboard = this.ParentForm as NurseDashboard;

            dashboard.SelectedPatientID = int.Parse(this.patientListView.SelectedItems[0].SubItems[0].Text);
            dashboard.RefreshTabs(sender, e);
        }
        /// <summary>
        /// Clears all the data from search fields and tabs
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ClearButton_Click(object sender, EventArgs e)
        {
            this.patientListView.Items.Clear();
            this.patientListView.Enabled = true;
            this.firstNameTextBox.Text   = "";
            this.lastNameTextBox.Text    = "";
            this.dobMaskedTextBox.Text   = "";
            NurseDashboard dashboard = this.ParentForm as NurseDashboard;

            dashboard.SelectedPatientID = 0;
            dashboard.RefreshTabs(sender, e);
        }
Beispiel #3
0
        /// <summary>
        /// load the patient user control in the nurse dashboard
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void RegisterPatientUserControl_Load(object sender, EventArgs e)
        {
            try
            {
                NurseDashboard dashboard = this.ParentForm as NurseDashboard;
                this.patientID = dashboard.SelectedPatientID;
                dashboard.CancelButton.PerformClick();
            }
            catch (Exception)
            {
                //MessageBox.Show(ex.Message, ex.GetType().ToString());
            }


            try
            {
                stateList = this.healthController.GetAllStates();

                stateCodeComboBox.DataSource    = stateList;
                stateCodeComboBox.DisplayMember = "stateName";
                stateCodeComboBox.ValueMember   = "stateCode";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message,
                                "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            if (this.patientID != 0)
            {
                this.PopulatePatient();
                this.updateButton.Enabled   = true;
                this.deleteButton.Enabled   = true;
                this.registerButton.Enabled = false;
                this.clearButton.Enabled    = false;
            }
            else
            {
                this.updateButton.Enabled   = false;
                this.deleteButton.Enabled   = false;
                this.registerButton.Enabled = true;
                this.clearButton.Enabled    = true;
                this.ClearForm();
            }
        }
Beispiel #4
0
        /// <summary>
        /// Loads the scheduled appointments for the current patient ID
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void AddAppointmentUserControl_Load(object sender, EventArgs e)
        {
            try
            {
                NurseDashboard dashboard = this.ParentForm as NurseDashboard;
                this.patientID = dashboard.SelectedPatientID;

                if (this.patientID != 0)
                {
                    this.LoadAppointmentGridView();
                    this.PopulateAppointment();
                    this.createAppointmentButton.Enabled = true;
                    this.clearButton.Enabled             = true;

                    this.doctorComboBox.Enabled            = true;
                    this.appointmentDateTimePicker.Enabled = true;
                    this.appointmentTimeComboBox.Enabled   = true;
                    this.specialtyListView.Enabled         = true;
                }
                else
                {
                    this.createAppointmentButton.Enabled   = false;
                    this.updateAppointmentButton.Enabled   = false;
                    this.doctorComboBox.Enabled            = false;
                    this.appointmentDateTimePicker.Enabled = false;
                    this.appointmentTimeComboBox.Enabled   = false;
                    this.specialtyListView.Enabled         = false;
                    this.clearButton.Enabled            = false;
                    this.updateLabel.Visible            = false;
                    this.appointmentGridView.DataSource = null;
                    this.appointmentGridView.Rows.Clear();
                    this.ClearScheduling();
                }
            }
            catch (Exception ex)
            {
                // MessageBox.Show(ex.Message);
            }
        }
Beispiel #5
0
        /// <summary>
        /// Loads the appointment list by the SelectedPatientID
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void VisitUserControl_Load(object sender, EventArgs e)
        {
            try
            {
                NurseDashboard dashboard = this.ParentForm as NurseDashboard;
                this.patientID = dashboard.SelectedPatientID;

                if (this.patientID != 0)
                {
                    this.ResetVisitForm();
                    this.PopulateApptList();
                    this.visitListView.Enabled = true;
                }
                else
                {
                    this.ResetVisitForm();
                }
            }
            catch (Exception ex)
            {
                // MessageBox.Show(ex.Message);
            }
        }