예제 #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();
            }
        }
 public ProductPartTypeWindowViewModel(ChildWindow aChildWindow, ProductPartTypeEntity aProductPartTypeEntity)
 {
     childWindow           = aChildWindow;
     ProductPartTypeEntity = aProductPartTypeEntity;
     OnOK     = new DelegateCommand(OnOKCommand);
     OnCancel = new DelegateCommand(OnCancelCommand);
 }
        private void OnAddCommand()
        {
            AddProductPartTypeEntity = new ProductPartTypeEntity();
            AddProductPartTypeEntity.ProductPartType = new ProductManager.Web.Model.product_part_type();
            ProductPartTypeWindow productPartTypeWindow = new ProductPartTypeWindow(AddProductPartTypeEntity);

            productPartTypeWindow.Closed += productPartTypeWindow_Closed;
            productPartTypeWindow.Show();
        }
        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;
        }
예제 #6
0
 public ProductPartTypeWindow(ProductPartTypeEntity aProductPartTypeEntity)
 {
     InitializeComponent();
     this.DataContext = new ProductPartTypeWindowViewModel(this, aProductPartTypeEntity);
 }