コード例 #1
0
ファイル: Ch13Prb1.cs プロジェクト: JDavis22/CIS350
        /*************************************************
         * Add item click events                         *
         *************************************************/
        //Commision Add Event
        private void commissionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int listIndex = 0;
              Commission empCom;
              AddUpdateCommissionDialog addDialog = new AddUpdateCommissionDialog();

              empCom = new Commission();
              empCom.ID = empList.AssignID();
              addDialog.Text = "Add Commission Employee";
              addDialog.Tag = empCom;
              if (addDialog.ShowDialog(this) == DialogResult.OK)
              {
            listIndex = ~this.empList.BinarySearch(empCom, listOrder);
            this.empList.InsertAt(listIndex, empCom);
            this.RefreshClientAreaControls(listIndex);
              }
              addDialog.Dispose();
        }
コード例 #2
0
ファイル: Ch13Prb1.cs プロジェクト: JDavis22/CIS350
        /**********************************
         * BEGIN UPDATE EVENTS            *
         * ********************************/
        private void commissionToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            int listIndex;
              Commission emp;
              //Need new dialog
              AddUpdateCommissionDialog updateDialog = new AddUpdateCommissionDialog();

              listIndex = this.dataGridView.CurrentRow.Index + 1;
              emp = (Commission)this.empList[listIndex];
              updateDialog.Text = "Update Employee";
              updateDialog.Tag = emp;
              if (updateDialog.ShowDialog(this) == DialogResult.OK)
              {
            this.empList.RemoveAt(listIndex);
            listIndex = ~this.empList.BinarySearch(emp, listOrder);
            this.empList.InsertAt(listIndex, emp);
            this.RefreshClientAreaControls(listIndex);
              }
              updateDialog.Dispose();
        }