Exemple #1
0
        public void Load(IEnumerable <SalesUnit> units, SpecificationWrapper specificationWrapper, IUnitOfWork unitOfWork, bool isNew)
        {
            Load(units, unitOfWork, isNew);
            _specificationWrapper = specificationWrapper;
            //назначаем спецификацию всем юнитам
            var specificationSimpleWrapper = new SpecificationSimpleWrapper(_specificationWrapper.Model);

            Groups.ForEach(x => x.Specification = specificationSimpleWrapper);
            _groupsToReject = new ValidatableChangeTrackingCollection <ProjectUnitsGroup>(Groups);
        }
        /// <summary>
        /// 기존의 InOutStock 데이터를 수정할 때 쓰이는 생성자입니다.
        /// </summary>
        /// <param name="viewModel"></param>
        /// <param name="ioStockWrapper"></param>
        public StockWrapperEditorViewModel(StockWrapperViewModel viewModel, StockWrapper ioStockWrapper) : base(ioStockWrapper)
        {
            if (ioStockWrapper == null)
                throw new ArgumentNullException();
            _target = ioStockWrapper;
            Initialize(viewModel);

            //수정할 데이터를 변경할 수 없도록 고정
            ItemList = new ItemWrapper[] { _target.Item };
            SpecificationList = new SpecificationWrapper[] { _target.Specification };
            WarehouseList = new Observable<Warehouse>[] { _target.Warehouse };

            Item = ItemList.First();
            Specification = SpecificationList.First();
            Warehouse = WarehouseList.First();
        }
        /// <summary>
        /// 기존의 Inventory 데이터를 수정하고자 할 생성자
        /// </summary>
        /// <param name="viewModel"></param>
        /// <param name="inventoryWrapper">수정하고자할 inventory 래핑 클래스</param>
        public InventoryWrapperEditorViewModel(InventoryWrapperViewModel viewModel, InventoryWrapper inventoryWrapper) : base(inventoryWrapper)
        {
            if (inventoryWrapper == null)
                throw new ArgumentNullException();

            _viewModel = viewModel;
            _target = inventoryWrapper;

            Specification = inventoryWrapper.Specification;
            Item = inventoryWrapper.Item;
            Warehouse = inventoryWrapper.Warehouse;

            ItemList = new ItemWrapper[] { Item };
            SpecificationList = new SpecificationWrapper[] { Specification };
            WarehouseList = FieldWrapperDirector.GetInstance().CreateCollection<Warehouse, Observable<Warehouse>>().Where(x => !x.IsDeleted);
        }