Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MachineFamilyVM"/> class.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <param name="access"></param>
        /// <param name="dataService"></param>
        public MachineFamilyVM(MachineFamily entity, AccessType access, MachineFamilyDataService dataService)
            : base(access)
        {
            InitializeData(dataService);
            _model = entity;

            Machines = new ObservableCollection<Machine>();
            foreach (Machine product in entity.Machines)
            {
                Machines.Add(product);
            }
        }
Exemplo n.º 2
0
     private void FixupMachineFamily(MachineFamily previousValue)
     {
         if (previousValue != null && previousValue.Machines.Contains(this))
         {
             previousValue.Machines.Remove(this);
         }
 
         if (MachineFamily != null)
         {
             if (!MachineFamily.Machines.Contains(this))
             {
                 MachineFamily.Machines.Add(this);
             }
         }
     }
Exemplo n.º 3
0
 public override void Save(object param)
 {
     MachineFamilyDataService.AttachModel(_model);
     _model = MachineFamilyDataService.GetSingle(_model.Id); OnPropertyChanged("ModifiedBy");OnPropertyChanged("ModifiedDate");Mode = ModificationStatus.Saved;
 }