private static string ExtractAdData(JobAd ad) { var place = ad.Town; if (place == "") { place = ad.Municipality; } return(string.Concat(ad.Recruiter, ",", place, ",", ad.OccupationFiltered, ",", DateTime.Today.ToString("yyyy-MM-dd"))); }
public static void SaveCSV(string folderPath, JobAd ad) { var fileName = DateTime.Today.ToString("yyyy-MM") + ".csv"; var filePath = Path.Combine(folderPath, fileName); if (!File.Exists(filePath)) { File.WriteAllText(filePath, GetHeadline()); } using (var stream = File.AppendText(filePath)) { stream.WriteLine(ExtractAdData(ad)); } }
public void SetAd(JobAd ad) { if (ad == null) { return; } _ad = ad; gameObject.name = ad.Headline; _headlineText.text = ad.Headline; _descriptionText.text = ad.Description; _appliedNotifierObject.gameObject.SetActive(ad.Applied); _occupationText.text = "Yrke: " + ad.OccupationFiltered; _occupationGroupText.text = "Yrkeskategori: " + ad.OccupationGroupFiltered; _occupationFieldText.text = "Yrkesfält: " + ad.OccupationField; _municipalityText.text = "Region: " + ad.Municipality; _townText.text = "Stad: " + ad.Town; _deadlineText.text = "Deadline: " + ad.ApplicationDeadline; // _afUrlText.text = ad.AfUrl; _recruiterText.text = "Rekryterare: " + ad.Recruiter; _employerText.text = "Anställare: " + ad.Workplace; if (ad.ApplicationEmail == "") { _emailText.gameObject.SetActive(false); } _emailText.text = "Mail: " + ad.ApplicationEmail; if (ad.ApplicationUrl == "") { _applicationUrlButton.SetActive(false); } // _applyUrlText.text = ad.ApplicationUrl; if (ad.Applied) { _applyButton.isOn = false; _applyButton.gameObject.SetActive(false); } }