Пример #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ExaminationEntities1 ex = new ExaminationEntities1();
            var insObj = ex.selectFromInstructor(instructor_id).FirstOrDefault();

            this.instructorName.Text += $"{insObj.ins_FName} {insObj.ins_LName}";
        }
Пример #2
0
        private void SaveAnswers()
        {
            List <string> stdAnswers = new List <string>();

            stdAnswers.AddRange(CurrentExam.Questions.Select(a => a.StudentAnswer));
            string StudentAnswers = ReorderStudentAnswers(stdAnswers);

            ex = new ExaminationEntities1();
            string ExamStatus = ex.ExamAnswers(StudentID, ExamID, StudentAnswers).First();

            if (ExamStatus == "ExamSaved")
            {
                string CorrectionStatus = ex.examCorrection(ExamID, StudentID, CourseID).First();

                if (CorrectionStatus == "Correction is done successfully")
                {
                    MessageBox.Show(CorrectionStatus, "Alert", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else
                {
                    MessageBox.Show(CorrectionStatus, "Alert", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
            else
            {
                MessageBox.Show(ExamStatus, "Alert", MessageBoxButton.OK, MessageBoxImage.Error);
            }

            this.Close();
        }
Пример #3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ExaminationEntities1 db = new ExaminationEntities1();
            Ins_Crs_Grid.ItemsSource = db.CoursesByInstructor(instructor_id);

            var insObj = db.selectFromInstructor(instructor_id).FirstOrDefault();
            this.instructorName.Text += $"{insObj.ins_FName} {insObj.ins_LName}";
        }
Пример #4
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ex = new ExaminationEntities1();
            subjectCombo.ItemsSource = ex.courseList(_stdId);
            examCombo.ItemsSource    = ex.examsList(_stdId, _courseId);
            var stdObj = ex.selectStudents().Where(s => s.std_Id == _stdId).FirstOrDefault();

            this.studetName.Text += $"{stdObj.std_FName} {stdObj.std_LName}";
        }
Пример #5
0
        private void TakeExam(object sender, RoutedEventArgs e)
        {
            ExaminationEntities1 ex = new ExaminationEntities1();

            frm_ExamList tx = new frm_ExamList(_stdId);

            this.Close();
            tx.Show();
        }
Пример #6
0
        public frm_ExamList(int _stdID)
        {
            InitializeComponent();

            StudentID = _stdID;

            ex       = new ExaminationEntities1();
            ExamList = ex.GetUnsolvedExams(StudentID).ToList();
        }
Пример #7
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            db = new ExaminationEntities1();
            combox_crs.ItemsSource = db.CoursesByInstructor(instructor_id);
            var    InsName  = db.selectFromInstructor(instructor_id).FirstOrDefault();
            string FullName = $"{InsName.ins_FName} {InsName.ins_LName}";

            this.insName.Text += FullName;
        }
Пример #8
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ex = new ExaminationEntities1();
            std_result.ItemsSource = ex.GetSudentGrades(_stdId);

            StudentGradeResults.ItemsSource = ex.GetSudentGrades(_stdId).Select(p => new { Subject = p.crs_Name, Grade = p.grade }).ToList();

            var stdObj = ex.selectStudents().Where(s => s.std_Id == _stdId).FirstOrDefault();

            this.studentName.Text += $"{stdObj.std_FName} {stdObj.std_LName}";
        }
Пример #9
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ExaminationEntities1 ex = new ExaminationEntities1();
            var s1 = ex.GetStudents(_stdId).FirstOrDefault();

            this.name.Text         = s1.std_FName + " " + s1.std_LName;
            this.id.Text           = s1.std_Id.ToString();
            this.intake.Text       = "Intake_41";
            this.branch.Text       = "Smart Village";
            this.track.Text        = "SD";
            this.studentName.Text += s1.std_FName + " " + s1.std_LName;
        }
Пример #10
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ex = new ExaminationEntities1();
            dg_UnsolvedExams.ItemsSource = ex.GetUnsolvedExamsNames(StudentID);

            var    stdName  = ex.selectStudents().Where(s => s.std_Id == StudentID).FirstOrDefault();
            string studName = $"{stdName.std_FName} {stdName.std_LName}";

            this.studentName.Text += studName;

            /*dg_UnsolvedExams.Columns[0].Width = 100;
            *  dg_UnsolvedExams.Columns[1].Width = 300;
            *  dg_UnsolvedExams.Columns[2].Width = 150;
            *  dg_UnsolvedExams.Columns[3].Width = 120;*/
        }
Пример #11
0
        public cls_Exam(int exmID)
        {
            ExaminationEntities1  ex  = new ExaminationEntities1();
            List <GetExam_Result> exm = ex.GetExam(exmID).ToList();

            QuestionsBeforeShuffling = new List <GetExam_Result>();
            QuestionsBeforeShuffling.AddRange(exm);

            exm.Shuffle <GetExam_Result>();

            Questions = new List <cls_Question>();

            foreach (var item in exm)
            {
                Questions.Add(new cls_Question(item.qDescription, item.qChoice));
            }
        }
Пример #12
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ex = new ExaminationEntities1();


            CoursesTopicsList.ItemsSource = ex.topicsPerCourse();

            if (_insIDl != 0)
            {
                Course_Topics.ItemsSource = ex.CoursesByInstructor(_insIDl).Select(p => new { p.crs_Id, crs_Name = p.crs_name });
                var    InsName  = ex.selectFromInstructor(_insIDl).FirstOrDefault();
                string instName = $"{InsName.ins_FName} {InsName.ins_LName}";
                this.fullName.Text += instName;
            }
            if (_studentId != 0)
            {
                Course_Topics.ItemsSource = ex.courseList(_studentId);
                var    stdName  = ex.selectStudents().Where(s => s.std_Id == _studentId).FirstOrDefault();
                string studName = $"{stdName.std_FName} {stdName.std_LName}";
                this.fullName.Text += studName;
            }
        }
Пример #13
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ExaminationEntities1 ex = new ExaminationEntities1();

            StdEmailCbx.ItemsSource = ex.selectStudents();
        }