public override void Submit(JobApplication jobApplication) { // implement base behavoiur base.Submit(jobApplication); // write message to notification queue notificationService.Enqueue(jobApplication.ToString(), jobApplication.JobApplicationID.ToString()); }
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; } }
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); } }
public void Delete(JobApplication jobApplication) { Console.Write("Using {0}\n", this.GetType().ToString()); }
//private object notificationService; public JobApplicationRegistredEvent(JobApplication jobApplication) { }
public void Save(JobApplication jobApplication) { Console.Write("Using {0} to save\n", this.GetType().ToString()); }