Exemplo n.º 1
0
     private void FixupActivity(Activity previousValue)
     {
         if (previousValue != null && previousValue.Costs.Contains(this))
         {
             previousValue.Costs.Remove(this);
         }
 
         if (Activity != null)
         {
             if (!Activity.Costs.Contains(this))
             {
                 Activity.Costs.Add(this);
             }
         }
     }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ActivityVM"/> class from the model.
 /// </summary>
 /// <param name="entity">The model.</param>
 /// <param name="groupVms">The group view models.</param>
 /// <param name="access"></param>
 /// <param name="dataService"></param>
 /// <param name="groupDataService"></param>
 public ActivityVM(Activity entity, ListCollectionView groupVms, AccessType access, ActivityDataService dataService, ActivityGroupDataService groupDataService)
     : base(access)
 {
     InitializeData(dataService, groupDataService);
     _model = entity;
     Groups = groupVms;
     foreach (ActivityGroupVM groupVm in Groups)
     {
         if (groupVm.Id == entity.ActivityGroup.Id)
         {
             SelectedGroupVM = groupVm;
             break;
         }
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ActivityVM"/> class.
 /// </summary>
 /// <param name="entity">The entity.</param>
 /// <param name="access"></param>
 /// <param name="dataService"></param>
 /// <param name="groupDataService"></param>
 public ActivityVM(Activity entity, AccessType access, ActivityDataService dataService, ActivityGroupDataService groupDataService)
     : base(access)
 {
     InitializeData(dataService, groupDataService);
     _model = entity;
 }
Exemplo n.º 4
0
 public override void Save(object param)
 {
     ActivityDataService.AttachModel(_model,SelectedGroupVM.Id);
     _model = ActivityDataService.GetSingle(_model.Id); OnPropertyChanged("ModifiedBy");OnPropertyChanged("ModifiedDate");Mode = ModificationStatus.Saved;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ActivityInfoVM"/> class from the model.
 /// </summary>
 /// <param name="entity">The model.</param>
 public ActivityInfoVM(Activity entity)
 {
     _model = entity;
 }