Exemplo n.º 1
0
        /// <summary>
        /// Отобразить на форме с операциями выбранных хирургов
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonOk_Click(object sender, EventArgs e)
        {
            if (checkedListBoxSurgeons.CheckedItems.Count == 0)
            {
                Close();
                return;
            }

            var orderlyMultilineStr = new StringBuilder();

            for (int i = 0; i < checkedListBoxSurgeons.CheckedItems.Count; i++)
            {
                orderlyMultilineStr.Append(checkedListBoxSurgeons.CheckedItems[i] + "\r\n");
            }

            if (orderlyMultilineStr.Length > 2)
            {
                orderlyMultilineStr.Remove(orderlyMultilineStr.Length - 2, 2);
            }

            if (_operationViewForm != null)
            {
                _operationViewForm.PutStringToObject(_objectBoxNameOnForm, orderlyMultilineStr.ToString());
            }
            else
            {
                _patientViewForm.PutStringToObject(_objectBoxNameOnForm, orderlyMultilineStr.ToString());
            }

            Close();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Отобразить на форме с операциями выбранную нозологию
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonOk_Click(object sender, EventArgs e)
        {
            if (checkedListBoxNosologyes.SelectedItems.Count == 0)
            {
                Close();
                return;
            }

            try
            {
                _patientViewForm.PutObjectsToComboBox(_dbEngine.NosologyList.ToArray(), _patientViewForm.comboBoxNosology);
                _patientViewForm.PutStringToObject("comboBoxNosology", checkedListBoxNosologyes.SelectedItem.ToString());
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }