예제 #1
0
        public void ScheduleUpdate(eScheduleUpdateKind Kind)
        {
            switch (Kind)
            {
            case eScheduleUpdateKind.RefreshMatrix:
                Matrix.Solution = VC2WinFmApp.DataRule.Solution;
                BindMatrixCellEvent();
                break;

            case eScheduleUpdateKind.RefreshAct:
                DtMatrix <IList <EnLsnAct> > mtx
                    = VC2WinFmApp.Engine.GetTchMatrix(this.teacher);

                foreach (VcTime time in mtx.eachTime())
                {
                    Matrix[time].Acts = mtx[time];
                }

                break;

            case eScheduleUpdateKind.RefreshRule:
                foreach (TchScheduleCell cell in Matrix.eachCell())
                {
                    cell.Rule = eRule.common;
                }


                DtMatrix <Boolean> SlnMatrix
                    = new DtMatrix <bool>(VC2WinFmApp.DataRule.Solution);
                IList <VcRuleCell> rules = VC2WinFmApp.DataRule.Rule.GetRules(this.teacher);
                foreach (VcRuleCell rls in rules)
                {
                    if (SlnMatrix.TestTime(rls.Time))
                    {
                        Matrix[rls.Time].Rule = rls.Rule;
                    }
                }

                break;

            case eScheduleUpdateKind.Invalidate:
                if (!VC2WinFmApp.Engine.EntityIsEnabled(this.teacher))
                {
                    Close();
                }
                break;
            }
        }
예제 #2
0
        public void ScheduleUpdate(eScheduleUpdateKind Kind)
        {
            switch (Kind)
            {
            case eScheduleUpdateKind.RefreshMatrix:
                MatrixLast.Solution  = VC2WinFmApp.DataRule.Solution;
                MatrixFocus.Solution = VC2WinFmApp.DataRule.Solution;
                break;

            //特别的响应,即使RefreshRule也要更新课表,为处理调课完成后
            case eScheduleUpdateKind.RefreshAct:
                var mtxLast  = VC2WinFmApp.Engine.GetTchMatrix(this._LastTch);
                var mtxFocus = VC2WinFmApp.Engine.GetTchMatrix(this._FocusTch);

                foreach (VcTime time in mtxLast.eachTime())
                {
                    MatrixLast[time].Acts  = mtxLast[time];
                    MatrixFocus[time].Acts = mtxFocus[time];
                }
                break;

            case eScheduleUpdateKind.RefreshRule:
                foreach (TchScheduleCell cell in MatrixLast.eachCell())
                {
                    cell.Rule = eRule.common;
                }
                foreach (TchScheduleCell cell in MatrixFocus.eachCell())
                {
                    cell.Rule = eRule.common;
                }


                var SlnMatrix = new DtMatrix <bool>(VC2WinFmApp.DataRule.Solution);
                var ruleS     = VC2WinFmApp.DataRule.Rule.GetRules(this._LastTch);
                var ruleT     = VC2WinFmApp.DataRule.Rule.GetRules(this._FocusTch);
                foreach (var rls in ruleS)
                {
                    if (SlnMatrix.TestTime(rls.Time))
                    {
                        MatrixLast[rls.Time].Rule = rls.Rule;
                    }
                }
                foreach (var rls in ruleT)
                {
                    if (SlnMatrix.TestTime(rls.Time))
                    {
                        MatrixFocus[rls.Time].Rule = rls.Rule;
                    }
                }

                break;

            case eScheduleUpdateKind.Invalidate:
                if (_LastTch != null && !VC2WinFmApp.Engine.EntityIsEnabled(_LastTch))
                {
                    LastTch = null;
                }
                if (_FocusTch != null && !VC2WinFmApp.Engine.EntityIsEnabled(_FocusTch))
                {
                    FocusTch = null;
                }

                break;
            }
        }