예제 #1
0
파일: Ch13Smp1.cs 프로젝트: JDavis22/CIS350
        private void updateMenuItem_Click(object sender, System.EventArgs e)
        {
            int             listIndex;
              Student         student;
              AddUpdateDialog updateDialog = new AddUpdateDialog();

              listIndex         = this.dataGridView.CurrentRow.Index + 1;
              student           = this.studentList[listIndex];
              updateDialog.Text = "Update Student";
              updateDialog.Tag  = student;
              if (updateDialog.ShowDialog(this)==DialogResult.OK)
              {
            this.studentList.RemoveAt(listIndex);
            listIndex = ~this.studentList.BinarySearch(student, listOrder);
            this.studentList.InsertAt(listIndex, student);
            this.RefreshClientAreaControls(listIndex);
              }
              updateDialog.Dispose();
        }
예제 #2
0
파일: Ch13Smp1.cs 프로젝트: JDavis22/CIS350
        private void addMenuItem_Click(object sender, System.EventArgs e)
        {
            int             listIndex = 0;
              Student         student;
              AddUpdateDialog addDialog = new AddUpdateDialog();

              student        = new Student();
              student.ID     = studentList.AssignID();
              addDialog.Text = "Add Student";
              addDialog.Tag  = student;
              if (addDialog.ShowDialog(this)==DialogResult.OK)
              {
            listIndex = ~this.studentList.BinarySearch(student, listOrder);
            this.studentList.InsertAt(listIndex, student);
            this.RefreshClientAreaControls(listIndex);
              }
              addDialog.Dispose();
        }