public void stopRoll5(Student.selectedType st) { timer1.Enabled = false; if (get_Selected_counts(st) == stdSelected.Count) { stdSelected[0] = new Student(); stdSelected[0].Id = "000000"; stdSelected[0].Name = "NULL"; stdSelected[0].Classroom = new Classroom("0000"); stdSelected[0].Classroom.ClassID = "0000"; Assistance.record("ERROR NO MORE STUDENTS"); MessageBox.Show("没有更多的学生了"); return; } else { DisplayStudentData(Hitter); switch (st) { case Student.selectedType.Mutiply: Hitter.Selected_Mutiply = true; break; case Student.selectedType.Report: Hitter.Selected_Report = true; break; default: break; } stdReady.Remove(Hitter); maxnum--; } Assistance.record(Hitter, "form roll5,selectTpye=" + st.ToString()); }
public roll5(MainForm obj1, int nums, Student.selectedType st) { InitializeComponent(); mainForm = obj1; rollnum = nums; selectType = st; timer1.Tick += new EventHandler(timer1_Tick); timer1.Interval = 3000; timer1.Enabled = true; timer2.Tick += new EventHandler(timer2_Tick); timer2.Interval = mainForm.timer1.Interval; Assistance.record("roll5 start selectType=" + st.ToString() + " " + "selectNum=" + rollnum.ToString()); }
public int get_Selected_counts(Student.selectedType st) { int count = 0; switch (st) { case Student.selectedType.Mutiply: foreach (Student astd in stdSelected) { if (astd.Selected_Mutiply == true) { count++; } } break; case Student.selectedType.Single: foreach (Student astd in stdSelected) { if (astd.Selected_Single == true) { count++; } } break; case Student.selectedType.Report: foreach (Student astd in stdSelected) { if (astd.Selected_Report == true) { count++; } } break; default: break; } return(count); }
/// <summary> /// 把没有抽到过的学生放到一个数组里面 /// </summary> public int GetStudentsReady(Student.selectedType st) { if (stdSelected.Count == 0) { selectStudents(); } stdReady.Clear(); foreach (Student astd in stdSelected) { switch (st) { case Student.selectedType.Mutiply: if (!astd.Selected_Mutiply) { stdReady.Add(astd); } break; case Student.selectedType.Single: if (!astd.Selected_Single) { stdReady.Add(astd); } break; case Student.selectedType.Report: if (!astd.Selected_Report) { stdReady.Add(astd); } break; } } maxnum = stdReady.Count; return(maxnum); }