コード例 #1
0
ファイル: StudentDetail.cs プロジェクト: Anusha77SL/Exam
        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;
            }
        }
コード例 #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;
            }
        }