public ActionResult AddMobileJobAds(Guid[] jobAdIds) { try { // Look for the folder. var member = CurrentMember; var folder = _jobAdFoldersQuery.GetMobileFolder(member); if (folder == null) { return(JsonNotFound("folder")); } // Add jobads. var count = _memberJobAdListsCommand.AddJobAdsToFolder(member, folder, jobAdIds); return(Json(new JsonListCountModel { Id = folder.Id, Count = count })); } catch (UserException ex) { ModelState.AddModelError(ex, new StandardErrorHandler()); } return(Json(new JsonResponseModel())); }
public void TestIsInMobileFolder() { var poster = CreateEmployer(); var jobAd = PostJobAd(poster); var member = CreateMember(); var folder = _jobAdFoldersQuery.GetMobileFolder(member); _memberJobAdListsCommand.AddJobAdToFolder(member, folder, jobAd.Id); LogIn(member); // Get the job. Get(GetJobUrl(jobAd.Id)); AssertIsInMobileFolder(true); }
public void TestIsInMobileFolder() { var jobAd = CreateJobAd(); var member = CreateMember(0); var folder = _jobAdFoldersQuery.GetMobileFolder(member); _memberJobAdListsCommand.AddJobAdToFolder(member, folder, jobAd.Id); LogIn(member); // Get the job. Search(Keywords); var node = GetResult(jobAd.Id); AssertIsInMobileFolder(node, true); }
private JobAdFolder GetMobileFolder(IMember member) { return(_jobAdFoldersQuery.GetMobileFolder(member)); }