Exemplo n.º 1
0
        private void TimeListItemButton_Click(Object sender, RoutedEventArgs e)
        {
            if (e.OriginalSource is Button button && button.DataContext is TimeItemViewModel timeItem)
            {
                try
                {
                    VisitItemViewModel visitItem = _mediator.Send(
                        new VisitCreateCommand(timeItem.TimeItemID, _patient.ID, _patient.Code, _patient.DisplayName)
                        ).Result;

                    _patient.VisitItems.Add(visitItem);

                    _printService.Print(
                        new VisitPrintForm(visitItem)
                        );
                }
                catch (Exception ex)
                {
                    Log.Error(ex, "При записи на приём произошла ошибка");
                }

                _mainWindow.PrevWorkflow <ActionsControl>();
            }
        }
Exemplo n.º 2
0
        internal VisitPrintForm(VisitItemViewModel visitItem)
        {
            InitializeComponent();

            DataContext = visitItem;
        }