Esempio n. 1
0
        /// <summary>
        ///     Returns the latest SIC Codes before specified date/time
        /// </summary>
        /// <param name="maxDate">Ignore SIC codes changes after this date/time - if empty returns the latest SIC codes</param>
        /// <returns>The employer SIC codes</returns>
        public IEnumerable <OrganisationSicCode> GetSicCodes(DateTime?maxDate = null)
        {
            if (maxDate == null || maxDate.Value == DateTime.MinValue)
            {
                maxDate = SectorType.GetAccountingStartDate().AddYears(1);
            }

            return(OrganisationSicCodes.Where(s => s.Created < maxDate.Value && (s.Retired == null || s.Retired.Value > maxDate.Value)));
        }
 public IEnumerable <OrganisationSicCode> GetLatestSicCodes()
 {
     return(OrganisationSicCodes.Where(s => s.Retired == null).OrderByDescending(s => s.Created));
 }
 /// <summary>
 ///     Returns the latest organisation name before specified date/time
 /// </summary>
 /// <param name="accountingDate">Ignore name changes after this date/time - if empty returns the latest name</param>
 /// <returns>The name of the organisation</returns>
 public IEnumerable <OrganisationSicCode> GetSicCodes(DateTime accountingDate)
 {
     return(OrganisationSicCodes.Where(s =>
                                       s.Created < accountingDate && (s.Retired == null || s.Retired.Value > accountingDate)));
 }
 public string GetLatestSicSource()
 {
     return(OrganisationSicCodes.Where(s =>
                                       s.Retired == null).OrderByDescending(s => s.Created).FirstOrDefault()
            ?.Source);
 }