Пример #1
0
 public NameCallingMangementBussiness(BlockClassManagement block, RegularClassManagement regular, TraineeInfo trainee, TraineeManagementBussiness trainees)
 {
     RegularTrainee = new RegularTraineeBussiness(trainee);
     BlockTrainee   = new BlockTraineeBussiness(trainee);
     NameCalling    = new NameCallingBussiness();
     ClassSelecter  = new ClassSelecterBussiness(regular, block, RegularTrainee, BlockTrainee);
     EditCalling    = new EditNameCallingBussiness(NameCalling, block, regular,
                                                   new ClassSelecterBussiness(regular, block, new RegularTraineeBussiness(trainee), new BlockTraineeBussiness(trainee)),
                                                   trainees);
 }
Пример #2
0
        public PDFExporterCallingList(TraineeInfo traineeDAL) : base()
        {
            TotalCols = 13;
            if (!Directory.Exists(GlobalVariables.CallingListPDFExportPath))
            {
                Directory.CreateDirectory(GlobalVariables.CallingListPDFExportPath);
            }

            regular        = new RegularClassManagement();
            block          = new BlockClassManagement();
            regularTrainee = new RegularTraineeBussiness(traineeDAL);
            blockTrainee   = new BlockTraineeBussiness(traineeDAL);
        }
        public ClassSelecterBussiness(RegularClassManagement regular, BlockClassManagement block,
                                      RegularTraineeBussiness regularTrainees, BlockTraineeBussiness blockTrainees, bool isUsedForPayment = false)
        {
            _regular          = regular;
            _regularTrainees  = regularTrainees;
            _block            = block;
            _blockTrainees    = blockTrainees;
            CurrentClassType  = -1;
            _isUsedForPayment = isUsedForPayment;

            _regularTrainees.LoadTraineesEvent += trainees => TraineeCollectionChangedEvent?.Invoke(trainees);
            _blockTrainees.LoadTraineesEvnet   += trainees => TraineeCollectionChangedEvent?.Invoke(trainees);
        }
 public PresenceBussiness(TraineeManagementBussiness trainees, RegularClassManagement regular,
                          RegularTraineeBussiness regularTrainees, OverdueManagementBussiness overdue, NameCallingBussiness calling)
 {
     _regular         = regular;
     _trainees        = trainees;
     _overdue         = overdue;
     _calling         = calling;
     _regularTrainees = regularTrainees;
     _regular.RegularClassChangedEvent  += (op, model, index) => RegularClassChangedEvent?.Invoke();
     _regularTrainees.LoadTraineesEvent += traineeCollection =>
     {
         _currentTrainees = traineeCollection;
         TraineeChangedEvent?.Invoke(_currentTrainees);
     };
 }
Пример #5
0
        public RegularTraineeListViewModel(RegularTraineeBussiness bussiness) : base()
        {
            _bussiness = bussiness;
            _bussiness.LoadTraineesEvent += trainees =>
            {
                Trainees.Clear();
                if (trainees != null)
                {
                    trainees.ForEach(t =>
                    {
                        Trainees.Add(new TraineeViewModel(t, true));
                        Trainees.Last().OperateTraineeEvent += OnOperateTrainee;
                    });
                }
            };
            _bussiness.TraineeChangedEvent += (operation, trainee, newIndex) =>
            {
                switch (operation)
                {
                case OperationType.Add:
                    Trainees.Add(new TraineeViewModel(trainee, true));
                    Trainees.Last().OperateTraineeEvent += OnOperateTrainee;
                    break;

                case OperationType.Update:
                    if (newIndex == -1)
                    {    //只是更新信息
                        Trainees.Where(t => t.TraineeID == trainee.TraineeIDForShown).First().TraineeName = trainee.TraineeName;
                    }
                    else
                    {    //删除或者恢复
                        Trainees.Remove(Trainees.Where(t => t.TraineeID == trainee.TraineeIDForShown).First());
                        Trainees.Insert(newIndex, new TraineeViewModel(trainee, true));
                        Trainees[newIndex].OperateTraineeEvent += OnOperateTrainee;
                    }
                    break;

                case OperationType.Delete:
                    Trainees.Remove(Trainees.Where(t => t.TraineeID == trainee.TraineeIDForShown).First());
                    break;
                }
            };
        }
Пример #6
0
 public TraineeStatisticBussiness(TraineeManagementBussiness trainees, RegularClassManagement regular,
                                  RegularTraineeBussiness regularTrainees, OverdueManagementBussiness overdue, NameCallingBussiness calling)
 {
     Presence = new PresenceBussiness(trainees, regular, regularTrainees, overdue, calling);
 }