Example #1
0
 //让Engine数据改变时能更新对应的界面
 public void OnScheduleUpdate(eScheduleUpdateKind Kind)
 {
     foreach (Form fm in this.MdiChildren)
     {
         (fm as IScheduleFm).ScheduleUpdate(Kind);
     }
 }
Example #2
0
 private void SendScheduleUpdate(eScheduleUpdateKind Kind)
 {
     if (ScheduleUpdate != null)
     {
         ScheduleUpdate(Kind);
     }
 }
        public void ScheduleUpdate(eScheduleUpdateKind Kind)
        {
            switch (Kind)
            {
            case eScheduleUpdateKind.RefreshMatrix:
                RefreshMatrix();
                break;

            case eScheduleUpdateKind.RefreshAct:
                RefreshAct();
                RefreshRule();
                break;

            case eScheduleUpdateKind.RefreshRule:
                RefreshRule();
                break;

            case eScheduleUpdateKind.Invalidate:
                if (!VC2WinFmApp.Engine.EntityIsEnabled(this.squad))
                {
                    Close();
                }
                break;
            }
        }
Example #4
0
 /// <summary>
 /// 课表需要更新(课表、课和各节课的规则)
 /// </summary>
 public void OnScheduleUpdate(eScheduleUpdateKind Kind)
 {
     VC2WinFmApp.MainFm.OnScheduleUpdate(Kind);
     if (VC2WinFmApp.TopFm != null && !VC2WinFmApp.TopFm.IsDisposed)
     {
         VC2WinFmApp.TopFm.ScheduleUpdate(Kind);
     }
 }
        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;
            }
        }
Example #6
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;
            }
        }