Exemplo n.º 1
0
        private CExam create1EntByDtAndRowIndex(DataTable dtRet, int i)
        {
            CExam ret = new CExam();

            ret.ExamId   = Int32.Parse(dtRet.Rows[i][FIELD_EXAM_ID].ToString());
            ret.ExamName = dtRet.Rows[i][FIELD_EXAM_NAME].ToString();
            return(ret);
        }
Exemplo n.º 2
0
        public void Notify(CExam exam)
        {
            string msg = string.Empty;

            if (exam.Passed)
            {
                msg = "¿¼ÊԺϸñ";
            }
            else
            {
                msg = exam.Message.Message;
            }

            if (this.btnXStart.InvokeRequired)
            {
                NotifyDelegateBool doNotify = new NotifyDelegateBool(DoSetBtnEnable);
                this.btnXStart.Invoke(doNotify, false);
            }
            else
            {
                DoSetBtnEnable(false);
            }

            if (exam.Passed)
            {
                if (changeState != null)
                {
                    changeState(this, new StateChangeEventArgs(CtrlPanelState.Pass, msg));
                }
            }
            else
            {
                if (changeState != null)
                {
                    changeState(this, new StateChangeEventArgs(CtrlPanelState.Fail, msg));
                }
            }

            if (this.btnXStart.InvokeRequired)
            {
                NotifyDelegate doNotify = new NotifyDelegate(DoNotify);
                this.btnXStart.Invoke(doNotify, "¿ªÊ¼¿¼ÊÔ");
            }
            else
            {
                DoNotify("¿ªÊ¼¿¼ÊÔ");
            }

            if (this.btnXStart.InvokeRequired)
            {
                NotifyDelegateBool doNotify = new NotifyDelegateBool(DoSetBtnEnable);
                this.btnXStart.Invoke(doNotify, true);
            }
            else
            {
                DoSetBtnEnable(true);
            }
        }
Exemplo n.º 3
0
        public override void Notify(CExam exam)
        {
            if (!exam.Passed)
            {
                //若要改变出错时模型车位置,请调整此处代码。
                //可再为每种ResultType添加switch(exam.Message.Index),
                //以细化针对不同杆线错误时,模型车的位置
                switch (exam.Message.TypeOfResult)
                {
                case ResultType.Gan:
                    che.SetWeizhi(gan[exam.Message.Index].X, gan[exam.Message.Index].Y);
                    break;

                case ResultType.Xian:
                    switch (exam.Message.Index)
                    {
                    case 0:
                    case 1:
                    case 2:
                        che.SetWeizhi(xian[exam.Message.Index].X1, che.Y);
                        break;

                    case 4:
                    case 5:
                        che.SetWeizhi(che.X, xian[exam.Message.Index].Y1);
                        break;

                    case 3:
                        break;
                    }
                    break;

                case ResultType.ZT:
                    che.SetWeizhi(che.X, che.Y);
                    break;

                case ResultType.XH:
                    che.SetWeizhi(che.X, che.Y);
                    break;

                case ResultType.LXC:
                    che.SetWeizhi(che.X, che.Y);
                    break;

                case ResultType.YKBR:
                    che.SetWeizhi(xian[1].X1 - 10, che.Y);
                    break;

                case ResultType.TimeOut:
                    che.SetWeizhi(che.X, che.Y);
                    break;

                default:
                    break;
                }
            }
        }
Exemplo n.º 4
0
 public MainController()
 {
     this.chapter   = new CChapters();
     this.detail    = new CDetailedOutline();
     this.course    = new CCourseGoals();
     this.subject   = new CSubject();
     this.exam      = new CExam();
     this.ppgd      = new CPPGD();
     this.selfstudy = new CSelfStudy();
     this.standards = new CProgramOutStandards();
 }
Exemplo n.º 5
0
        private void btn_delete_Click(object sender, EventArgs e)
        {
            CExam cExam  = new CExam();
            var   result = MessageBox.Show("Chắc chắn xóa?", "Thông báo", MessageBoxButtons.OKCancel);

            if (result == DialogResult.OK)
            {
                cExam.Delete(subId, examId);
            }
            this.Dispose();
            UCExams uCExams = new UCExams(pnl_contain, subId, isAdmin);

            cMain.loadUC(pnl_contain, uCExams);
        }
Exemplo n.º 6
0
        public override void Notify(CExam exam)
        {
            if (!exam.Passed)
            {
                //若要改变出错时模型车位置,请调整此处代码。
                //可再为每种ResultType添加switch(exam.Message.Index),
                //以细化针对不同杆线错误时,模型车的位置
                switch (exam.Message.TypeOfResult)
                {
                case ResultType.Gan:
                    che.SetWeizhi(gan[exam.Message.Index].X, gan[exam.Message.Index].Y);
                    break;

                case ResultType.Xian:
                    switch (exam.Message.Index)
                    {
                    case 0:
                    case 2:
                        che.SetWeizhi(xian[exam.Message.Index].X1, che.Y);
                        break;

                    case 1:
                    case 3:
                    case 4:
                        che.SetWeizhi(che.X, xian[exam.Message.Index].Y1);
                        break;
                    }
                    break;

                case ResultType.ZT:
                    che.SetWeizhi(che.X, che.Y);
                    break;

                case ResultType.XH:
                    che.SetWeizhi(che.X, che.Y);
                    break;

                case ResultType.LXC:
                    che.SetWeizhi(che.X, che.Y);
                    break;

                case ResultType.TimeOut:
                    che.SetWeizhi(che.X, che.Y);
                    break;

                default:
                    break;
                }
            }
            IMonData data = monitor.CurrData;
            CSignals g    = data.GetSignals(SignalType.GAN);

            for (int i = 0; i < g.Length; i++)
            {
                gan[i].Stat = g[i];
            }

            CSignals x = data.GetSignals(SignalType.XIAN);

            for (int i = 0; i < x.Length; i++)
            {
                xian[i].Stat = x[i];
            }

            if (this.picBoxModelBackGround.InvokeRequired)
            {
                NotifyDelegate doNotify = new NotifyDelegate(DoNotify);
                this.picBoxModelBackGround.Invoke(doNotify);
            }
            else
            {
                DoNotify();
            }
        }
Exemplo n.º 7
0
 abstract public void Notify(CExam exam);
Exemplo n.º 8
0
 //实现接口要求的方法
 //重写本方法可赋予考试结果产生时的语音
 virtual public void Notify(CExam exam)
 {
 }
Exemplo n.º 9
0
 public void Notify(CExam exam)
 {
     //throw new Exception("The method or operation is not implemented.");
 }