Пример #1
0
 /**
  * Edit the student information
  */
 private void ppStudentCM_edit_Click(object sender, EventArgs e)
 {
     if (this.curPPNode != null)
     {
         /* Obtain the student object */
         // Student s = this.db.getStudentObj(this.curPPNode.id);
         EditStudentForm esf = new EditStudentForm(null);
         esf.Show();
     }
 }
        private void btnEdit_Click(object sender, EventArgs e)
        {
            // Form settings.
            EditStudentForm form = new EditStudentForm();

            form.updateData = new EditStudentForm.UpdateData(LoadStudentList);

            // Set student selected.
            form.setStudentData(getStudentSelectedFromGridView());
            form.Show();
        }
        private void EditButton_Click(object sender, EventArgs e)
        {
            if (StudentsListBox.CheckedItems.Count == 0)
            {
                return;
            }

            var selected = StudentsListBox.SelectedItem.ToString();

            var editSelectedStudent = new EditStudentForm(selected);

            editSelectedStudent.ShowDialog();
            RefreshStudentsListBox();
            StudentInfoListBox.Items.Clear();
        }
Пример #4
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            try
            {
                DataGridViewSelectedRowCollection item = dgvSinhVien.SelectedRows;
                int             index = dgvSinhVien.SelectedCells[0].RowIndex;
                DataGridViewRow row   = dgvSinhVien.Rows[index];

                Student s = new Student();
                s.MSSV     = row.Cells[0].Value.ToString();;
                s.Name     = row.Cells[1].Value.ToString();;
                s.DiaChi   = row.Cells[3].Value.ToString();;
                s.NienKhoa = row.Cells[5].Value.ToString();;

                EditStudentForm form = new EditStudentForm();
                form.updateData = new EditStudentForm.UpdateData(LoadStudentListToDataGrid);
                form.setStudentData(s);
                form.Show();
            }
            catch (Exception) { MessageBox.Show("Error"); }
        }