Beispiel #1
0
        private void manageSubject_Load(object sender, EventArgs e)
        {
            //load data to gradview
            DataTable dt = s.Select();

            dataGridView1.DataSource = dt;
        }
Beispiel #2
0
        //Save

        private void btnSubSaveAdd_Click_1(object sender, EventArgs e)
        {
            if (IsValidSave())
            {
                //Get value from input fiellds

                c.SubjectCode        = txtSubCodeAdd.Text;
                c.SubjectName        = txtSubNameAdd.Text;
                c.OfferedYear        = cmbSubYearAdd.Text;
                c.OfferedSemester    = cmbSubSemesterAdd.Text;
                c.NumberofLecHours   = cmbSubLecHoursAdd.Text;
                c.NumberofTuteHours  = cmbSubTuteAdd.Text;
                c.NumberofLabHours   = cmbSubLabAdd.Text;
                c.NumberofEvaluHours = cmbSubEvaHoursAdd.Text;

                //inserting data into the database
                bool success = c.Insert(c);
                if (success == true)
                {
                    MessageBox.Show("New Subject Successfully Insert");
                    //Call the clear method here
                    ClearFieldsAfterSave();
                }
                else
                {
                    MessageBox.Show("Error");
                }

                // LOAD DATA
                DataTable dt = c.Select();
                metroGrid1.DataSource = dt;
            }
        }
        private void ManageSubjects_Load(object sender, EventArgs e)
        {
            //Load data on data grid view
            DataTable dt = s.Select();

            dataGridViewSubjects.DataSource = dt;
        }
        //View subject details in DataGridView
        private void ManageSubject_Load(object sender, EventArgs e)
        {
            DataTable dt = s.Select();

            SubGridView.DataSource = dt;
            id = 0;
        }