Пример #1
0
 private string GetTime(JobPosting jobPosting)
 {
     if (jobPosting.TimePosted.Day == DateTime.Now.Day)
     {
         return jobPosting.TimePosted.ToString("t");
     }
     else
     {
         return string.Format("{0} {1}", jobPosting.TimePosted.ToString("t"), jobPosting.TimePosted.ToString("m"));
     }
 }
Пример #2
0
        private string GetLanguagePairs(JobPosting jobPosting)
        {
            var languagePairs = jobPosting.LanguagePairs.Count > 0
                ? jobPosting.LanguagePairs.Select(lp => LanguagePair.CreateLanguagePair(lp, _languages))
                    .Where(lp => lp != null)
                    .ToList()
                : new List<LanguagePair>();

            var result = new StringBuilder();
            for (var i = 0; i < languagePairs.Count; i++)
            {
                var languagePair = languagePairs[i];
                if (i == languagePairs.Count - 1)
                {
                    result.Append(string.Format("{0} to {1}", languagePair.Source.LanguageName,
                   languagePair.Target.LanguageName));
                }
                else
                {
                    result.AppendLine(string.Format("{0} to {1}", languagePair.Source.LanguageName,
                   languagePair.Target.LanguageName));
                }
            }
            return result.ToString();
        }
Пример #3
0
 private string GetVolume(JobPosting jobPosting)
 {
     if (jobPosting.VolumeAmount == 0) return "No Amount";
     return string.Format("{0} {1}", jobPosting.VolumeAmount, jobPosting.VolumeUnit);
 }