コード例 #1
0
ファイル: Ch14Smp4.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
ファイル: Ch14Smp4.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();
        }