/// <summary> /// Gets the federal holidays. /// </summary> /// <returns> /// </returns> public IDictionary <Field, DateTime> GetFederalHolidays() { try { var holidays = new Dictionary <Field, DateTime>(); var holidayfactory = new HolidayFactory(Record); holidays.Add(Field.NewYears, DateTime.Parse(holidayfactory.GetNewYearsDay().GetValue())); holidays.Add(Field.MartinLutherKing, DateTime.Parse(holidayfactory.GetMartinLutherKingDay().GetValue())); holidays.Add(Field.Memorial, DateTime.Parse(holidayfactory.GetMemorialDay().GetValue())); holidays.Add(Field.Presidents, DateTime.Parse(holidayfactory.GetPresidentsDay().GetValue())); holidays.Add(Field.Veterans, DateTime.Parse(holidayfactory.GetVeteransDay().GetValue())); holidays.Add(Field.Labor, DateTime.Parse(holidayfactory.GetLaborDay().GetValue())); holidays.Add(Field.Independence, DateTime.Parse(holidayfactory.GetIndependenceDay().GetValue())); holidays.Add(Field.Columbus, DateTime.Parse(holidayfactory.GetColumbusDay().GetValue())); holidays.Add(Field.Thanksgiving, DateTime.Parse(holidayfactory.GetThanksgivingDay().GetValue())); holidays.Add(Field.Christmas, DateTime.Parse(holidayfactory.GetChristmasDay().GetValue())); return(holidays.Any() ? holidays : default);
/// <summary> /// Initializes a new instance of the <see cref = "BudgetFiscalYear"/> class. /// </summary> /// <param name = "fy" > /// The fy <see cref = "BFY"/> /// </param> public BudgetFiscalYear(BFY fy) { Record = new DataBuilder(Source, Provider.SQLite, SetArgs(fy))?.GetRecord(); FiscalYearId = new Key(Record, PrimaryKey.FiscalYearId); BBFY = new Element(Record, Field.BBFY); EBFY = new Element(Record, Field.EBFY); Availablity = new Element(Record, Field.Availability); FirstYear = new Element(Record, Field.FirstYear); LastYear = new Element(Record, Field.LastYear); Holidays = new HolidayFactory(Record); WorkDays = new Element(Record, Field.WorkDays); WeekDays = new Element(Record, Field.WeekDays); WeekEnds = new Element(Record, Field.WeekEnds); ExpiringYear = new Element(Record, Field.ExpiringYear); StartDate = new Element(Record, Field.StartDate); EndDate = new Element(Record, Field.EndDate); CancellationDate = new Element(Record, Field.CancellationDate); Data = Record?.ToDictionary(); }
/// <summary> /// Initializes a new instance of the <see cref = "BudgetFiscalYear"/> class. /// </summary> /// <param name = "data" > /// The data <see cref = "DataRow"/> /// </param> public BudgetFiscalYear(DataRow data) { Record = data; InputYear = new Element(Record, GetCurrentYear().ToString()); FiscalYearId = new Key(Record, PrimaryKey.FiscalYearId); BBFY = new Element(Record, Field.BBFY); EBFY = new Element(Record, Field.EBFY); Availablity = new Element(Record, Field.Availability); FirstYear = new Element(Record, Field.FirstYear); LastYear = new Element(Record, Field.LastYear); Holidays = new HolidayFactory(Record); WorkDays = new Element(Record, Field.WorkDays); WeekDays = new Element(Record, Field.WeekDays); WeekEnds = new Element(Record, Field.WeekEnds); ExpiringYear = new Element(Record, Field.ExpiringYear); StartDate = new Element(Record, Field.StartDate); EndDate = new Element(Record, Field.EndDate); CancellationDate = new Element(Record, Field.CancellationDate); Data = Record?.ToDictionary(); }