Esempio n. 1
0
        public BlockTeachingBussiness(BlockClassManagement blockClasses, TraineeManagementBussiness traineeManagement)
        {
            BlockClasses        = blockClasses;
            BlockClassOperation = new BlockClassOperationBussiness(blockClasses);
            BlockClasses.ChangeBlockClassEvent += (operation, model) =>
            {
                if (operation == Common.OperationType.Select)
                {
                    BlockTrainee.GetTrainees(model.ClassID);
                }
                else
                {
                    BlockClassOperation.Enable(operation, model);
                }
            };

            TraineeManagement = traineeManagement;
            BlockTrainee      = new BlockTraineeBussiness(TraineeManagement.Dal);

            BlockTrainee.TraineeChangedEvent += (opreation, trainee, newIndex) =>
            {
                if (opreation == Common.OperationType.Add && trainee.IsNew)
                {
                    TraineeManagement.AddTrainee(trainee);
                }
                else if (opreation == Common.OperationType.Update)
                {
                    TraineeManagement.UpdateTrainee(trainee);
                }
                TraineeCountChanged?.Invoke(null, EventArgs.Empty);
            };
        }
        public RegularTeachingBussiness(RegularClassManagement regularClass, TraineeManagementBussiness traineeManagement)
        {
            RegularClasses        = regularClass;
            RegularClassOperation = new RegularClassOperationBussiness(regularClass);
            RegularClasses.ChangeRegularClassEvent += (operation, model) =>
            {
                if (operation == Common.OperationType.Select)
                {
                    RegularTrainee.GetTrainees(model.ClassID);
                }
                else
                {
                    RegularClassOperation.Enable(operation, model);
                }
            };

            TraineeManagement = traineeManagement;
            RegularTrainee    = new RegularTraineeBussiness(TraineeManagement.Dal);
            RegularTrainee.TraineeChangedEvent += (opreation, trainee, newIndex) =>
            {
                if (opreation == Common.OperationType.Add && trainee.IsNew)
                {
                    TraineeManagement.AddTrainee(trainee);
                }
                else if (opreation == Common.OperationType.Update || opreation == Common.OperationType.Delete)
                {
                    TraineeManagement.UpdateTrainee(trainee);
                }
                TraineeCountChanged?.Invoke(null, EventArgs.Empty);
            };
        }
Esempio n. 3
0
        public MainWindowBussiness(string userID)
        {
            RegularClassManagement     regular = new RegularClassManagement();
            BlockClassManagement       block   = new BlockClassManagement();
            TraineeManagementBussiness trainee = new TraineeManagementBussiness();

            Teaching    = new TeachingManagementBussiness(regular, trainee, block);
            Calling     = new NameCallingMangementBussiness(block, regular, trainee.Dal, trainee);
            Payment     = new PaymentManagementBussiness(block, regular, trainee.Dal, Calling.NameCalling);
            Overdue     = new OverdueManagementBussiness(block, regular);
            Statistic   = new StatisticManagementBussiness(Payment.PaymentDAL, trainee, block, regular, Calling.NameCalling, trainee.Dal, Overdue);
            UserSetting = new UserSettingManagementBussiness(userID);

            //新增常规班缴费时,如果剩余课时回正,删除催费信息
            //新增独舞课缴费时,删除对应的催费信息
            //添加点名信息时,出勤/旷课会扣减剩余课时,如果剩余课时<=0,增加催费信息
            //删除点名信息,原来记录为出勤/旷课的学员会剩余课时+1,如果剩余课时>0,删除催费信息
            //在独舞班添加学员时,增加催费记录
            //在学员常规班发生变化时,如果存在常规班变化,更新催费记录中的金额和班级
            //在常规班级信息发生改变时,如果学费发生了变化,更新催费记录中所有该班级的未交费信息的金额
            //如果学员删除,会同时删除该学员当前的所有催费提醒
            //如果学员恢复,会根据常规剩余课数和独舞课的缴费情况,重新激活催费提醒
            Payment.ClassPayment.ClassFee.OverdueChangedEvent   += Overdue.Refresh;
            Calling.NameCalling.OverdueChangedEvent             += Overdue.Refresh;
            Teaching.Block.BlockTrainee.OverdueChangedEvent     += Overdue.Refresh;
            Teaching.Regular.RegularTrainee.OverdueChangedEvent += Overdue.Refresh;
            Teaching.Regular.RegularClasses.OverdueChangedEvent += Overdue.Refresh;

            Teaching.TraineeCountChanged += (sender, args) => Statistic.General.RefreshTraineeCount();

            Payment.ClassPayment.CapitalChanged     += (sender, args) => Statistic.General.RefreshCurrentCapital();
            Payment.NormalPayment.CapitalChanged    += (sender, args) => Statistic.General.RefreshCurrentCapital();
            Statistic.Finance.GeneralCapitalChanged += (sender, args) => Statistic.General.RefreshCurrentCapital();
        }
 public GeneralAndExportBussiness(TraineeInfo traineeDal, GeneralInfo generalDal, BlockClassManagement blocks,
                                  RegularClassManagement regulars, TraineeManagementBussiness trainees)
 {
     _traineeDal   = traineeDal;
     _generalDal   = generalDal;
     _billExporter = new PDFExporterBill(blocks, regulars, trainees);
     _dbRelated    = new DBExporterGeneral();
 }
 public EditNameCallingBussiness(NameCallingBussiness calling, BlockClassManagement block, RegularClassManagement regular, ClassSelecterBussiness classSelecter,
                                 TraineeManagementBussiness trainees)
 {
     Calling       = calling;
     ClassSelecter = classSelecter;
     _block        = block;
     _regular      = regular;
     _trainees     = trainees;
 }
