Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            MailSender mailSender = new MailSender();
            HR         hr         = new HR("*****@*****.**");
            Manager    manager    = new Manager(mailSender, "*****@*****.**", "M");
            Employee   employee   = new Employee(mailSender, "*****@*****.**", "A", manager);


            HolidayRequest request = new HolidayRequest(employee, new HolidayInterval(new DateTime(2014, 12, 1), new DateTime(2014, 12, 15)));

            employee.SubmitHolidayRequest(request);

            manager.RejectHolidayRequest(request, "get to work!");

            manager.ApproveHolidayRequest(request, hr);
        }
        public void ApproveHolidayRequest(HolidayRequest holidayRequest, HR hr)
        {
            Message message = new HolidayRequestApproveMessageGenerator(holidayRequest, hr).Get();

            _messageDispatcher.Send(message);
        }