示例#1
0
        private void editTestResultsButton_Click(object sender, EventArgs e)
        {
            EditResultsForm erf = new EditResultsForm(studentsList, GroupId, false);

            erf.ShowDialog();
            erf.Dispose();
        }
示例#2
0
        private void continueButton_Click(object sender, EventArgs e)
        {
            SqlCommand   command = new SqlCommand();
            SqlParameter group   = new SqlParameter("@GroupId", groupId);

            command.Parameters.Add(group);

            if (isAssignment)
            {
                command.CommandText = "INSERT INTO Homeworks VALUES (@HomeworkName, @GroupId)";
                command.Parameters.AddWithValue("@HomeworkName", assignmentNameTextBox.Text);
                SqlTools.ExecuteNonQuery(command);
            }
            else
            {
                command.CommandText = "INSERT INTO Tests VALUES (@TestName, @GroupId)";
                command.Parameters.AddWithValue("@TestName", assignmentNameTextBox.Text);
                SqlTools.ExecuteNonQuery(command);
            }
            EditResultsForm erf = new EditResultsForm(Students, groupId, isAssignment, assignmentNameTextBox.Text);

            Hide();
            erf.ShowDialog();
            erf.Dispose();
        }