Esempio n. 6
0
 public StatisticManagementBussiness(PaymentInfo paymentDal, TraineeManagementBussiness trainees, BlockClassManagement blocks, RegularClassManagement regulars,
                                     NameCallingBussiness calling, TraineeInfo trainee, OverdueManagementBussiness overdue)
 {
     GeneralDal = new GeneralInfo();
     Finance    = new FinanceStatisticBussiness(paymentDal, trainees, blocks, regulars, GeneralDal);
     Teacher    = new TeachingStatisticBussiness(calling, regulars, blocks);
     Trainee    = new TraineeStatisticBussiness(trainees, regulars, new RegularTraineeBussiness(trainee), overdue, calling);
     General    = new GeneralAndExportBussiness(trainees.Dal, GeneralDal, blocks, regulars, trainees);
 }
 public TraineeOperationViewModel(TraineeManagementBussiness trainees)
 {
     TraineeCollection      = trainees;
     ClassCollection        = new ObservableCollection <string>();
     PopupTraineeCollection = new ObservableCollection <FuzzyTraineeViewModel>();
     Vis = Visibility.Hidden;
     Msg = new MessageViewModel(false);
     Msg.OnOperateEnableEvent(false, false);
 }
        public TeachingManagementBussiness(RegularClassManagement regular, TraineeManagementBussiness traineeManagement, BlockClassManagement block)
        {
            Regular = new RegularTeachingBussiness(regular, traineeManagement);
            Block   = new BlockTeachingBussiness(block, traineeManagement);
            Others  = new OthersBussiness(traineeManagement.Dal);

            Regular.TraineeCountChanged += (sender, args) => TraineeCountChanged?.Invoke(sender, args);
            Block.TraineeCountChanged   += (sender, args) => TraineeCountChanged?.Invoke(sender, args);
        }
 public FinanceStatisticBussiness(PaymentInfo paymentDal, TraineeManagementBussiness trainees, BlockClassManagement blocks, RegularClassManagement regulars,
                                  GeneralInfo generalDal)
 {
     _paymentDal           = paymentDal;
     _trainees             = trainees;
     _blockClasses         = blocks;
     _regularClasses       = regulars;
     _generalDal           = generalDal;
     _normalStatisticGroup = new List <FinanceStatisticGroup <AccountInfoModel> >();
 }
Esempio n. 10
0
 public PDFExporterBill(BlockClassManagement blocks, RegularClassManagement regulars, TraineeManagementBussiness trainees) : base()
 {
     TotalCols = 17;
     if (!Directory.Exists(GlobalVariables.BillExportPath))
     {
         Directory.CreateDirectory(GlobalVariables.BillExportPath);
     }
     _paymentDal = new PaymentInfo();
     _generalDal = new GeneralInfo();
     _blocks     = blocks;
     _regulars   = regulars;
     _trainees   = 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);
     };
 }
        public BlockTraineeOperationViewModel(TraineeManagementBussiness trainees, TraineeOperationBussiness traineeOperation,
                                              BlockClassManagement blockClasses)
            : base(trainees)
        {
            _traineeOperation = traineeOperation;
            _traineeOperation.OperationEnableEvent += Enable;

            _blockClasses = blockClasses;
            _blockClasses.BlockClassCollection.ForEach(c => ClassCollection.Add(c.ClassName));
            _blockClasses.BlockClassChangedEvent += (operation, regularClass, newIndex) =>
            {
                ClassCollection.Clear();
                _blockClasses.BlockClassCollection.ForEach(c => ClassCollection.Add(c.ClassName));
            };

            ClassComboWidth = 200;
            VisRemain       = Visibility.Hidden;
        }
Esempio n. 13
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);
 }
Esempio n. 14
0
 public TraineeStatisticBussiness(TraineeManagementBussiness trainees, RegularClassManagement regular,
                                  RegularTraineeBussiness regularTrainees, OverdueManagementBussiness overdue, NameCallingBussiness calling)
 {
     Presence = new PresenceBussiness(trainees, regular, regularTrainees, overdue, calling);
 }