public override void Execute() { Employee emp = database.GetUnionMember(memberId); if (emp != null) { UnionAffiliation unionAffiliation = emp.Affiliation as UnionAffiliation; if (unionAffiliation != null) { ServiceCharge sc = new ServiceCharge(amount, date); unionAffiliation.AddServiceCharge(sc); } else { throw new ApplicationException("not join Union Affiliaction."); } } else { throw new ApplicationException("no such employee"); } }
public void AddServiceCharge(ServiceCharge sc) { charges[sc.Date] = sc; }