Beispiel #1
0
        public void Hide_Eval_And_Insert_Marks_And_Update_Marks_Code()
        {
            Eval_1_Label.Hide();
            Eval_1_txtbox.Hide();
            Eval_2_Label.Hide();
            Eval_2_txtbox.Hide();
            Eval_3_Label.Hide();
            Eval_3_txtbox.Hide();
            Insert_eval_mode.Hide();
            Enter_Eval_Modes_Label.Hide();

            Enter_Student_Marks_Label.Hide();
            Eval_1_Marks_Label.Hide();
            Eval_1_Marks_txtbox.Hide();
            Eval_2_Marks_Label.Hide();
            Eval_2_Marks_txtbox.Hide();
            Eval_3_Marks_Label.Hide();
            Eval_3_Marks_txtbox.Hide();
            Insert_Eval_Marks_Button.Hide();

            Marks_Info_Label.Hide();
            Total_Score_label.Hide();

            Marks_Outof_50.Hide();

            Update_Eval_Marks_Button.Hide();
        }
Beispiel #2
0
        private void Insert_eval_mode_Click(object sender, EventArgs e)
        {
            try
            {
                if (Eval_1_txtbox.Text == "" || Eval_2_txtbox.Text == "" || Eval_3_txtbox.Text == "")
                {
                    MessageBox.Show("Please insert 3 modes of Evaluation");
                }

                else
                {
                    //sqlConnection1.Open();
                    SqlCommand cmd = new SqlCommand();
                    cmd.Connection  = sqlConnection1;
                    cmd.CommandType = CommandType.Text;
                    cmd.CommandText = "INSERT into Evaluation (subject_id, eval_mode_1,eval_mode_2,eval_mode_3) values((SELECT subject_id from Subject where subject_name = @subject_n), @eval_1, @eval_2, @eval_3)";
                    cmd.Parameters.AddWithValue("@subject_n", SubjectComboBox.Text);
                    cmd.Parameters.AddWithValue("@eval_1", Eval_1_txtbox.Text);
                    cmd.Parameters.AddWithValue("@eval_2", Eval_2_txtbox.Text);
                    cmd.Parameters.AddWithValue("@eval_3", Eval_3_txtbox.Text);

                    SqlDataReader eval_reader = cmd.ExecuteReader();
                    eval_reader.Close();

                    Eval_1_Label.Hide();
                    Eval_1_txtbox.Hide();
                    Eval_2_Label.Hide();
                    Eval_2_txtbox.Hide();
                    Eval_3_Label.Hide();
                    Eval_3_txtbox.Hide();
                    Insert_eval_mode.Hide();

                    // Displaying Textboxes and Labels for inserting marks of students
                    Display_Textboxes_And_Labels_For_Inserting_Marks();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            Eval_1_txtbox.Clear();
            Eval_2_txtbox.Clear();
            Eval_3_txtbox.Clear();
        }