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

            _workersKeeper       = workersKeeper;
            _operationTypeWorker = workersKeeper.OperationTypeWorker;

            _selectedOperationTypes = selectedOperationTypes.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
        }
        public OperationTypeRemoveForm(CWorkersKeeper workersKeeper, COperationType operationTypeInfo)
        {
            InitializeComponent();

            _operationTypeInfo   = operationTypeInfo;
            _operationTypeWorker = workersKeeper.OperationTypeWorker;
            _operationWorker     = workersKeeper.OperationWorker;
            _operationsWithCurrentOperationTypeCnt = _operationWorker.GetCountContainedOperationType(_operationTypeInfo.Name);
        }
Beispiel #3
0
        public OperationTypeViewForm(CWorkersKeeper workersKeeper, COperationType operationTypeInfo, string defaultParentFolderName)
        {
            InitializeComponent();
            comboBoxNodeType.SelectedIndex = 0;
            _operationTypeWorker           = workersKeeper.OperationTypeWorker;
            _operationWorker = workersKeeper.OperationWorker;

            if (operationTypeInfo == null)
            {
                _operationTypeInfo = new COperationType();
                Text = "Добавление нового типа операции";
                AddAllParentTypesToComboBox(string.Empty);
                comboBoxParentNodeName.Text = defaultParentFolderName;
            }
            else
            {
                _operationTypeInfo = new COperationType(operationTypeInfo);
                Text = "Редактирование типа операции";
                textBoxOperationTypeName.Text = _operationTypeInfo.Name;

                AddAllParentTypesToComboBox(_operationTypeInfo.Name);

                if (_operationTypeInfo.Type == NodeType.Folder)
                {
                    comboBoxNodeType.SelectedIndex = 1;
                }

                comboBoxNodeType.Enabled = false;

                if (_operationTypeInfo.IdParent != -1)
                {
                    COperationType operationType = _operationTypeWorker.GetById(_operationTypeInfo.IdParent);
                    comboBoxParentNodeName.Text = operationType.Name;
                }
            }
        }
Beispiel #4
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();
            }
        }