private void button1_Click(object sender, EventArgs e) { string learncar = this.cbLearnCar.Text.Trim().ToUpper(); if (learncar.Length == 0) { MessageBoxHelper.Show("对不起,必须输入申请的驾照型号!"); return; } ArrayList list = SimpleOrmOperator.QueryConditionList <ExamUser>(" where c_idcard='" + DALSecurityTool.TransferInsertField(this.txtIdCard.Text.Trim()) + "'"); if (list == null || list.Count == 0) { MessageBoxHelper.Show("对不起,不存在该学员,请咨询管理员!"); return; } else { ExamUser user = list[0] as ExamUser; ExamPolicy policy = StaticCacheManager.GetConfig <ExamPolicy>(); if (this.checkExam.Checked && policy.IsLimit && user.PassCount >= policy.SuccessTimes) { MessageBoxHelper.Show("对不起,您已经合格了" + user.PassCount.ToString() + "次,无法再次进行考试!"); return; } // 判断是否考试合格次数超过了配置的考试合格次数限制 ArrayList topics = this.GetRandomTopic(learncar); //this.Hide(); ExamWorkStation form = new ExamWorkStation(topics, user, this.checkTrain.Checked); form.ShowDialog(); } }
public ExamWorkStation(ArrayList topics, ExamUser user, bool isTrain) : this(user, isTrain) { this.topics = topics; if(this.topics!=null&&this.topics.Count>0) { for (int i = 0; i < topics.Count;i++ ) { this.BuildATopicControl(topics[i] as ExamTopic); } this.ActiveTopic(0); } if(this.groupBox3.Controls.Count==0) { this.lbAnswerA.Text = string.Empty; this.lbAnswerB.Text = string.Empty; this.lbAnswerC.Text = string.Empty; this.lbAnswerD.Text = string.Empty; this.lbTopic.Text = string.Empty; this.btnA.Visible = false; this.btnB.Visible = false; this.btnC.Visible = false; this.btnD.Visible = false; this.btnY.Visible = true; this.btnN.Visible = true; } }
public ExamWorkStation(ArrayList topics, ExamUser user, bool isTrain) : this(user, isTrain) { this.topics = topics; if (this.topics != null && this.topics.Count > 0) { for (int i = 0; i < topics.Count; i++) { this.BuildATopicControl(topics[i] as ExamTopic); } this.ActiveTopic(0); } if (this.groupBox3.Controls.Count == 0) { this.lbAnswerA.Text = string.Empty; this.lbAnswerB.Text = string.Empty; this.lbAnswerC.Text = string.Empty; this.lbAnswerD.Text = string.Empty; this.lbTopic.Text = string.Empty; this.btnA.Visible = false; this.btnB.Visible = false; this.btnC.Visible = false; this.btnD.Visible = false; this.btnY.Visible = true; this.btnN.Visible = true; } }
public ExamWorkStation(ExamUser user, bool isTrain) : this() { this.user = user; if(user!=null) { this.lbWelcome.Text = "��ӭ�������֤������Ϊ" + user.IdCard + "��" + user.Name + "�����Ŀ��Դ���Ϊ" + user.AllCount.ToString() + "�ϸ����Ϊ" + user.PassCount.ToString() + "���ϸ����Ϊ" + user.NotPassCount.ToString(); } this.isTrain = isTrain; }
public ExamWorkStation(ExamUser user, bool isTrain) : this() { this.user = user; if (user != null) { this.lbWelcome.Text = "欢迎您,身份证明号码为" + user.IdCard + "的" + user.Name + ",您的考试次数为" + user.AllCount.ToString() + "合格次数为" + user.PassCount.ToString() + "不合格次数为" + user.NotPassCount.ToString(); } this.isTrain = isTrain; }