protected override void RecordMembership(Employee emp)
        {
            UnionAffiliation ua = emp.Affiliation as UnionAffiliation;

            if (ua != null)
            {
                int memberId = ua.MemberId;
                database.RemoveUnionMember(memberId);
            }
        }
Esempio n. 2
0
        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");
            }
        }