public List <AggregatedEventViewModel> GetAggregatedList(CalendarPart part) { List <AggregatedEventViewModel> aggregatedList = new List <AggregatedEventViewModel>(); List <EventViewModel> eventList = GetEventList(part); eventList = OrderEventList(eventList, part); if (eventList != null) { foreach (var item in eventList) { if (aggregatedList.Any(x => ((dynamic)x).Content.Id == item.content.Id)) { var itemToUpdate = aggregatedList.Single(x => ((dynamic)x).Content.Id == item.content.Id); itemToUpdate.Occurrences.Add(new Occurrence { Start = item.start, End = item.end }); } else { List <Occurrence> occurrencesList = new List <Occurrence>(); occurrencesList.Add(new Occurrence { Start = item.start, End = item.end }); aggregatedList.Add(new AggregatedEventViewModel { Content = item.content, Occurrences = occurrencesList }); } } } return(aggregatedList); }
public List <EventViewModel> GetEventList(CalendarPart part) { try { string start = _tokenizer.Replace(part.StartDate, new Dictionary <string, object>()); if (!String.IsNullOrEmpty(start)) { int duration = 1; //Valore standard da usare se la conversione fallisce int.TryParse(_tokenizer.Replace(part.NumDays, new Dictionary <string, object>()), out duration); if (duration <= 0) { duration = 1; } DateTime startDate = Convert.ToDateTime(start, _cultureInfo.Value); return(GetEvents(part.QueryPartRecord.Id, startDate, startDate.AddDays(duration - 1), part)); } else { return(null); } } catch { return(null); } }
public static string Calendar(this UrlHelper urlHelper, CalendarPart calendarPart) { var ap = calendarPart.ContentItem.Get(typeof(AutoroutePart)) as AutoroutePart; return(ap != null && !string.IsNullOrWhiteSpace(ap.Path) ? "/" + ap.Path : urlHelper.Action("Item", "Calendar", new { calendarId = calendarPart.Identifier, area = "Orchard.CalendarEvents" })); }
public static string Calendar(this UrlHelper urlHelper, CalendarPart calendarPart) { var ap = calendarPart.ContentItem.Get(typeof (AutoroutePart)) as AutoroutePart; return ap != null && !string.IsNullOrWhiteSpace(ap.Path) ? "/" + ap.Path : urlHelper.Action("Item", "Calendar", new { calendarId = calendarPart.Identifier, area = "Orchard.CalendarEvents" }); }
public List <AggregatedEventViewModel> GetAggregatedList(CalendarPart part, int page, int pageSize) { List <AggregatedEventViewModel> aggregatedList = GetAggregatedList(part); Pager pager = new Pager(_orchardServices.WorkContext.CurrentSite, page, pageSize); aggregatedList = aggregatedList.Skip(pager.GetStartIndex()).Take(pager.PageSize).ToList(); return(aggregatedList); }
private bool IsChecked(CalendarPart part, string id) { var categoryIdentifiers = _categoryService.GetEventCategoryIdentifiers(part.Categories.Select(x => x.Id)); if (part.Categories != null) { return(part.Categories.Any() && categoryIdentifiers .Contains(id)); } return(false); }
public IEnumerable <EventPart> GetEventsForCalendar(CalendarPart calendarItem, VersionOptions versionOptions) { var session = _transactionManager.GetSession(); // _sessionLocator.For(typeof(EventPartRecord)); var eventQuery = session.CreateQuery(EventQuery(calendarItem.ContentItem.Id)); var ids = eventQuery.List <int>(); var events = _contentManager.GetMany <EventPart>(ids, VersionOptions.Latest, QueryHints.Empty) .FilterEventParts(_services.WorkContext.CurrentUser) .OrderBy(x => x.StartDate); return(events); }
public IEnumerable<FormattedEvent> GetFormattedCalendarEvents(CalendarPart part) { var contentItems = _projectionManager.GetContentItems(part.QueryId); var provider = _calendarProviders.SingleOrDefault(p => p.Name == part.Plugin); if (provider == null) { // fallback to default provider = _calendarProviders.Single(p => p.Name == "Default"); } var models = provider.FormatCalendarEvents(contentItems); return models; }
private string GetStartDate(ContentItem content) { CalendarPart calendar = content == null ? null : content.As <CalendarPart>(); if (calendar == null) { return(null); } else { return(_tokenizer.Replace(calendar.StartDate, new Dictionary <string, object>())); } }
public EditCalendarPartViewModel CreateEditViewModel(CalendarPart part) { //var settings = part.PartDefinition.Settings.GetModel<SharedEventCategorySettings>(); var data = new EditCalendarPartViewModel { Title = part.Title, Description = part.Description, ShortDescription = part.ShortDescription, FeedProxyUrl = part.FeedProxyUrl, Categories = GetCategoryEntries(part), SelectedEventCategoryIds = string.Join(",", _categoryService.GetEventCategoryIdentifiers(part.Categories.Select(x => x.Id))), }; return(data); }
public List <EventViewModel> OrderEventList(List <EventViewModel> list, CalendarPart part) { List <SortCriterionRecord> sortCriteriaList = part.QueryPartRecord.SortCriteria.ToList(); if (sortCriteriaList != null) { sortCriteriaList = sortCriteriaList.Where(x => x.Category == "ActivityPart").OrderBy(x => x.Position).ToList(); var orderedList = list.OrderBy(x => 0); foreach (SortCriterionRecord sortRecord in sortCriteriaList) { switch (sortRecord.Type) { case "DateTimeStart": { if (sortRecord.State.Contains("<Sort>true</Sort>")) { orderedList = orderedList.ThenBy(x => x.start); } else if (sortRecord.State.Contains("<Sort>false</Sort>")) { orderedList = orderedList.ThenByDescending(x => x.start); } break; } case "DateTimeEnd": { if (sortRecord.State.Contains("<Sort>true</Sort>")) { orderedList = orderedList.ThenBy(x => x.end); } else if (sortRecord.State.Contains("<Sort>false</Sort>")) { orderedList = orderedList.ThenByDescending(x => x.end); } break; } } } return(orderedList.ToList()); } else { return(list); } }
public IEnumerable <FormattedEvent> GetFormattedCalendarEvents(CalendarPart part) { var contentItems = _projectionManager.GetContentItems(part.QueryId); var provider = _calendarProviders.SingleOrDefault(p => p.Name == part.Plugin); if (provider == null) { // fallback to default provider = _calendarProviders.Single(p => p.Name == "Default"); } var models = provider.FormatCalendarEvents(contentItems); return(models); }
private List <CategoryEntry> GetCategoryEntries(CalendarPart part) { var categories = _categoryService.GetEventCategories(); var data = categories.Select(c => new CategoryEntry { ContentItem = c.ContentItem, Identifier = c.Identifier, Id = c.Id, IsChecked = IsChecked(part, c.Identifier), Selectable = true, Name = c.CategoryName }).ToList(); return(data); }
public IEnumerable <EventPart> GetUpcomingEventsForCalendar(CalendarPart calendar, VersionOptions versionOptions, int count) { if (calendar == null) { return(new List <EventPart>()); } var session = _transactionManager.GetSession(); //_sessionLocator.For(typeof (EventPartRecord)); var eventQuery = session.CreateQuery(EventQuery(calendar.ContentItem.Id, DateTime.Today)); //.SetMaxResults(count); // Can't Use becuase of Permission Filtering var ids = eventQuery.List <int>(); var events = _contentManager.GetMany <EventPart>(ids, VersionOptions.Latest, QueryHints.Empty) .FilterEventParts(_services.WorkContext.CurrentUser) .OrderBy(x => x.StartDate); return(count > 0 ? events.Take(count) : events); }
public SchedulerViewModel CreateSchedulerViewModel(CalendarPart calendar) { var eventCategories = _categoryService .GetEventCategoriesByCalendar(calendar.ContentItem); var data = new SchedulerViewModel { Identifier = calendar.Identifier, Title = calendar.Title, Summary = calendar.ShortDescription, EventCategories = eventCategories.Select(x => new CategoryEntry { Identifier = x.Identifier, Name = x.CategoryName, Description = x.Description, IsChecked = calendar.Categories.Any(cat => cat.Id == x.Id), }).ToList(), }; return(data); }
private string GetEndDate(ContentItem content) { CalendarPart calendar = content == null ? null : content.As <CalendarPart>(); if (calendar == null) { return(null); } else { DateTime startDate = Convert.ToDateTime(_tokenizer.Replace(calendar.StartDate, new Dictionary <string, object>()), _cultureInfo.Value); int duration = 1; //Valore standard da usare se la conversione fallisce int.TryParse(_tokenizer.Replace(calendar.NumDays, new Dictionary <string, object>()), out duration); if (duration <= 0) { duration = 1; } return(startDate.AddDays(duration - 1).ToString(_cultureInfo.Value)); } }
protected void LoadCalendar(LoadContentContext context, CalendarPart part) { //base.Loaded(context); if (_requestContext.HttpContext.Handler != null) { if (_requestContext.HttpContext.Request.RequestContext != null) //non-routed requests { string usedController = _requestContext.HttpContext.Request.RequestContext.RouteData.Values["Controller"].ToString().ToLower(); if (usedController == "json") { //if (context.ContentItem.Parts.SingleOrDefault(x => x.PartDefinition.Name == "CalendarPart") == null) // return; //var calendarPart = (CalendarPart)context.ContentItem.Parts.SingleOrDefault(x => x.PartDefinition.Name == "CalendarPart"); part._eventList.Loader(() => { return(_eventsService.GetAggregatedList(part)); }); } } } }
public IEnumerable<EventPart> GetUpcomingEventsForCalendar(CalendarPart calendar, VersionOptions versionOptions, int count) { if(calendar == null) { return new List<EventPart>(); } var session = _transactionManager.GetSession(); //_sessionLocator.For(typeof (EventPartRecord)); var eventQuery = session.CreateQuery(EventQuery(calendar.ContentItem.Id, DateTime.Today)); //.SetMaxResults(count); // Can't Use becuase of Permission Filtering var ids = eventQuery.List<int>(); var events = _contentManager.GetMany<EventPart>(ids, VersionOptions.Latest, QueryHints.Empty) .FilterEventParts(_services.WorkContext.CurrentUser) .OrderBy(x => x.StartDate); return count > 0 ? events.Take(count) : events; }
public IEnumerable<EventPart> GetEventsForCalendarByDate(CalendarPart calendar, DateTime? startDate, DateTime? endDate, VersionOptions versionOptions) { if (calendar == null) { return new List<EventPart>(); } var session = _transactionManager.GetSession(); //_sessionLocator.For(typeof(EventPartRecord)); var eventQuery = session.CreateQuery(EventQuery(calendar.ContentItem.Id, startDate, endDate)); var ids = eventQuery.List<int>(); var events = _contentManager.GetMany<EventPart>(ids, VersionOptions.Latest, QueryHints.Empty) .FilterEventParts(_services.WorkContext.CurrentUser) .OrderBy(x => x.StartDate); return events; }
public IEnumerable <SchedulerEventViewModel> SchedulerEventsForCalendar(CalendarPart calendar) { var events = _eventService.SchedulerEventsForCalendarIdentity(calendar.Identifier, null); return(events); }
private bool IsChecked(CalendarPart part, string id) { var categoryIdentifiers = _categoryService.GetEventCategoryIdentifiers(part.Categories.Select(x => x.Id)); if (part.Categories != null) return part.Categories.Any() && categoryIdentifiers .Contains(id); return false; }
private List<CategoryEntry> GetCategoryEntries(CalendarPart part) { var categories = _categoryService.GetEventCategories(); var data = categories.Select(c => new CategoryEntry { ContentItem = c.ContentItem, Identifier = c.Identifier, Id = c.Id, IsChecked = IsChecked(part, c.Identifier), Selectable = true, Name = c.CategoryName }).ToList(); return data; }
public EditCalendarPartViewModel CreateEditViewModel(CalendarPart part) { //var settings = part.PartDefinition.Settings.GetModel<SharedEventCategorySettings>(); var data = new EditCalendarPartViewModel { Title = part.Title, Description = part.Description, ShortDescription = part.ShortDescription, FeedProxyUrl = part.FeedProxyUrl, Categories = GetCategoryEntries(part), SelectedEventCategoryIds = string.Join(",", _categoryService.GetEventCategoryIdentifiers(part.Categories.Select(x => x.Id))), }; return data; }
public List <EventViewModel> GetEvents(int queryId, DateTime intervalStart, DateTime intervalEnd, CalendarPart part = null, bool addDayForThreshold = false) { List <EventViewModel> list = new List <EventViewModel>(); //Recupero tutti gli eventi dalla query associata al calendario //var eventArray = _projectionManager.GetContentItems(queryId, 0, 0, part == null ? null : new Dictionary<string, object> { { "Content", part } }).ToList(); var eventArray = _projectionManager.GetContentItems(queryId, 0, 0); //TODO: issue when we want to do tokenized queries from widgets //Recupero gli eventi senza ripetizione e li aggiungo al calendario var listNoRepeat = new List <EventViewModel>(); listNoRepeat = eventArray .Where(w => ((dynamic)w).ActivityPart.Repeat == false) .Select(s => new EventViewModel { content = ((dynamic)s), start = ((dynamic)s).ActivityPart.AllDay ? ((dynamic)s).ActivityPart.DateTimeStart.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture) : ((dynamic)s).ActivityPart.DateTimeStart.ToString("yyyy-MM-ddTHH:mm", CultureInfo.InvariantCulture), end = ((dynamic)s).ActivityPart.AllDay ? (addDayForThreshold ? ((dynamic)s).ActivityPart.DateTimeEnd.AddDays(1).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture) : ((dynamic)s).ActivityPart.DateTimeEnd.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture) ) : ((dynamic)s).ActivityPart.DateTimeEnd.ToString("yyyy-MM-ddTHH:mm", CultureInfo.InvariantCulture) } ) .ToList(); list.AddRange(listNoRepeat); //Recupero gli eventi con ripetizione giornaliera ed elaboro la loro aggiunta al calendario var listDayRepeat = new List <ContentItem>(); listDayRepeat = eventArray .Where(w => ((dynamic)w).ActivityPart.Repeat == true && ((dynamic)w).ActivityPart.RepeatType == "D") .ToList(); foreach (var item in listDayRepeat) { bool allday = ((dynamic)item).ActivityPart.AllDay; DateTime eventStartDate = ((dynamic)item).ActivityPart.DateTimeStart; DateTime eventEndDate = ((dynamic)item).ActivityPart.DateTimeEnd; int eventDuration = (eventEndDate.Date - eventStartDate.Date).Days; //Uniformo la rappresentazione delle date, poiché in fullcalendar se allDay vale true il giorno finale è incluso e se vale false invece è escluso if (allday && addDayForThreshold) { eventDuration += 1; } DateTime startDate = new DateTime(Math.Max(intervalStart.AddDays(-eventDuration).Ticks, eventStartDate.Ticks)); DateTime endDate; if (((dynamic)item).ActivityPart.RepeatEnd) { endDate = new DateTime(Math.Min(intervalEnd.Ticks, (((dynamic)item).ActivityPart.RepeatEndDate).Ticks)); } else { endDate = intervalEnd; } string startTimePart = ""; string endTimePart = ""; if (!allday) { startTimePart = "T" + eventStartDate.ToString("HH:mm", CultureInfo.InvariantCulture); if (!eventEndDate.ToString("HH:mm", CultureInfo.InvariantCulture).Equals("00:00")) { endTimePart = "T" + eventEndDate.ToString("HH:mm", CultureInfo.InvariantCulture); } else { endTimePart = "T23:59"; } } DateTime loopDate = startDate; while (DateTime.Compare(loopDate.Date, endDate.Date) <= 0) { list.Add(new EventViewModel { content = ((dynamic)item), start = loopDate.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture) + startTimePart, end = loopDate.AddDays(eventDuration).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture) + endTimePart }); loopDate = loopDate.AddDays(((dynamic)item).ActivityPart.RepeatValue); } } //Recupero gli eventi con ripetizione settimanale ed elaboro la loro aggiunta al calendario var listWeekRepeat = new List <ContentItem>(); listWeekRepeat = eventArray .Where(w => ((dynamic)w).ActivityPart.Repeat == true && ((dynamic)w).ActivityPart.RepeatType == "W") .ToList(); foreach (var item in listWeekRepeat) { bool allday = ((dynamic)item).ActivityPart.AllDay; DateTime eventStartDate = ((dynamic)item).ActivityPart.DateTimeStart; DateTime eventEndDate = ((dynamic)item).ActivityPart.DateTimeEnd; int eventDuration = (eventEndDate.Date - eventStartDate.Date).Days; //Uniformo la rappresentazione delle date, poiché in fullcalendar se allDay vale true il giorno finale è incluso e se vale false invece è escluso if (allday && addDayForThreshold) { eventDuration += 1; } string startTimePart = ""; string endTimePart = ""; if (!allday) { startTimePart = "T" + eventStartDate.ToString("HH:mm", CultureInfo.InvariantCulture); if (!eventEndDate.ToString("HH:mm", CultureInfo.InvariantCulture).Equals("00:00")) { endTimePart = "T" + eventEndDate.ToString("HH:mm", CultureInfo.InvariantCulture); } else { endTimePart = "T23:59"; } } string repeatDetails = ((dynamic)item).ActivityPart.RepeatDetails; DateTime loopDate = intervalStart.AddDays(-eventDuration); while (DateTime.Compare(loopDate.Date, intervalEnd.Date) <= 0) { bool repeat = ((dynamic)item).ActivityPart.RepeatEnd ? DateTime.Compare(loopDate.Date, ((dynamic)item).ActivityPart.RepeatEndDate.Date) <= 0 : true; int weeksPassed = (loopDate.Date - eventStartDate.Date).Days / 7; if (repeatDetails.Contains(loopDate.DayOfWeek.ToString()) && DateTime.Compare(loopDate.Date, eventStartDate.Date) >= 0 && (weeksPassed % ((dynamic)item).ActivityPart.RepeatValue) == 0 && repeat) { list.Add(new EventViewModel { content = ((dynamic)item), start = loopDate.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture) + startTimePart, end = loopDate.AddDays(eventDuration).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture) + endTimePart }); } loopDate = loopDate.AddDays(1); } } //Recupero gli eventi con ripetizione mensile ed elaboro la loro aggiunta al calendario var listMonthRepeat = new List <ContentItem>(); listMonthRepeat = eventArray .Where(w => ((dynamic)w).ActivityPart.Repeat == true && ((dynamic)w).ActivityPart.RepeatType == "M") .ToList(); foreach (var item in listMonthRepeat) { bool allday = ((dynamic)item).ActivityPart.AllDay; DateTime eventStartDate = ((dynamic)item).ActivityPart.DateTimeStart; DateTime eventEndDate = ((dynamic)item).ActivityPart.DateTimeEnd; int eventDuration = (eventEndDate.Date - eventStartDate.Date).Days; //Uniformo la rappresentazione delle date, poiché in fullcalendar se allDay vale true il giorno finale è incluso e se vale false invece è escluso if (allday && addDayForThreshold) { eventDuration += 1; } string startTimePart = ""; string endTimePart = ""; if (!allday) { startTimePart = "T" + eventStartDate.ToString("HH:mm", CultureInfo.InvariantCulture); if (!eventEndDate.ToString("HH:mm", CultureInfo.InvariantCulture).Equals("00:00")) { endTimePart = "T" + eventEndDate.ToString("HH:mm", CultureInfo.InvariantCulture); } else { endTimePart = "T23:59"; } } DateTime loopEnd; if (((dynamic)item).ActivityPart.RepeatEnd) { loopEnd = new DateTime(Math.Min(intervalEnd.Ticks, (((dynamic)item).ActivityPart.RepeatEndDate).Ticks)); } else { loopEnd = intervalEnd; } DateTime loopDate = eventStartDate; //Ripetizione per numero di mese if (((dynamic)item).ActivityPart.RepeatDetails.Contains("DayNum")) { int monthDifference = 0; while (DateTime.Compare(loopDate.Date, loopEnd.Date) <= 0) { if (DateTime.Compare(loopDate.Date, intervalStart.Date) >= 0 || (DateTime.Compare(loopDate.Date, intervalStart.Date) < 0 && DateTime.Compare(loopDate.AddDays(eventDuration).Date, intervalStart.Date) >= 0)) { list.Add(new EventViewModel { content = ((dynamic)item), start = loopDate.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture) + startTimePart, end = loopDate.AddDays(eventDuration).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture) + endTimePart }); } //Calcolo la differenza in mesi a partire dalla data iniziale ed effettuo l'aggiunta di mesi a partire da essa //Se non facessi così, ad esempio un loop sul 30 del mese verrebbe spostato al 28/29 dopo Febbraio monthDifference = (loopDate.Year - eventStartDate.Year) * 12 + loopDate.Month - eventStartDate.Month; loopDate = eventStartDate.AddMonths(monthDifference + ((dynamic)item).ActivityPart.RepeatValue); } } else if (((dynamic)item).ActivityPart.RepeatDetails.Contains("DayWeek")) { int nthInMonth = (int)Math.Ceiling(Decimal.Divide(eventStartDate.Day, 7)); while (DateTime.Compare(loopDate.Date, loopEnd.Date) <= 0) { DateTime eventDate; if (DateTime.Compare(loopDate.Date, eventStartDate.Date) == 0) { eventDate = eventStartDate; } else { eventDate = getNthDayOfMonth(eventStartDate.DayOfWeek, nthInMonth, loopDate.Month, loopDate.Year); } if (DateTime.Compare(eventDate.Date, intervalStart.Date) >= 0 || (DateTime.Compare(eventDate.Date, intervalStart.Date) < 0 && DateTime.Compare(eventDate.AddDays(eventDuration).Date, intervalStart.Date) >= 0)) { list.Add(new EventViewModel { content = ((dynamic)item), start = eventDate.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture) + startTimePart, end = eventDate.AddDays(eventDuration).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture) + endTimePart }); } loopDate = loopDate.AddMonths(((dynamic)item).ActivityPart.RepeatValue); } } } //Recupero gli eventi con ripetizione annuale ed elaboro la loro aggiunta al calendario var listYearRepeat = new List <ContentItem>(); listYearRepeat = eventArray .Where(w => ((dynamic)w).ActivityPart.Repeat == true && ((dynamic)w).ActivityPart.RepeatType == "Y") .ToList(); foreach (var item in listYearRepeat) { bool allday = ((dynamic)item).ActivityPart.AllDay; DateTime eventStartDate = ((dynamic)item).ActivityPart.DateTimeStart; DateTime eventEndDate = ((dynamic)item).ActivityPart.DateTimeEnd; int eventDuration = (eventEndDate.Date - eventStartDate.Date).Days; //Uniformo la rappresentazione delle date, poiché in fullcalendar se allDay vale true il giorno finale è incluso e se vale false invece è escluso if (allday && addDayForThreshold) { eventDuration += 1; } string endTimePart = ""; if (!allday) { if (!eventEndDate.ToString("HH:mm", CultureInfo.InvariantCulture).Equals("00:00")) { endTimePart = "T" + eventEndDate.ToString("HH:mm", CultureInfo.InvariantCulture); } else { endTimePart = "T23:59"; } } DateTime loopDate; int loopEnd = ((dynamic)item).ActivityPart.RepeatEnd ? Math.Min(intervalEnd.Year, (((dynamic)item).ActivityPart.RepeatEndDate).Year) : intervalEnd.Year; for (int year = eventStartDate.Year; year <= loopEnd; year = year + ((dynamic)item).ActivityPart.RepeatValue) { loopDate = new DateTime(year, eventStartDate.Month, eventStartDate.Day, eventStartDate.Hour, eventStartDate.Minute, eventStartDate.Second); bool repeat = ((dynamic)item).ActivityPart.RepeatEnd ? DateTime.Compare(loopDate.Date, ((dynamic)item).ActivityPart.RepeatEndDate.Date) <= 0 : true; if (DateTime.Compare(loopDate.Date, intervalEnd.Date) <= 0 && (DateTime.Compare(loopDate.Date, intervalStart.Date) >= 0 || (DateTime.Compare(loopDate.Date, intervalStart.Date) < 0 && DateTime.Compare(loopDate.AddDays(eventDuration).Date, intervalStart.Date) >= 0)) && repeat) { list.Add(new EventViewModel { content = ((dynamic)item), start = allday ? loopDate.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture) : loopDate.ToString("yyyy-MM-ddTHH:mm", CultureInfo.InvariantCulture), end = loopDate.AddDays(eventDuration).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture) + endTimePart }); } } } return(list); }
public static string CalendarSubscribeIcs(this UrlHelper urlHelper, CalendarPart calendarPart) { return urlHelper.Action("SubscribeIcs", "Calendar", new { calendarId = calendarPart.Identifier, fileName = calendarPart.Title, area = "Orchard.CalendarEvents" }); }
public static string CalendarEdit(this UrlHelper urlHelper, CalendarPart calendarPart) { return urlHelper.Action("Edit", "CalendarAdmin", new { calendarId = calendarPart.Identifier, area = "Orchard.CalendarEvents" }); }
public static string CalendarSubscribeIcs(this UrlHelper urlHelper, CalendarPart calendarPart) { return(urlHelper.Action("SubscribeIcs", "Calendar", new { calendarId = calendarPart.Identifier, fileName = calendarPart.Title, area = "Orchard.CalendarEvents" })); }
public static string CalendarEdit(this UrlHelper urlHelper, CalendarPart calendarPart) { return(urlHelper.Action("Edit", "CalendarAdmin", new { calendarId = calendarPart.Identifier, area = "Orchard.CalendarEvents" })); }
public static string CalendarRemoveById(this UrlHelper urlHelper, CalendarPart calendarPart) { return urlHelper.Action("RemoveById", "CalendarAdmin", new { calendarId = calendarPart.Id, area = "Orchard.CalendarEvents" }); }
public SchedulerViewModel CreateSchedulerViewModel(CalendarPart calendar) { var eventCategories = _categoryService .GetEventCategoriesByCalendar(calendar.ContentItem); var data = new SchedulerViewModel { Identifier = calendar.Identifier, Title = calendar.Title, Summary = calendar.ShortDescription, EventCategories = eventCategories.Select(x=> new CategoryEntry { Identifier = x.Identifier, Name = x.CategoryName, Description = x.Description, IsChecked = calendar.Categories.Any(cat => cat.Id == x.Id), }).ToList(), }; return data; }
public static string CalendarRemoveById(this UrlHelper urlHelper, CalendarPart calendarPart) { return(urlHelper.Action("RemoveById", "CalendarAdmin", new { calendarId = calendarPart.Id, area = "Orchard.CalendarEvents" })); }
public IEnumerable<SchedulerEventViewModel> SchedulerEventsForCalendar(CalendarPart calendar) { var events = _eventService.SchedulerEventsForCalendarIdentity(calendar.Identifier, null); return events; }