예제 #1
0
파일: Form1.cs 프로젝트: sakpung/webstudy
        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
#if LEADTOOLS_V20_OR_LATER
                _controller            = new MedicalWebViewerExternalController("http://localhost/MedicalViewer20");
                _controller.ServiceURL = @"http://localhost/MedicalViewerServiceWcf20";
#else
                _controller            = new MedicalWebViewerExternalController("http://localhost/MedicalViewer19");
                _controller.ServiceURL = @"http://localhost/MedicalViewerService19";
#endif
                _controller.BrowserClosed += new EventHandler <EventArgs>(_controller_BrowserClosed);

                _controller.HeartBeatEvent += new EventHandler <HeartBeatEventArgs>(_controller_HeartBeatEvent);
                _controller.LogoutEvent    += new EventHandler <LogoutEventArgs>(_controller_LogoutEvent);
                // Setup Logger
                Logger.ListViewLog = this.listViewLog;
                Logger.Controller  = _controller;

                Form1 mainForm = sender as Form1;
                if (mainForm != null)
                {
                    mainForm.tabControl1.TabPages.Remove(tabPagePatientInformation);
                }


                // View Instances Tab
                linkLabelImage.Visible = false;

                // Patient Information Tab
                radioButtonFindPatientAll.Checked = true;

                // Update Patient Tab

                // Add Patient Tab

                patientListControlSample.ListViewPatients.SelectedIndexChanged += new EventHandler(ListViewPatients_SelectedIndexChanged);
                patientListControlSample.Populate(samplePatientInfo);
                patientControlAddPatient.Initialize(patientListControlSample.ListViewPatients);

                patientControlUpdatePatient.Initialize(null);
                patientControlUpdatePatient.ComboBoxPatientId.SelectedIndexChanged += new EventHandler(comboBoxUpdatePatient_SelectedIndexChanged);

                // Update Users Tab
                usersControlUpdateUser.ComboBoxUserName.SelectedIndexChanged += new EventHandler(ComboBoxUserName_SelectedIndexChanged);

                // Add Users Tab

                // Error Provider
                TextBox tbPatientId = patientControlAddPatient.TextBoxPatientId;
                tbPatientId.TextChanged += new EventHandler(tbPatientId_TextChanged);
                errorProvider1.SetIconAlignment(tbPatientId, ErrorIconAlignment.MiddleLeft);

                UpdateUI();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                Close();
            }
        }