Exemplo n.º 1
0
        public EditProductMultiples(Product p)
        {
            InitializeComponent();

            manager = EditProductMultiplesManager.Instance;
            manager.EditEntity = p;

            TableViewEventHandlers<Multiple> eventHandler = new TableViewEventHandlers<Multiple>(grdMultiples, manager);
            eventHandler.AssignEvents();

            Loaded += new RoutedEventHandler(EditProductMultiples_Loaded);
        }
Exemplo n.º 2
0
        public Users()
        {
            InitializeComponent();

            if (DesignerProperties.GetIsInDesignMode(this) == false)
            {
                Loaded += new RoutedEventHandler(Users_Loaded);

                this.DataContext = viewModel;

                TableViewEventHandlers<User> eventsOnUsers = new TableViewEventHandlers<User>(grdUsers,
                                                                                              viewModel.UserManager, true);
                TableViewEventHandlers<UserRole> eventsOnRoles = new TableViewEventHandlers<UserRole>(grdRoles,
                                                                                      viewModel, true);
                eventsOnRoles.AssignEvents();

                eventsOnUsers.AssignEvents();
            }
        }
Exemplo n.º 3
0
        public CustomerGroupAnimation()
        {
            InitializeComponent();

            if (DesignerProperties.GetIsInDesignMode(this) == false)
            {
                animationManager.PropertyChanged += new PropertyChangedEventHandler(animationManager_PropertyChanged);
                animationManager.RemoveFinished += new Action<string>(animationManager_RemoveFinished);

                Loaded += new RoutedEventHandler(CustomerGroupAnimation_Loaded);

                TableViewEventHandlers<AnimationCustomerGroup> eventHandler =
                    new TableViewEventHandlers<AnimationCustomerGroup>(grdAnimationCustomerGroups,
                                                                       new AnimationCustomerGroupManager());
                eventHandler.AssignEvents();

                MakeColumnsReadOnly();

                grdAnimationCustomerGroups.AutoExpandAllGroups = true;
            }
        }
Exemplo n.º 4
0
        public ProductDetailAnimation()
        {
            InitializeComponent();
            if (DesignerProperties.GetIsInDesignMode(this) == false)
            {
                Loaded += new RoutedEventHandler(ProductDetailAnimation_Loaded);
                grdProductDetails.View.ShowFilterPopup += new FilterPopupEventHandler(View_ShowFilterPopup);
                (grdProductDetails.View as TableView).ShowingEditor += new ShowingEditorEventHandler(View_ShowingEditor);
                grdProductDetails.GroupRowExpanding += new RowAllowEventHandler(grdProductDetails_GroupRowExpanding);
                grdProductDetails.GroupRowExpanded += new RowEventHandler(grdProductDetails_GroupRowExpanded);

                TableViewEventHandlers<AnimationProductDetail> eventHandler = new TableViewEventHandlers<AnimationProductDetail>(grdProductDetails, AnimationProductDetailManager.Instance, true);
                eventHandler.AssignEvents();
                (grdProductDetails.View as TableView).AutoWidth = true;

                MakeColumnsReadOnly();

                animationManager.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(animationManager_PropertyChanged);

                //(colAllocate.FindName("btnOpenAllocation") as Button).DataContext = AnimationManager.GetInstance();
            }
        }
        void CustomerGroupAllocation_Loaded(object sender, RoutedEventArgs e)
        {
            if (IsVisible)
            {
                DataContext = animationManager;

                TableViewEventHandlers<LorealOptimiseData.CustomerGroupAllocation> eventHandler = new TableViewEventHandlers<LorealOptimiseData.CustomerGroupAllocation>(grdCustomerGroupAllocations, CustomerGroupAllocationManager.Instance);
                eventHandler.AssignEvents();
                (grdCustomerGroupAllocations.View as TableView).AutoWidth = true;

                animationManager.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(CustomerGroupAllocation_PropertyChanged);

                MakeColumnsReadOnly();

                // setting cell style
                foreach (GridColumn column in this.grdCustomerGroupAllocations.Columns)
                {
                    if (column.ReadOnly)
                    {
                        column.CellStyle = FindResource("CellNormalStyle") as Style;
                    }
                }

                // sorting            
                grdCustomerGroupAllocations.BeginDataUpdate();
                grdCustomerGroupAllocations.SortInfo.Clear();
                grdCustomerGroupAllocations.SortInfo.Add(new GridSortInfo("CustomerGroup.Name"));
                grdCustomerGroupAllocations.EndDataUpdate();

                (grdCustomerGroupAllocations.View as TableView).FocusedRowChanged += new FocusedRowChangedEventHandler(CustomerGroupAllocation_FocusedRowChanged);

                if (animationManager.Animation != null && animationManager.Animation.Status != null)
                {
                    ChangeDataEntryLocking(animationManager.Animation.Status.Value);
                }
            }
  
        }
Exemplo n.º 6
0
        void CustomerAllocation_Loaded(object sender, RoutedEventArgs e)
        {
            if (IsVisible)
            {
                DataContext = animationManager;

                if (DesignerProperties.GetIsInDesignMode(this) == false)
                {
                    TableViewEventHandlers<LorealOptimiseData.CustomerAllocation> eventHandler = new TableViewEventHandlers<LorealOptimiseData.CustomerAllocation>(grdAllocation, CustomerAllocationManager.Instance);
                    eventHandler.AssignEvents();
                    (grdAllocation.View as TableView).AutoWidth = true;

                    MakeColumnsReadOnly();
                }

                animationManager.PropertyChanged += animationManger_PropertyChanged;

                // sorting            
                grdAllocation.BeginDataUpdate();
                grdAllocation.SortInfo.Clear();
                grdAllocation.SortInfo.Add(new GridSortInfo("Customer.Name"));
                grdAllocation.EndDataUpdate();

                if (animationManager.Animation != null && animationManager.Animation.Status != null)
                {
                    ChangeDataEntryLocking(animationManager.Animation.Status.Value);
                }
            }

        }