Beispiel #1
0
        private void Initialize(CWorkersKeeper workersKeeper)
        {
            InitializeComponent();

            _workersKeeper = workersKeeper;
            _surgeonWorker = _workersKeeper.SurgeonWorker;
        }
Beispiel #2
0
        public SurgeonViewForm(CWorkersKeeper workersKeeper, CSurgeon surgeonInfo)
        {
            InitializeComponent();

            _workersKeeper = workersKeeper;
            _surgeonWorker = _workersKeeper.SurgeonWorker;

            if (surgeonInfo == null)
            {
                _surgeonInfo = new CSurgeon();
                Text         = "Добавление нового хирурга";
            }
            else
            {
                _surgeonInfo            = surgeonInfo;
                Text                    = "Редактирование хирурга";
                textBoxSurgeonName.Text = _surgeonInfo.Name;
                textBoxHeader.Text      = _surgeonInfo.Header;
            }
        }
Beispiel #3
0
        public CWorkersKeeper(string dataPath, bool isNeedToStoreDbFiles)
        {
            if (!Directory.Exists(dataPath))
            {
                Directory.CreateDirectory(dataPath);
            }

            var dataDirectoryInfo = new DirectoryInfo(dataPath);

            ExecutableDirectoryPath = dataDirectoryInfo.Parent != null
                ? dataDirectoryInfo.Parent.FullName
                : dataDirectoryInfo.FullName;

            if (isNeedToStoreDbFiles)
            {
                try
                {
                    SaveDbFilesToTempFolder(dataPath);
                }
                catch (Exception ex)
                {
                    MessageBox.ShowDialog("Не удалось осуществить резервное копирование файлов с данными. Сообщение об ошибке:\r\n" + ex, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            var waitForm = new WaitForm("Загрузка данных...");

            try
            {
                waitForm.Show();
                Application.DoEvents();

                ConfigurationEngine = new CConfigurationEngine();

                waitForm.SetProgress(4);
                _nosologyWorker = new CNosologyWorker(dataPath);
                waitForm.SetProgress(8);
                _operationTypeWorker = new COperationTypeWorker(dataPath);
                waitForm.SetProgress(12);
                _orderlyWorker = new COrderlyWorker(dataPath);
                waitForm.SetProgress(16);
                _scrubNurseWorker = new CScrubNurseWorker(dataPath);
                waitForm.SetProgress(20);
                _surgeonWorker = new CSurgeonWorker(dataPath);

                waitForm.SetProgress(24);
                _patientWorker = new CPatientWorker(this, dataPath);
                waitForm.SetProgress(28);
                _hospitalizationWorker = new CHospitalizationWorker(this, dataPath);
                waitForm.SetProgress(32);
                _visitWorker = new CVisitWorker(this, dataPath);
                waitForm.SetProgress(36);
                _operationWorker = new COperationWorker(this, dataPath);

                waitForm.SetProgress(40);
                _dischargeEpicrisisWorker = new CDischargeEpicrisisWorker(dataPath);
                waitForm.SetProgress(44);
                _lineOfCommunicationEpicrisisWorker = new CLineOfCommunicationEpicrisisWorker(dataPath);
                waitForm.SetProgress(48);
                _medicalInspectionWorker = new CMedicalInspectionWorker(dataPath);
                waitForm.SetProgress(52);
                _operationProtocolWorker = new COperationProtocolWorker(dataPath);
                waitForm.SetProgress(56);
                _transferableEpicrisisWorker = new CTransferableEpicrisisWorker(dataPath);

                waitForm.SetProgress(60);
                _anamneseWorker = new CAnamneseWorker(dataPath);
                waitForm.SetProgress(66);
                _obstetricHistoryWorker = new CObstetricHistoryWorker(dataPath);

                waitForm.SetProgress(72);
                _cardWorker = new CCardWorker(dataPath);
                waitForm.SetProgress(78);
                _brachialPlexusCardWorker = new CBrachialPlexusCardWorker(dataPath);
                waitForm.SetProgress(84);
                _rangeOfMotionCardWorker = new CRangeOfMotionCardWorker(dataPath);
                waitForm.SetProgress(92);
                _obstetricParalysisCardWorker = new CObstetricParalysisCardWorker(dataPath);

                waitForm.SetProgress(100);
                _globalSettings = new CGlobalSettings(dataPath);
            }
            finally
            {
                waitForm.CloseForm();
            }
        }