예제 #1
0
파일: Ch13Prb1.cs 프로젝트: JDavis22/CIS350
        //End Commission Add Event
        //Hourly Add Event
        private void hourlyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int listIndex = 0;
              Hourly empHour;
              empHour = new Hourly();
              AddUpdateHourlyDialog addDialog = new AddUpdateHourlyDialog();

              empHour.ID = empList.AssignID();
              addDialog.Text = "Add Hourly Employee";
              addDialog.Tag = empHour;
              if (addDialog.ShowDialog(this) == DialogResult.OK)
              {
            listIndex = ~this.empList.BinarySearch(empHour, listOrder);
            this.empList.InsertAt(listIndex, empHour);
            this.RefreshClientAreaControls(listIndex);
              }
              addDialog.Dispose();
        }
예제 #2
0
파일: Ch13Prb1.cs 프로젝트: JDavis22/CIS350
        private void hourlyToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            int listIndex;
              Hourly emp;
              //Need new dialog
              AddUpdateHourlyDialog updateDialog = new AddUpdateHourlyDialog();

              listIndex = this.dataGridView.CurrentRow.Index + 1;
              emp = (Hourly)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();
        }