protected override void OnEmployeeLayOff(EmployeeLayOffEventArgs e) { if (e.Cause == LayOffCause.target) { base.OnEmployeeLayOff(e); } }
///CallBackMethod public void RemoveStaff(object sender, EmployeeLayOffEventArgs e) { if (sender is Employee em) { if (e.Cause == LayOffCause.above60 || e.Cause == LayOffCause.noStock || e.Cause == LayOffCause.resign || e.Cause == LayOffCause.target) { Staff.Remove(em); em.EmployeeLayOff -= RemoveStaff; } } }
///CallBackMethod public void RemoveMember(object sender, EmployeeLayOffEventArgs e) { if (sender is Employee em) { if (e.Cause == LayOffCause.noStock || e.Cause == LayOffCause.target) { Members.Remove(em); em.EmployeeLayOff -= RemoveMember; } } }
protected virtual void OnEmployeeLayOff(EmployeeLayOffEventArgs e) { EmployeeLayOff?.Invoke(this, e); }