コード例 #1
0
        private void finish_Click(object sender, EventArgs e)
        {
            Online_Exame ex = new Online_Exame();

            IfStdExameExestBefor();
            foreach (var item in StudentAnswers)
            {
                //var msg = ex.NewStudentExam(studentID, item.Key, examID, 0, item.Value);
                Student_Exam se = new Student_Exam()
                {
                    St_id     = studentID,
                    Ex_id     = examID,
                    Q_id      = item.Key,
                    Result    = 0,
                    St_answer = item.Value
                };
                ex.Student_Exam.Add(se);

                ex.SaveChanges();
            }
            ex.ExamCorrection(studentID, examID);
            var res = ex.ExamRes(studentID, examID).First();

            MessageBox.Show($"your grade {res}");
            StudentDashbord std = new StudentDashbord(studentID);

            this.Close();
            std.Show();
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
            StudentDashbord sd = new StudentDashbord(stdID);

            sd.Show();
        }
コード例 #3
0
 private void Login(int id, string email)
 {
     try
     {
         Online_Exame    exam    = new Online_Exame();
         var             std     = (from s in exam.Students where s.St_id == id & s.Email == email select s).First();
         StudentDashbord Student = new StudentDashbord(std.St_id);
         Student.Show();
         this.Close();
     }
     catch (Exception)
     {
         MessageBox.Show("Not Autho");
     }
 }