示例#1
0
        public List <Appeals_Student> Get_Appeals_by_Lecturer_ID(string id)
        {
            List <Appeals_Student> appeals = new List <Appeals_Student>();
            Appeals_Student        appeal  = new Appeals_Student();
            int no_review = -1;

            try
            {
                con.OpenCon();
                com = new SqlCommand("SELECT * FROM Student_Appeals WHERE Lecturer_ID = '" + id + "' AND Status = '" + no_review + "'", con.GetCon());
                SqlDataReader rdr = com.ExecuteReader();

                while (rdr.Read())
                {
                    appeal = new Appeals_Student();
                    appeal.Set_Student_ID(rdr["Student_ID"].ToString());
                    appeal.Set_Status(Convert.ToInt32(rdr["Status"].ToString()));
                    appeal.Set_Lecturer_ID(id);
                    appeal.Set_Course_Name(rdr["Course_Name"].ToString());
                    appeal.Set_Course_ID(Convert.ToInt32(rdr["ActiveCourse_ID"].ToString()));
                    appeal.Set_Appeal(rdr["Appeal"].ToString());

                    appeals.Add(appeal);
                }
                rdr.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            con.CloseCon();
            return(appeals);
        }
 public void Update_Grade_After_Appeal_Confirmation(int grade, Appeals_Student appeal)
 {
     try
     {
         con.OpenCon();
         com = new SqlCommand("UPDATE StudentGrades SET Grade = '" + grade + "' WHERE studentID = '" + appeal.Get_Student_ID() + "' AND courseName = '" + appeal.Get_Course_Name() + "'", con.GetCon());
         com.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     con.CloseCon();
 }
        private void Initialise_Again()
        {
            studentGrades = studentDB.Get_Grades(student);

            appeals       = appeal_StdntDB.Get_Appeals_From_DB_By_Student(student);
            studentGrades = stdntToCourseDB.Get_Grades(student.getID());
            lecturers     = activeCoursesDB.Get_Lecturers_For_Grades(studentGrades, coursesID);

            txtB__Diplay_Grades_TitleBar.Text = "קורס\t\tמרצה\t\tציון\tערעור";
            int    size       = studentGrades.Count();
            string courseName = "";

            string appeal_made = "";

            for (int i = 0; i < size; i++)
            {
                courseName = studentGrades[i].Get_CourseName();
                Remove_Unnecessary_Spaces(courseName);

                Appeals_Student temp = appeals.Find(a => a.Get_Course_Name() == studentGrades[i].Get_CourseName());
                if (temp != null)
                {
                    if (temp.Get_Status() == CONFIRMED)
                    {
                        appeal_made = "אושר";
                    }
                    else if (temp.Get_Status() == DENYED)
                    {
                        appeal_made = "נדחה";
                    }
                    else
                    {
                        appeal_made = "הוגש";
                    }


                    appeals_made.Add(temp.Get_Status());
                }
                else
                {
                    appeal_made = "לא הוגש";
                    appeals_made.Add(NO_APPEAL);
                }

                lstB_Dysplay_Grades.Items.Add(courseName + "\t" + lecturers[i].Get_Full_Name() + "\t" + studentGrades[i].Get_Grade() + "\t" + appeal_made);
            }
        }
示例#4
0
        public void Update_After_Lecturer_Review(int ConfirmDeny, Appeals_Student appeal)
        {
            try
            {
                con.OpenCon();
                com = new SqlCommand("UPDATE Student_Appeals SET Status = '" + ConfirmDeny + "' WHERE Student_ID = '" + appeal.Get_Student_ID() + "' AND ActiveCourse_ID = '" + appeal.Get_Course_ID() + "' AND Lecturer_ID = '" + appeal.Get_Lecturer_ID() + "'", con.GetCon());
                SqlDataReader rdr = com.ExecuteReader();

                while (rdr.Read())
                {
                }
                rdr.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            con.CloseCon();
        }