示例#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();
            }
        }
示例#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();
            }
        }
示例#3
0
文件: Form1.cs 项目: IWWAYBELTT/projt
        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();
            }
        }