Exemplo n.º 1
0
 public static void ChangeStudentState(Student s,ExamState e)
 {
     if (StudentCollection.ContainsKey(s))
     {
         StudentCollection[s] = e;
     }
     else
     {
         StudentCollection.Add(s, e);
     }
 }
Exemplo n.º 2
0
        string permissionUserName = ""; //当前登录的用户名,用来区分权限,若为空表示是管理员

        #endregion Fields

        #region Constructors

        public StudentEdit(Student stu)
        {
            InitializeComponent();
            currentStudent = stu;
            textID.Text = currentStudent.ID;
            textName.Text = currentStudent.sName;
            if (InfoControl.User.permission == 0)
                permissionUserName = InfoControl.User.UserName;
            showAllDepts();
            for (int i = 0; i < comboDept.Items.Count; i++)
                if (comboDept.Items[i].ToString() == currentStudent.dept)
                {
                    comboDept.SelectedIndex = i;
                    break;
                }
            for (int i = 0; i < comboClass.Items.Count; i++)
                if (comboClass.Items[i].ToString() == currentStudent.className)
                {
                    comboClass.SelectedIndex = i;
                    break;
                }
            labelInfo.Text = "当前要修改的学生为:" + currentStudent.ID + " " + currentStudent.sName;
        }
Exemplo n.º 3
0
        //数据库记录转为Student
        private List<Student> DataSetToListStudent(DataSet p_DataSet)
        {
            List<Student> result = new List<Student>();
            DataTable p_Data = p_DataSet.Tables[0];

            for (int j = 0; j < p_Data.Rows.Count; j++)
            {
                Student problem = new Student();
                for (int i = 0; i < p_Data.Columns.Count; i++)
                {
                    // 数据库NULL值单独处理
                    if (p_Data.Columns[i].ToString() == "StudentId")
                        problem.ID = p_Data.Rows[j][i].ToString();
                    if (p_Data.Columns[i].ToString() == "StudentName")
                        problem.sName = (string)p_Data.Rows[j][i];
                    if (p_Data.Columns[i].ToString() == "ClassId")
                        problem.classId = p_Data.Rows[j][i].ToString();
                    if (p_Data.Columns[i].ToString() == "Password")
                        problem.password = (string)p_Data.Rows[j][i];
                    if (p_Data.Columns[i].ToString() == "Dept")
                        problem.dept = (string)p_Data.Rows[j][i];
                    if (p_Data.Columns[i].ToString() == "ClassName")
                        problem.className = (string)p_Data.Rows[j][i];

                }

                result.Add(problem);
            }
            return result;
        }
Exemplo n.º 4
0
 bool ReconnectValidating(string name, string id, string pwd)
 {
     if (PaperControl.OesData.ValidateStudentInfo(id, name, pwd))
     {
         this.Student = PaperControl.OesData.FindStudentByStudentId(id)[0];//new Student(name, "", id, pwd);
         this.Student.ip = this.Client.ClientIp;
         return true;
     }
     return false;
 }
Exemplo n.º 5
0
 void client_LogoutSuccess()
 {
     this.State = 1;
     this.Student = new Student("", "", "", "");
 }
Exemplo n.º 6
0
        bool client_LoginValidating(string name, string id, string pwd)
        {
            if (File.Exists(PaperControl.PathConfig["StuAns"] + id+".rar")) return false;
            lock (Computer.syncComputerList)
            {
                foreach (Computer c in ComputerList)
                {
                    if (c.student.ID == id)
                    {
                        return false;
                    }
                }
            }
            if (PaperControl.OesData.ValidateStudentInfo(id, name, pwd))
            {
                int myPaperId=-1;
                bool needResume=false;

                lock (Computer.syncErrorList)
                {
                    foreach (Computer c in ErrorList)
                    {
                        if (c.Student.ID == id)
                        {
                            needResume = true;
                            ExamPaperPath = c.ExamPaperPath;
                            ExamPaperName = c.ExamPaperName;
                        }
                    }
                }
                if(!needResume)
                {
                    myPaperId=getCurrentPaper();
                    if (myPaperId == -1) return false;
                    ExamPaperPath = PaperControl.PathConfig["TmpPaper"] + OESMonitor.examPaperIdList[myPaperId].ToString() + ".rar";
                    ExamPaperName = OESMonitor.examPaperNameList[myPaperId];
                }

                this.Student = PaperControl.OesData.FindStudentByStudentId(id)[0];//new Student(name, "", id, pwd);
                this.Student.ip = this.Client.ClientIp;
                return true;
            }
            ExamPaperPath = "";
            return false;
        }
Exemplo n.º 7
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (studentInfoDGV.CurrentRow == null) return;
     int cr = studentInfoDGV.CurrentRow.Index;
     if (cr <= -1) { return; }
     changeBtnEnable(false);
     studentInfoDGV.Visible = false;
     studentInfoGroup.Text = "修改学生";
     Student st = new Student(dt.Rows[cr][1].ToString(), dt.Rows[cr][2].ToString(), dt.Rows[cr][3].ToString(),
         dt.Rows[cr][4].ToString(), dt.Rows[cr][5].ToString(), dt.Rows[cr][6].ToString());
     stuEdit = new StudentEdit(st);
     stuEdit.Disposed += new EventHandler(stuOperation_Disposed);
     studentInfoGroup.Controls.Add(stuEdit);
     stuEdit.Dock = DockStyle.Fill;
 }
Exemplo n.º 8
0
 public void setStudent(Student s)
 {
     while (!this.IsHandleCreated) ;
     this.BeginInvoke(new MethodInvoker(() =>
     {
         IdLab.Text = s.ID;
         NameLab.Text = s.sName;
     }));
 }