Ejemplo n.º 1
0
        private void btnStudentAdd_Click(object sender, EventArgs e)
        {
            frmStudent dlg = new frmStudent();

            dlg.AddNew();
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                int index = bsStudentsForGridView.Position;
                taStudentsForGridView.Fill(dsDataModel.StudentsForGridView);
                if (-1 != index)
                {
                    bsStudentsForGridView.Position = index;
                }
            }
        }
Ejemplo n.º 2
0
        private void btnStudentEdit_Click(object sender, EventArgs e)
        {
            DataRowView rowView = (DataRowView)bsStudentsForGridView.Current;

            if (rowView == null)
            {
                return;
            }
            DataModel.DataModelDataSet.StudentsForGridViewRow row
                = (DataModel.DataModelDataSet.StudentsForGridViewRow)rowView.Row;
            frmStudent dlg = new frmStudent();

            dlg.Edit(row.StudentID);
            /* Vizuālā programmēšana, G. Alksnis, 2015, r59 */ /* 108 */
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                int index = bsStudentsForGridView.Position;
                taStudentsForGridView.Fill(dsDataModel.StudentsForGridView);
                if (-1 != index)
                {
                    bsStudentsForGridView.Position = index;
                }
            }
        }