Пример #1
0
        private void AddToLabelAllVak()
        {
            Vak    codeVak = allVakLst[cbAllVak.SelectedIndex];
            string code    = codeVak.VakCode;

            lblAllVak.Text = codeVak.ToString();
        }
Пример #2
0
        private void btnAddResult_Click(object sender, EventArgs e)
        {
            decimal grade   = gradeValueNum.Value;
            Vak     codeVak = allVakLst[cbAllVak.SelectedIndex];

            currentVakResult    = new Result(codeVak, grade);
            gradeValueNum.Value = 0;
        }
Пример #3
0
        private void btnResults_Click(object sender, EventArgs e)
        {
            Vak     codeVak = allVakLst[cbAllVak.SelectedIndex];
            Student student = allStudentsLst[lbAllStudents.SelectedIndex];
            decimal grade   = student.GetGrade(codeVak);

            lblResult.Text = "Grade for this Vak: " + grade.ToString();
        }
Пример #4
0
 internal void AddVakToCB(Vak vak)
 {
     cbAllVak.Items.Clear();
     allVakLst.Add(vak);
     foreach (Vak n in allVakLst)
     {
         cbAllVak.Items.Add(n.GetVakName);
     }
 }
Пример #5
0
 public decimal GetGrade(Vak vak)
 {
     foreach (Vak n in allVakList)
     {
         if (n == vak)
         {
             return(GetGradeVak);
         }
     }
     return(0);
 }
Пример #6
0
        private void btnAddVak_Click(object sender, EventArgs e)
        {
            string name  = tbVakName.Text;
            string code  = tbVakCode.Text;
            int    hours = Convert.ToInt32(tbStudyHours.Text);

            if (name != "VakName" && code != "VakCode" && tbStudyHours.Text != "StudyHours")
            {
                newVak = new Vak(name, code, hours);
                studentForm.AddVakToCB(newVak);
                tbVakName.Text    = "VakName";
                tbVakCode.Text    = "VakCode";
                tbStudyHours.Text = "StudyHours";
            }
            else
            {
                MessageBox.Show("Please fill in all textboxes");
            }
        }
Пример #7
0
 public Result(Vak vak, decimal grade)
 {
     this.GetGradeVak = grade;
     this.currentVak  = vak;
     allVakList.Add(currentVak);
 }
Пример #8
0
 public void AddGrade(Vak vak, decimal grade)
 {
     studentResult = new Result(vak, grade);
 }
Пример #9
0
 public decimal GetGrade(Vak vak)
 {
     return(studentCurrentResult.GetGrade(vak));
 }