示例#1
0
        private void LoadCmbSemester()
        {
            SemesterController semesterController = new SemesterController();
            List <SEMESTER>    semesters          = semesterController.GetAll();

            cmbSemester.ValueMember   = "SEMESTERID";
            cmbSemester.DisplayMember = "NAME";
            cmbSemester.DataSource    = semesters;
        }
        private void StudentScore_Load(object sender, EventArgs e)
        {
            STUDENT            student            = new STUDENT();
            StudentController  studentController  = new StudentController();
            ClassController    classController    = new ClassController();
            YearController     yearController     = new YearController();
            SemesterController semesterController = new SemesterController();
            ConductController  conductController  = new ConductController();

            student                   = studentController.getStudent(_username);
            txtMSHS.Text              = student.MSHOCSINH;
            txtBirthday.Text          = student.BIRTHDAY.ToString();
            txtName.Text              = student.NAME;
            cmbYear.ValueMember       = "SCHOOLYEARID";
            cmbYear.DisplayMember     = "NAME";
            cmbYear.DataSource        = yearController.GetListYear(student.MSHOCSINH);
            cmbSemester.ValueMember   = "SEMESTERID";
            cmbSemester.DisplayMember = "NAME";
            cmbSemester.DataSource    = semesterController.GetAll();
            txtClass.Text             = classController.GetClass(cmbYear.SelectedValue.ToString(), student.MSHOCSINH);
            if (CaculateScores() != -1)
            {
                txtAverageScore.Text = CaculateScores().ToString();
            }
            if (CaculateScores() < (decimal)3.5)
            {
                txtType.Text = "kém";
            }
            else if (CaculateScores() < (decimal)5)
            {
                txtType.Text = "yếu";
            }
            else if (CaculateScores() < (decimal)6.5)
            {
                txtType.Text = "TB";
            }
            else if (CaculateScores() < (decimal)8)
            {
                txtType.Text = "Khá";
            }
            else
            {
                txtType.Text = "Giỏi";
            }
            txtConduct.Text = conductController.GetConducName(txtMSHS.Text, (decimal)cmbSemester.SelectedValue, cmbYear.SelectedValue.ToString());
        }