private static JobAd PostTestJobAd(this IJobAdsCommand jobAdsCommand, JobAd jobAd, JobAdStatus jobStatus) { jobAdsCommand.CreateJobAd(jobAd); switch (jobStatus) { case JobAdStatus.Open: jobAdsCommand.OpenJobAd(jobAd); break; case JobAdStatus.Closed: jobAdsCommand.OpenJobAd(jobAd); jobAdsCommand.CloseJobAd(jobAd); break; case JobAdStatus.Deleted: jobAdsCommand.DeleteJobAd(jobAd); break; default: //do nothing - job is created in draft state break; } return(jobAd); }
void IEmployerJobAdsCommand.DeleteJobAd(IEmployer employer, JobAdEntry jobAd) { if (!CanAccess(employer, jobAd)) { throw new JobAdPermissionsException(employer, jobAd.Id); } _jobAdsCommand.DeleteJobAd(jobAd); }
private static JobAd PostTestJobAd(this IJobAdsCommand jobAdsCommand, JobAd jobAd, JobAdStatus jobStatus) { jobAdsCommand.CreateJobAd(jobAd); switch (jobStatus) { case JobAdStatus.Open: jobAdsCommand.OpenJobAd(jobAd); break; case JobAdStatus.Closed: jobAdsCommand.OpenJobAd(jobAd); jobAdsCommand.CloseJobAd(jobAd); break; case JobAdStatus.Deleted: jobAdsCommand.DeleteJobAd(jobAd); break; } return(jobAd); }