public static bool CheckHolidays(DateTime date, UstServiceContext svcContext) { //Business Closure Calendar CMV_ITC_DATA.Calendar calendars = svcContext.CalendarSet.FirstOrDefault(c => c.Name == "Holiday Schedule-Cartera"); return(calendars.CalendarRules.Any(e => e.StartTime.Value.Equals(date.Date))); }
protected void InitializeServices(IServiceProvider serviceProvider) { context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext)); factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory)); iServices = factory.CreateOrganizationService(context.UserId); svcContext = new UstServiceContext(iServices); }