private void pictureBox2_Click(object sender, EventArgs e)
        {
            //TODO: 下课事件处理
            Form1.ShowController(false);
            Common.setLessonOff(0, "", "");

            this.WindowState = FormWindowState.Minimized;
            this.Dispose();
            this.Close();
        }
Beispiel #2
0
        private void timer_lessonOff_Tick(object sender, EventArgs e)
        {
            int    lessonid    = Global.getLessonID();
            string timenow     = DateTime.Now.ToString("HHmm");
            string timeoff     = Global.getTimeOff();
            string timeon      = Global.getTimeOn();
            int    lessonIndex = Global.getLessonIndex();

            if (lessonid == 0)
            {
                return;
            }
            //if(Global.isLessonOff())
            //    return;
            if (timenow.CompareTo(timeoff) > 0)//Global.getTeacherID() > 0 &&
            {
                //过了下课时间
                CourseTime ct = m_db.getCourseTime(lessonIndex + 1);
                if (ct != null)
                {
                    if (timenow.CompareTo(ct.timeOn) > 0)
                    {
                        //Log.Info("过了下节课的上课时间 " + ct.timeOn + ", teacherid" + Global.getTeacherID());
                    }
                    else
                    {
                        int minDiff = getTimediff(timenow, ct.timeOn);
                        if (minDiff < 5 && !Global.isLessonOff())
                        {
                            Common.setLessonOff(0, "", "");//自动下课
                            Log.Info("还没有到下节课的上课时间 " + ct.timeOn + ", teacherid" + Global.getTeacherID() + ", 执行下课");
                        }
                        else
                        {
                            Log.Info("还没有到下节课的上课时间 " + ct.timeOn + ", teacherid" + Global.getTeacherID());
                        }
                        //执行下课

                        //清空lesson信息

                        //是否需要自动取lesson信息
                    }
                }
            }
        }