示例#1
0
        protected void ConfigureDlg()
        {
            referenceAuthor.ItemsQuery = EmployeeRepository.ActiveEmployeeOrderedQuery();
            referenceAuthor.SetObjectDisplayFunc <Employee>(e => e.ShortName);
            referenceAuthor.Binding.AddBinding(Entity, s => s.Author, w => w.Subject).InitializeFromSource();
            referenceAuthor.Sensitive = false;

            representationtreeview1.RepresentationModel = new CommentsTemplatesVM();
            representationtreeview1.Selection.Changed  += Representationtreeview1_Selection_Changed;

            enumAncorPoint.ItemsEnum = typeof(CommentsAncorPoint);
            enumAncorPoint.Binding.AddBinding(Entity, s => s.AncorPoint, w => w.SelectedItem).InitializeFromSource();

            checkCommentFixed.Binding.AddBinding(Entity, s => s.IsFixed, w => w.Active).InitializeFromSource();

            ytextCommentFinal.Binding.AddSource(Entity)
            .AddBinding(x => x.Text, w => w.Buffer.Text)
            .AddBinding(x => x.CanTextEdit, w => w.Editable).InitializeFromSource();

            var counterpartyFilter = new CounterpartyFilter(UoW);

            counterpartyFilter.SetAndRefilterAtOnce(x => x.RestrictIncludeArhive = false);

            referenceClient.RepresentationModel = new ViewModel.CounterpartyVM(counterpartyFilter);
            referenceClient.Binding.AddBinding(Entity, s => s.Counterparty, w => w.Subject).InitializeFromSource();

            referenceDeliveryPoint.Binding.AddBinding(Entity, s => s.DeliveryPoint, w => w.Subject).InitializeFromSource();

            referenceOrder.SubjectType = typeof(Order);
            referenceOrder.Binding.AddBinding(Entity, s => s.Order, w => w.Subject).InitializeFromSource();

            var uowDeliveryPoint = UoWforeign as DeliveryPoint;

            if (uowDeliveryPoint != null)
            {
                Entity.DeliveryPoint = uowDeliveryPoint;
            }

            var uowCounterparty = UoWforeign as Counterparty;

            if (uowCounterparty != null)
            {
                Entity.Counterparty = uowCounterparty;
            }

            //var uowOrder = UoWforeign as Order;
            //if(uowOrder != null)
            //  Entity.Order = uowOrder;
        }