예제 #1
0
 /// <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;
 }
예제 #2
0
 /// <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;
 }
예제 #3
0
 public override void Save(object param)
 {
     DefectionDataService.AttachModel(_model);
     _model = DefectionDataService.GetSingle(_model.Id); OnPropertyChanged("ModifiedBy");OnPropertyChanged("ModifiedDate");Mode = ModificationStatus.Saved;
 }
예제 #4
0
     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);
             }
         }
     }