private void FixupPartWarehouse(PartWarehouse previousValue) { if (previousValue != null && ReferenceEquals(previousValue.Cost, this)) { previousValue.Cost = null; } if (PartWarehouse != null) { PartWarehouse.Cost = this; } }
public override void Save(object param) { if (!IsReadOnly) OriginalQuantity = Quantity; PartWarehouseDataService.AttachModel(_model,SelectedGroupVM.Id); _model = PartWarehouseDataService.GetSingle(_model.Id); OnPropertyChanged("ModifiedBy"); OnPropertyChanged("ModifiedDate"); OnPropertyChanged("IsReadOnly"); OnPropertyChanged("UnitCost"); }
/// <summary> /// Initializes a new instance of the <see cref="PartWarehouseVM"/> class from the model. /// </summary> /// <param name="entity">The model.</param> /// <param name="groupItems">The group view models.</param> /// <param name="access"></param> /// <param name="dataService"></param> /// <param name="groupDataService"></param> /// <param name="costDataService"></param> public PartWarehouseVM(PartWarehouse entity, ListCollectionView groupItems, AccessType access, PartWarehouseDataService dataService, PartWarehouseGroupDataService groupDataService, CostDataService costDataService) : base(access) { InitializeData(dataService, groupDataService, costDataService); _model = entity; Groups = groupItems; foreach (PartWarehouseGroupVM groupVm in groupItems) { if (groupVm.Id == entity.PartWarehouseGroup.Id) { SelectedGroupVM = groupVm; break; } } }
/// <summary> /// Initializes a new instance of the <see cref="PartWarehouseVM"/> class. /// </summary> /// <param name="entity">The entity.</param> /// <param name="access"></param> /// <param name="dataService"></param> /// <param name="groupDataService"></param> /// <param name="costDataService"></param> public PartWarehouseVM(PartWarehouse entity, AccessType access, PartWarehouseDataService dataService, PartWarehouseGroupDataService groupDataService, CostDataService costDataService) : base(access) { _model = entity; InitializeData(dataService, groupDataService, costDataService); Groups = new ListCollectionView(new ObservableCollection<PartWarehouseGroupVM>()); }
/// <summary> /// Initializes a new instance of the <see cref="StationInfoVM"/> class from the model. /// </summary> /// <param name="entity">The model.</param> public PartWarehouseInfoVM(PartWarehouse entity) { _model = entity; }