예제 #1
0
        private void InitData()
        {
            try
            {
                Cursor.Current       = Cursors.WaitCursor;
                dtpkNgaySieuAm.Value = DateTime.Now;
                DisplayDSBacSiChiDinh();
                DisplayDSBasSiSieuAm();
                DisplayLoaiSieuAm();

                btnHinh1.Enabled = _allowEdit;
                btnHinh2.Enabled = _allowEdit;

                if (_allowEdit)
                {
                    //if (!Global.TVHomeConfig.SuDungSieuAm)
                    //{
                    //    PlayCapFactory.RunPlayCapProcess(false);
                    //    PlayCapFactory.OnCaptureCompletedEvent += new CaptureCompletedHandler(PlayCapFactory_OnCaptureCompletedEvent);
                    //}
                    //else
                    {
                        btnHinh1.Visible = false;
                        btnHinh2.Visible = false;

                        _watchingFolder = new WatchingFolder();
                        _watchingFolder.OnCreatedFileEvent += new CreatedFileEventHandler(_watchingFolder_OnCreatedFileEvent);
                        _watchingFolder.StartMoritoring(Global.HinhChupPath);

                        if (!Utility.CheckRunningProcess(Const.TVHomeProcessName))
                        {
                            Utility.ExecuteFile(Global.TVHomeConfig.Path);
                        }
                    }
                }

                Result result = PatientBus.GetPatient2(_patientGUID);
                if (result.IsOK)
                {
                    PatientView patient = result.QueryResult as PatientView;
                    _maBenhNhan = patient.FileNum;
                }
                else
                {
                    MsgBox.Show(this.Text, result.GetErrorAsString("PatientBus.GetPatient"), IconType.Error);
                    Utility.WriteToTraceLog(result.GetErrorAsString("PatientBus.GetPatient"));
                }
            }
            catch (Exception ex)
            {
                MsgBox.Show(this.Text, ex.Message, IconType.Error);
                Utility.WriteToTraceLog(ex.Message);
            }
        }
예제 #2
0
 private void StopWatchingFolder()
 {
     try
     {
         if (_watchingFolder == null)
         {
             return;
         }
         _watchingFolder.OnCreatedFileEvent -= new CreatedFileEventHandler(_watchingFolder_OnCreatedFileEvent);
         _watchingFolder.StopMoritoring();
         _watchingFolder = null;
     }
     catch (Exception ex)
     {
         MsgBox.Show(this.Text, ex.Message, IconType.Error);
         Utility.WriteToTraceLog(ex.Message);
     }
 }