示例#1
0
        private void loadOperationProductPartType_Completed(object sender, EventArgs e)
        {
            ProductPartTypeEntityList.Clear();
            ProductPartTypeDictionary.Clear();
            LoadOperation loadOperation = sender as LoadOperation;

            foreach (ProductManager.Web.Model.product_part_type product_part_type in loadOperation.Entities)
            {
                ProductPartTypeEntity productPartTypeEntity = new ProductPartTypeEntity();
                productPartTypeEntity.ProductPartType = product_part_type;
                productPartTypeEntity.Update();
                ProductPartTypeEntityList.Add(productPartTypeEntity);
                ProductPartTypeDictionary.Add(productPartTypeEntity.ProductPartTypeID, productPartTypeEntity);
            }

            this.productPartTimeSource = new EntityList <ProductManager.Web.Model.product_part_time>(this.ProductDomainContext.product_part_times);
            this.productPartTimeLoader = new DomainCollectionViewLoader <ProductManager.Web.Model.product_part_time>(
                this.LoadProductPartTimeEntities,
                this.LoadOperationProductPartTimeCompleted);
            this.productPartTimeView = new DomainCollectionView <ProductManager.Web.Model.product_part_time>(this.productPartTimeLoader, this.productPartTimeSource);
            using (this.CollectionProductPartTimeView.DeferRefresh())
            {
                this.productPartTimeView.MoveToFirstPage();
            }
        }
        void productPartTypeWindow_Closed(object sender, EventArgs e)
        {
            ProductPartTypeWindow productPartTypeWindow = sender as ProductPartTypeWindow;

            if (productPartTypeWindow.DialogResult == true)
            {
                ProductPartTypeEntityList.Add(AddProductPartTypeEntity);
                systemManageDomainContext.product_part_types.Add(AddProductPartTypeEntity.ProductPartType);
                OnSaveCommand();
            }
        }
        public void LoadData()
        {
            IsBusy = true;
            systemManageDomainContext = new SystemManageDomainContext();
            systemManageDomainContext.PropertyChanged -= systemManageDomainContext_PropertyChanged;
            systemManageDomainContext.PropertyChanged += systemManageDomainContext_PropertyChanged;
            ProductPartTypeEntityList.Clear();

            selectProductPartTypeEntity = null;
            LoadOperation <ProductManager.Web.Model.product_part_type> loadOperationProductPartType =
                systemManageDomainContext.Load <ProductManager.Web.Model.product_part_type>(systemManageDomainContext.GetProduct_part_typeQuery());

            loadOperationProductPartType.Completed += loadOperationFileType_Completed;
        }
        void loadOperationFileType_Completed(object sender, EventArgs e)
        {
            ProductPartTypeEntityList.Clear();
            LoadOperation loadOperation = sender as LoadOperation;

            foreach (ProductManager.Web.Model.product_part_type product_part_type in loadOperation.Entities)
            {
                ProductPartTypeEntity productPartTypeEntity = new ProductPartTypeEntity();
                productPartTypeEntity.ProductPartType = product_part_type;
                productPartTypeEntity.Update();
                ProductPartTypeEntityList.Add(productPartTypeEntity);
            }
            UpdateChanged("FileTypeEntityList");
            IsBusy = false;
        }