public OperationViewForm(OperationForm operationForm, DbEngine dbEngine, OperationClass operationInfo, PatientClass patientInfo) { _stopSaveParameters = true; InitializeComponent(); _dbEngine = dbEngine; _patientInfo = patientInfo; _operationForm = operationForm; PutObjectsToComboBox(_dbEngine.OrderlyList.ToArray(), comboBoxOrderly); PutObjectsToComboBox(_dbEngine.ScrubNurseList.ToArray(), comboBoxScrubNurse); PutObjectsToComboBox(_dbEngine.HeAnestethistList.ToArray(), comboBoxHeAnestethist); PutObjectsToComboBox(_dbEngine.SheAnestethistList.ToArray(), comboBoxSheAnestethist); if (operationInfo == null) { Text = "Добавление операции"; _operationInfo = new OperationClass(); textBoxSurgeons.Text = _dbEngine.ConfigEngine.OperationViewFormTextBoxSurgeons; textBoxAssistents.Text = _dbEngine.ConfigEngine.OperationViewFormTextBoxAssistents; comboBoxHeAnestethist.Text = _dbEngine.ConfigEngine.OperationViewFormTextBoxHeAnestethist; comboBoxSheAnestethist.Text = _dbEngine.ConfigEngine.OperationViewFormTextBoxSheAnestethist; comboBoxScrubNurse.Text = _dbEngine.ConfigEngine.OperationViewFormComboBoxScrubNurse; comboBoxOrderly.Text = _dbEngine.ConfigEngine.OperationViewFormComboBoxOrderly; } else { Text = "Просмотр данных об операции"; _operationInfo = operationInfo; _saveOperationInfo = new OperationClass(operationInfo); textBoxName.Text = _operationInfo.Name; textBoxAssistents.Text = ListToMultilineString(_operationInfo.Assistents); textBoxSurgeons.Text = ListToMultilineString(_operationInfo.Surgeons); comboBoxScrubNurse.Text = _operationInfo.ScrubNurse; comboBoxSheAnestethist.Text = _operationInfo.SheAnaesthetist; comboBoxHeAnestethist.Text = _operationInfo.HeAnaesthetist; comboBoxOrderly.Text = _operationInfo.Orderly; dateTimePickerDataOfOperation.Value = _operationInfo.DataOfOperation; dateTimePickerStartTimeOfOperation.Value = _operationInfo.StartTimeOfOperation; dateTimePickerEndTimeOfOperation.Value = _operationInfo.EndTimeOfOperation; } }
/// <summary> /// Открыть форму со списком операций /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonOperations_Click(object sender, EventArgs e) { if (IsFormHasEmptyNeededFields()) { MessageBox.Show("Поля, отмеченные звёздочкой, обязательны для заполнения", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } PutDataToPatient(_patientInfo); if (_operationForm == null || _operationForm.IsDisposed) { _operationForm = new OperationForm(this, _dbEngine, _patientInfo) { MdiParent = MdiParent }; _operationForm.Show(); } else { _operationForm.Focus(); } }