예제 #1
0
        /// <summary>
        ///   If an outstanding recall has been found the user is prompted for confirmation. If they select to amend the values of the record will be loaded into the form. If they select no then the record will be deleted and replaced when they save. If they cancel the form will close
        /// </summary>
        private void HandleOutstandingRecord()
        {
            PatientRecalls pr1 = dbb.GetRecall(patientId);
            DialogResult   dr  =
                MessageBox.Show("An outstanding recall was found\nPress yes to load this or no to make a new recall",
                                "Recall Found", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Asterisk,
                                MessageBoxDefaultButton.Button2);

            if (dr == DialogResult.Yes)
            {
                amend = true;
                datePrefTime_DateTime.Value = pr1.DateAndPrefTime.Value;
                reason_Text.Text            = pr1.Reason;
                RecallMethods prm2 = (RecallMethods)pr1.Method;
                if (prm2 == RecallMethods.Post)
                {
                    method_ComboBox.SelectedItem = "Post";
                }
                else if (prm2 == RecallMethods.Phone)
                {
                    method_ComboBox.SelectedItem = "Phone";
                }
                else
                {
                    method_ComboBox.SelectedItem = "Email"; //TODO: whatif recall method has been removed
                }
            }
            else if (dr == DialogResult.Cancel)
            {
                DialogResult = DialogResult.Cancel;
                Close();
            }
        }
예제 #2
0
        /// <summary>
        ///   Handles the Load event of the NewRecall form. Adds recall methods to the form based on whether the patient can accept the recall methods. Also selects their preferred recall method
        /// </summary>
        /// <param name = "sender">The sender.</param>
        /// <param name = "e">The <see cref = "System.EventArgs" /> instance containing the event data.</param>
        private void NewRecallLoad(object sender, EventArgs e)
        {
            if (dbb.CanPatientBePosted(Patientrec))
            {
                method_ComboBox.Items.Add("Post");
            }
            if (dbb.CanPatientBePhoned(Patientrec))
            {
                method_ComboBox.Items.Add("Phone");
            }
            if (dbb.CanPatientBeEmailed(Patientrec))
            {
                method_ComboBox.Items.Add("Email");
            }
            RecallMethods prm = (RecallMethods)Patientrec.PreferredRecallMethod;

            switch (prm)
            {
            case RecallMethods.Post:
                method_ComboBox.SelectedItem = "Post";
                break;

            case RecallMethods.Phone:
                method_ComboBox.SelectedItem = "Phone";
                break;

            case RecallMethods.Email:
                method_ComboBox.SelectedItem = "Email";
                break;
            }


            if (dbb.OutstandingRecall(patientId))
            {
                HandleOutstandingRecord();
            }
        }