예제 #1
0
        private void SendEmailToManager(string approveAction, string cancelAction)
        {
            IEmailService emailService = EmailServiceLocator.GetEmailService();
            Email         email        = new Email();

            email.From    = Employee.mailAddress;
            email.To      = Manager.mailAddress;
            email.Subject = "Please aprove my request";
            IBusinessTripFormatter btf = BusinessTripFormatterServiceLocator.GetFormatter();

            email.Body = btf.GetBody(this);



            emailService.Send(email);
        }
예제 #2
0
        public void Cancel()
        {
            if (Status != STATES.STATE_PENDING)
            {
                return;
            }
            Status = STATES.STATE_CANCELED;
            IEmailService emailService = EmailServiceLocator.GetEmailService();
            Email         email        = new Email();

            email.From    = Manager.mailAddress;
            email.To      = Employee.mailAddress;
            email.Subject = "Your request is canceled";
            IBusinessTripFormatter btf = BusinessTripFormatterServiceLocator.GetFormatter();

            email.Body = btf.GetBody(this);
            emailService.Send(email);
        }