Exemplo n.º 1
0
        /// <summary>
        /// Creates a new session based on the supplied task
        /// </summary>
        /// <param name="task"></param>
        private void CreateNewSession(Task task)
        {
            if (CurrentClinician.ScheduleSessions)
            {
                Session newSession = new Session();

                newSession.Task      = task;
                newSession.Clinician = CurrentClinician.NameString;

                // Add
                _patient.AddSession(newSession);
                _remote_DataManager.ClientUpdatePatient(_patient, _selectedPatientIndex);
                _remote_DataManager.ClientRequestUpdatedPatientList();
                FillInListViewSessions();

                if (session_Details_Control.Visible)
                {
                    buttonBack_Click(null, null);
                }
            }
            else
            {
                MessageBox.Show(StroMoHab_Client.Properties.Settings.Default.InvalidPermissionsString, "StroMoHab Client", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public Patient_Records_Screen()
        {
            InitializeComponent();

            if (TCPProcessor.ConnectedToServer)
            {
                _Remote_Data_Manager = (Patient_Remote_DataManager)Activator.GetObject(typeof(Patient_Remote_DataManager), TCPProcessor.BuildServerRemotingString(8005, "PatientRemoteDataManagerConnection"));
            }



            //Setup the sorter
            _patientSorter = new ListViewColumnSorter();
            this.listViewPatients.ListViewItemSorter = _patientSorter;

            listViewPatients.Groups.Add(listViewGroup_New);
            listViewPatients.Groups.Add(listViewGroup_Patients);


            //Setup background worker events
            backgroundWorkerSearcher.DoWork             += new DoWorkEventHandler(backgroundWorkerSearcher_DoWork);
            backgroundWorkerSearcher.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorkerSearcher_RunWorkerCompleted);
            backgroundWorkerLoader.DoWork             += new DoWorkEventHandler(backgroundWorkerLoader_DoWork);
            backgroundWorkerLoader.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorkerLoader_RunWorkerCompleted);

            //Request an updated patient list and then retreive it
            _Remote_Data_Manager.ClientRequestUpdatedPatientList();
            //Load in the patient data into the open patient list view
            LoadInPatientData();
        }