Beispiel #1
0
        private void EditCurrentRow()
        {
            Student student = blStudents.Where(c => c.Id == bsStudents.StudentIdentifier()).AsQueryable().FirstOrDefault();

            //Student student = blStudents.FirstOrDefault(stud => stud.Id == bsStudents.StudentIdentifier());
            EditorForm f = new EditorForm(student);

            try
            {
                if (f.ShowDialog() == DialogResult.OK)
                {
                    bsStudents.ResetCurrentItem();
                }
            }
            finally
            {
                f.Dispose();
            }
        }
Beispiel #2
0
        private void AddNewStudent()
        {
            Student    student = new Student();
            EditorForm f       = new EditorForm(student);

            try
            {
                if (f.ShowDialog() == DialogResult.OK)
                {
                    blStudents.Add(student);
                    blStudents.ResetBindings();
                    dataGridView1.Sort(dataGridView1.Columns["FirstName"], ListSortDirection.Ascending);
                }
            }
            finally
            {
                f.Dispose();
            }
        }
Beispiel #3
0
        private void AddNewStudent()
        {
            /*   Student student = new Student(); */
            EditorForm f = new EditorForm(std, dep);

            try
            {
                if (f.ShowDialog() == DialogResult.OK)
                {
                    {
                        /*   blStudents.Add(student);
                         * blStudents.ResetBindings();
                         * dataGridView1.Sort(dataGridView1.Columns["Id"], ListSortDirection.Ascending); */
                    }
                }
            }
            finally
            {
                f.Dispose();
            }
        }