Пример #1
0
        /// <summary>
        /// Opens an <see cref="OrderNoteConversationComponent"/>
        /// </summary>
        public void Open()
        {
            if (this.OrderRef == null)
            {
                return;
            }

            try
            {
                var component = new OrderNoteConversationComponent(this.OrderRef, this.OrderNoteCategories, this.TemplatesXml, this.SoftKeysXml);
                var dialog    = ApplicationComponent.LaunchAsWorkspaceDialog(this.Context.DesktopWindow,
                                                                             component,
                                                                             GetTitle());
                dialog.Closed += delegate { OnDialogClosed(component.ExitCode); };
            }
            catch (Exception e)
            {
                ExceptionHandler.Report(e, this.Context.DesktopWindow);
            }
        }
Пример #2
0
            public RecipientTable(OrderNoteConversationComponent owner)
            {
                _owner = owner;
                var checkColumn = new TableColumn <Checkable <RecipientTableItem>, bool>(
                    "Select",
                    item => item.IsChecked,
                    (item, value) =>
                {
                    item.IsChecked = value;
                    // bug: #2594: forces validation to refresh otherwise the screen doesn't update
                    // only when validation is visible
                    if (_owner.ValidationVisible)
                    {
                        _owner.ShowValidation(true);
                    }
                },
                    0.4f)
                {
                    EditableHandler = (x => !x.Item.IsMandatory)
                };

                this.Columns.Add(checkColumn);

                var nameColumn = new TableColumn <Checkable <RecipientTableItem>, object>(
                    "Name",
                    item => item.Item.Recipient,
                    (x, value) => x.Item.Recipient = value,
                    2.0f)
                {
                    ValueFormatter  = RecipientTableItem.Format,
                    CellEditor      = new LookupHandlerCellEditor(new StaffAndGroupLookupHandler(owner.Host.DesktopWindow)),
                    EditableHandler = (x => !x.Item.IsMandatory)
                };

                this.Columns.Add(nameColumn);
            }