/* private List<Student> FilterStudentsByGroup(List<Student> listToFilter, int groupFilter)
         * {
         *   return listToFilter.Where(x => x.GroupID == groupFilter).ToList();
         *   //poprzednia wersja bez LINQ
         *
         *   var filteredList = new List<Student>();
         *   foreach (var item in listToFilter)
         *   {
         *       if (item.GroupID == groupFilter)
         *           filteredList.Add(item);
         *   }
         *   return filteredList;
         * }
         *
         * private int CheckSortingMethod()
         * {
         *   if (comboMain.SelectedIndex == 0)
         *       return 0;
         *   else
         *       return comboMain.SelectedIndex;
         * }
         *
         * private List<Student> OrderStudentByID(List<Student> list)
         * {
         *   var orderBy = list.OrderBy(Student => Student.Id);
         *   return list = orderBy.ToList();
         * }*/


        private void btnAdd_Click(object sender, EventArgs e)
        {
            var addEditStudent = new AddEditStudent();

            addEditStudent.FormClosing += AddEditStudent_FormClosing;
            addEditStudent.ShowDialog();
        }
예제 #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var addEditStudent = new AddEditStudent(_studentsList);

            addEditStudent.FormClosing += AddEditStudent_FormClosing;
            addEditStudent.ShowDialog(this);
            _fileHelperToStudents.SerializeToFile(_studentsList);
        }
예제 #3
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (dgvDiary.SelectedRows.Count == 0)
            {
                MessageBox.Show("Proszę zaznacz ucznia, którego dane chcesz edytować");
                return;
            }

            var addEditStudent = new AddEditStudent(Convert.ToInt32(dgvDiary.SelectedRows[0].Cells[0].Value));

            addEditStudent.ShowDialog();
        }
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (dgvDiary.SelectedRows.Count == 0)
            {
                MessageBox.Show("Zaznacz ucznia do edycji");
                return;
            }
            var addEditStudent = new AddEditStudent(
                Convert.ToInt32(dgvDiary.SelectedRows[0].Cells[0].Value));

            addEditStudent.FormClosing += AddEditStudent_FormClosing;
            addEditStudent.ShowDialog();
        }
예제 #5
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (dgvDiary.SelectedRows.Count == 0)
            {
                MessageBox.Show("Please select the student you want to edit");
                return;
            }
            var addEditStudent = new AddEditStudent((Convert.ToInt32(dgvDiary.SelectedRows[0].Cells["Id"].Value)));

            addEditStudent.FormClosing += AddEditStudent_FormClosing;
            addEditStudent.ShowDialog();
            addEditStudent.FormClosing -= AddEditStudent_FormClosing;
        }
예제 #6
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (dgvDiary.SelectedRows.Count == 0)
            {
                MessageBox.Show("Proszę zaznacz ucznia, którego dane chcesz edytować");
                return;
            }

            var addEditStudent = new AddEditStudent((Student)dgvDiary.SelectedRows[0].DataBoundItem);

            addEditStudent.FormClosing += AddEditStudent_FormClosing;
            addEditStudent.ShowDialog(this);
            _fileHelperToStudents.SerializeToFile(_studentsList);
        }