Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StationVM"/> class from the model.
        /// </summary>
        /// <param name="entity">The model.</param>
        /// <param name="access"></param>
        /// <param name="presentationType"></param>
        public StationMachineVM(StationMachine entity, AccessType access, StationMachineDataService dataService, RelationDirection presentationType)
            : base(access,presentationType)
        {
            InitializeData(dataService);
            _model = entity;
            StationId = entity.Station.Id;
            MachineId = entity.Machine.Id;
			//Status = entity.RecordStatus;
            StationName = entity.Station.Name;
            StationCode = entity.Station.Code;
            MachineName = entity.Machine.Name;
            MachineCode = entity.Machine.Code;
        }
Beispiel #2
0
     private void FixupStationMachine(StationMachine previousValue)
     {
         if (previousValue != null && previousValue.PMs.Contains(this))
         {
             previousValue.PMs.Remove(this);
         }
 
         if (StationMachine != null)
         {
             if (!StationMachine.PMs.Contains(this))
             {
                 StationMachine.PMs.Add(this);
             }
         }
     }