/// <summary> /// Initializes a new instance of the <see cref="ProductVM"/> class from the model. /// </summary> /// <param name="entity">The model.</param> /// <param name="access"></param> /// <param name="dataService"></param> public DefectionVM(Defection entity, AccessType access, DefectionDataService dataService) : base(access) { InitializeData(dataService); _model = entity; }
/// <summary> /// Initializes a new instance of the <see cref="DefectionInfoVM"/> class from the model. /// </summary> /// <param name="entity">The model.</param> public DefectionInfoVM(Defection entity) { _model = entity; }
public override void Save(object param) { DefectionDataService.AttachModel(_model); _model = DefectionDataService.GetSingle(_model.Id); OnPropertyChanged("ModifiedBy");OnPropertyChanged("ModifiedDate");Mode = ModificationStatus.Saved; }
private void FixupDefection(Defection previousValue) { if (previousValue != null && previousValue.ProductDefections.Contains(this)) { previousValue.ProductDefections.Remove(this); } if (Defection != null) { if (!Defection.ProductDefections.Contains(this)) { Defection.ProductDefections.Add(this); } } }