Esempio n. 1
0
        private void btnAddNew_Click(object sender, EventArgs e)
        {
            StudentRegistrationForm frmStudentRegistration = new StudentRegistrationForm();
            frmStudentRegistration.ShowDialog(this);

            if (frmStudentRegistration.IsNewStudentCreate == true)
            {
                DataRow drStudentRow = dtStudentData.NewRow();
                drStudentRow["StudentId"] = -99;
                drStudentRow["Name"] = frmStudentRegistration.StudentName;
                drStudentRow["DOB"] = frmStudentRegistration.DateOfBirth;
                drStudentRow["GradePointAvg"] = frmStudentRegistration.GradePointAvg;
                drStudentRow["Active"] = frmStudentRegistration.Active;

                dtStudentData.Rows.Add(drStudentRow);
                //  dtStudentData.AcceptChanges();
                BindDataToGrid(dtStudentData);
                btnSave.Enabled = true;
            }
        }
Esempio n. 2
0
        private void btnAddNew_Click(object sender, EventArgs e)
        {
            StudentRegistrationForm frmStudentRegistration = new StudentRegistrationForm();

            frmStudentRegistration.ShowDialog(this);

            if (frmStudentRegistration.IsNewStudentCreate == true)
            {
                DataRow drStudentRow = dtStudentData.NewRow();
                drStudentRow["StudentId"]     = -99;
                drStudentRow["Name"]          = frmStudentRegistration.StudentName;
                drStudentRow["DOB"]           = frmStudentRegistration.DateOfBirth;
                drStudentRow["GradePointAvg"] = frmStudentRegistration.GradePointAvg;
                drStudentRow["Active"]        = frmStudentRegistration.Active;

                dtStudentData.Rows.Add(drStudentRow);
                //  dtStudentData.AcceptChanges();
                BindDataToGrid(dtStudentData);
                btnSave.Enabled = true;
            }
        }