Example #1
0
        private void Developer_OnLeaveApliedEvent(Employee emp, Leave leave)
        {
            //Developer has applied for leave
            TeamLeader tl = new TeamLeader();

            tl.ApproveLeave(new Leave(Guid.NewGuid(), 5));
        }
Example #2
0
        static void Main(string[] args)
        {
            Developer     developer   = new Developer();
            TeamLeader    teamLead    = new TeamLeader();
            ProjectLeader projectLead = new ProjectLeader();
            HR            hr          = new HR();

            //Creating object chain
            //developer.Successor = teamLead;
            teamLead.Successor    = projectLead;
            projectLead.Successor = hr;

            teamLead.ApplyLeave(new Leave(Guid.NewGuid(), 10));
            teamLead.ApplyLeave(new Leave(Guid.NewGuid(), 20));
            teamLead.ApplyLeave(new Leave(Guid.NewGuid(), 30));
            teamLead.ApplyLeave(new Leave(Guid.NewGuid(), 31));

            Console.ReadLine();
        }