예제 #1
0
 public override void Submit(JobApplication jobApplication)
 {
     // implement base behavoiur
     base.Submit(jobApplication);
     
     // write message to notification queue            
     notificationService.Enqueue(jobApplication.ToString(), jobApplication.JobApplicationID.ToString());
     
 }
예제 #2
0
        public virtual void Submit(JobApplication jobApplication)
        {
            // evaluate business rules/policies
            RuleBase minHireAge = new MinimumHireAgeRule(jobApplication.DateOfBirth);
            if (!minHireAge.IsValid())
                throw new ApplicationException(String.Format("{0} was violated", minHireAge.Description));
            
            // stamp today's date
            jobApplication.DateSubmitted = DateTime.Now;

            try
            {
                this.jobApplicationRepository.Save(jobApplication);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #3
0
파일: Program.cs 프로젝트: WuLex/DDD
        static void CreateAndSubmitJobApplication()
        {
            JobApplication application = new JobApplication();
            ContactInfo applicant = new ContactInfo();
            applicant.Name = "Marcus Kvarnström";
            applicant.MailAddress = new Address();
            application.ContactInformation = applicant;
            application.Job = new SoftwareDeveloperJobSpecification();
            application.Skills = "I know almost everything and eager to learn what's left";
            application.DateOfBirth = new DateTime(1972, 8, 21);

            try
            {
                jobApplicantService.Submit(application);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
예제 #4
0
 public void Delete(JobApplication jobApplication)
 {
     Console.Write("Using {0}\n", this.GetType().ToString());
 }
예제 #5
0
        //private object notificationService;
 
        public JobApplicationRegistredEvent(JobApplication jobApplication)
        { }
예제 #6
0
 public void Save(JobApplication jobApplication)
 {
     Console.Write("Using {0} to save\n", this.GetType().ToString());
 }