示例#1
0
        public static void ShowAdmin(Window owner, DocumentTypeDetailAdminViewModel model)
        {
            Model = model;
            var window = new DocumentTypeDetailAdminWindow
            {
                Title       = model.Title,
                Owner       = owner,
                DataContext = model
            };

            window.ShowDialog();
        }
示例#2
0
        public override void NavigateToEdit(Window owner, AdminItem item)
        {
            var documentType = GetDocumentTypeByIdQuery.Get(new GetDocumentTypeByIdRequest {
                Id = item.Id
            });

            var customFields = documentType.CustomFields.ConvertAll(x => new CustomFieldDto {
                Id = x.Id, FieldType = x.FieldType.ToEnum <FieldTypes>(), FieldName = x.FieldName, Mandatory = x.Mandatory, DocumentTypeId = x.DocumentTypeId
            });

            DocumentTypeDetailAdminWindow.ShowAdmin(owner, new DocumentTypeDetailAdminViewModel
            {
                Id    = documentType.Id,
                Name  = documentType.Name,
                Title = $"Document type {documentType.Name} beheren",
                Items = new ObservableCollection <CustomFieldDto>(customFields),
                //OriginalItems = customFields
            });
        }