コード例 #1
0
        private void AddDrugButtonClick(object sender, RoutedEventArgs e)
        {
            if (drugs == null)
            {
                drugs = database.GetAllEntitiesOfType <Drug>().Where(x => x.Refunds.Count > 0).Take(10).ToList();
            }
            var selector = new DrugSelector(drugs);

            selector.ShowDialog();

            if (selector.SelectedDrug != null)
            {
                Prescription.Drugs.Add(selector.SelectedDrug);
                Prescription.DrugsListChanged();
            }
        }
コード例 #2
0
        /// <summary>
        /// Opens the observation orders selection browse in clarion
        /// </summary>
        /// <returns></returns>
        protected override IQOpResult <int> OpenEditor(int currentValue, IQVarElementTarget target)
        {
            //OnBeforeClarionEditorInvoke(this);
            //int prsId = CallClarion.CallDrgBro(true, true);
            //OnAfterClarionEditorInvoke(this);

            //If the user hit "close", don't update the primaryKeyValue
            //return (prsId != 0)
            //		   ? new IQOpResult<int> { Result = OpResultEnum.Completed, Value = Drug.GetEntityByID(prsId).DRG_ID }
            //		   : new IQOpResult<int> { Result = OpResultEnum.Cancelled };

            var editor = new DrugSelector {
                Value = currentValue
            };

            return(editor.ShowDialog() == DialogResult.OK
                        ? new IQOpResult <int> {
                Result = OpResultEnum.Completed, Value = editor.Value
            }
                        : new IQOpResult <int> {
                Result = OpResultEnum.Cancelled
            });
        }