Skip to content

Commit

Permalink
fix semester score
Browse files Browse the repository at this point in the history
  • Loading branch information
MiMi-Yup committed Jun 9, 2022
1 parent 6eb6c08 commit ee8eb69
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,16 @@ private void Class_ComboBox_SelectedIndexChanged(object sender, EventArgs e)
ResetDataGridView();
className = Class_ComboBox.SelectedItem.ToString();

var listSemester = Database.DataProvider.Instance.Database.TEACHes.Where(item => item.IDTEACHER == studMin.Database.LoginServices.LoginServices.Instance.CurrentTeacher.ID && item.CLASS.CLASSNAME == className && item.SCHOOLYEAR == schoolYear).Select(item => item.SEMESTER.NAME).ToList();

string temp = listSemester[0];
listSemester.Remove(temp);
listSemester.Add(temp);

listSemester = listSemester.Select(item => Methods.HocKy(int.Parse(item))).ToList();

SemesterComboBox.DataSource = listSemester;

List<STUDENT> students = studMin.Database.ClassServices.Instance.GetListStudentOfClass(className, schoolYear, semester);
sTUDENTBindingSource.DataSource = students.Select(student => new STUDENT4GRIDVIEW(student.ID, student.INFOR.FIRSTNAME, student.INFOR.LASTNAME)).ToList();

Expand Down Expand Up @@ -425,16 +435,6 @@ private void SchoolYear_ComboBox_SelectedIndexChanged(object sender, EventArgs e

isAllowEdit = lastestSchoolYear == int.Parse(schoolYear);

var listSemester = Database.DataProvider.Instance.Database.SEMESTERs.ToList().Select(item => item.NAME).ToList();

string temp = listSemester[0];
listSemester.Remove(temp);
listSemester.Add(temp);

listSemester = listSemester.Select(item => Methods.HocKy(int.Parse(item))).ToList();

SemesterComboBox.DataSource = listSemester;

if (!String.IsNullOrEmpty(schoolYear))
{
List<string> @class = studMin.Database.DataProvider.Instance.Database.TEACHes.Where(item => item.SCHOOLYEAR == schoolYear && item.IDTEACHER == studMin.Database.LoginServices.LoginServices.Instance.CurrentTeacher.ID).Select(item => item.CLASS.CLASSNAME).Distinct().ToList();
Expand Down

0 comments on commit ee8eb69

Please sign in to comment.