Exemplo n.º 1
0
        private void buttonResultAdd_Click(object sender, EventArgs e)
        {
            try
            {
                //Result r = new Result();
                int cId    = Int32.Parse(comboBoxClass.Text);
                int secId  = Int32.Parse(comboBoxSection.Text);
                int sId    = Int32.Parse(textBoxSearchStudent.Text);
                int coId   = Int32.Parse(comboBoxCourse.Text);
                int tMark  = Int32.Parse(textBoxTotalMark.Text);
                int obMark = Int32.Parse(textBoxObtainedMark.Text);

                int b = TeacherController.AssignResult(cId, secId, sId, coId, tMark, obMark);
                if (b == 0)
                {
                    MessageBox.Show("Result Added");
                    this.Close();
                }
                else if (b == 2)
                {
                    MessageBox.Show("Result for this course already added");
                }
                else
                {
                    MessageBox.Show("You don't have access to this student result");
                }

                /*int r = Int32.Parse(comboBoxClass.Text);
                 * Console.WriteLine(r + "999");*/
            }
            catch (Exception)
            {
                MessageBox.Show("Invalid input");
            }
        }