public TimetableAppointmentPart Get(TimetablePart TimetablePart, string slug, VersionOptions versionOptions) {
     var postSlug = TimetablePart.As<IRoutableAspect>().GetChildPath(slug);
     return
         _contentManager.Query(versionOptions, "TimetableAppointment").Join<RoutePartRecord>().Where(rr => rr.Path == postSlug).
             Join<CommonPartRecord>().Where(cr => cr.Container == TimetablePart.Record.ContentItemRecord).List().
             SingleOrDefault().As<TimetableAppointmentPart>();
 }
        public IEnumerable<TimetableAppointmentPart> Get(TimetablePart TimetablePart, ArchiveData archiveData) {
            var query = GetTimetableQuery(TimetablePart, VersionOptions.Published);

            if (archiveData.Day > 0) {
                var dayDate = new DateTime(archiveData.Year, archiveData.Month, archiveData.Day);

                query = query.Where(cr => cr.CreatedUtc >= dayDate && cr.CreatedUtc < dayDate.AddDays(1));
            }
            else if (archiveData.Month > 0)
            {
                var monthDate = new DateTime(archiveData.Year, archiveData.Month, 1);

                query = query.Where(cr => cr.CreatedUtc >= monthDate && cr.CreatedUtc < monthDate.AddMonths(1));
            }
            else {
                var yearDate = new DateTime(archiveData.Year, 1, 1);

                query = query.Where(cr => cr.CreatedUtc >= yearDate && cr.CreatedUtc < yearDate.AddYears(1));
            }

            return query.List().Select(ci => ci.As<TimetableAppointmentPart>());
        }
예제 #3
0
 public static string TimetableArchiveDay(this UrlHelper urlHelper, TimetablePart TimetablePart, int year, int month, int day) {
     return urlHelper.Action("ListByArchive", "TimetableAppointment", new { TimetableSlug = TimetablePart.As<IRoutableAspect>().Path, archiveData = string.Format("{0}/{1}/{2}", year, month, day), area = "Alois.Timetables" });
 }
예제 #4
0
 public static string TimetableArchiveYear(this UrlHelper urlHelper, TimetablePart TimetablePart, int year) {
     return urlHelper.Action("ListByArchive", "TimetableAppointment", new { TimetableSlug = TimetablePart.As<IRoutableAspect>().Path, archiveData = year.ToString(), area = "Alois.Timetables" });
 }
예제 #5
0
 public static string TimetableRsd(this UrlHelper urlHelper, TimetablePart TimetablePart) {
     return urlHelper.AbsoluteAction(() => urlHelper.Action("Rsd", "RemoteTimetablePublishing", new { TimetableSlug = TimetablePart.As<IRoutableAspect>().Path, area = "Alois.Timetables" }));
 }
예제 #6
0
 public static string TimetableLiveWriterManifest(this UrlHelper urlHelper, TimetablePart TimetablePart) {
     return urlHelper.AbsoluteAction(() => urlHelper.Action("Manifest", "LiveWriter", new { area = "XmlRpc" }));
 }
예제 #7
0
 public static string Timetable(this UrlHelper urlHelper, TimetablePart TimetablePart) {
     return urlHelper.Action("Item", "Timetable", new { TimetableSlug = TimetablePart.As<IRoutableAspect>().Path, area = "Alois.Timetables" });
 }
        public IEnumerable<KeyValuePair<ArchiveData, int>> GetArchives(TimetablePart TimetablePart) {
            var query = 
                from bar in _TimetableArchiveRepository.Table
                where bar.TimetablePart == TimetablePart.Record
                orderby bar.Year descending, bar.Month descending
                select bar;

            return
                query.ToList().Select(
                    bar =>
                    new KeyValuePair<ArchiveData, int>(new ArchiveData(string.Format("{0}/{1}", bar.Year, bar.Month)),
                                                       bar.AppointmentCount));
        }
 public TimetableAppointmentPart Get(TimetablePart TimetablePart, string slug) {
     return Get(TimetablePart, slug, VersionOptions.Published);
 }
 public int AppointmentCount(TimetablePart TimetablePart, VersionOptions versionOptions) {
     return GetTimetableQuery(TimetablePart, versionOptions).Count();
 }
 public int AppointmentCount(TimetablePart TimetablePart) {
     return AppointmentCount(TimetablePart, VersionOptions.Published);
 }
 public IEnumerable<TimetableAppointmentPart> Get(TimetablePart TimetablePart, int skip, int count, VersionOptions versionOptions) {
     return GetTimetableQuery(TimetablePart, versionOptions).Slice(skip, count).ToList().Select(ci => ci.As<TimetableAppointmentPart>());
 }
 public IEnumerable<TimetableAppointmentPart> Get(TimetablePart TimetablePart, int skip, int count) {
     return Get(TimetablePart, skip, count, VersionOptions.Published);
 }
 public IEnumerable<TimetableAppointmentPart> Get(TimetablePart TimetablePart, VersionOptions versionOptions) {
     return GetTimetableQuery(TimetablePart, versionOptions).List().Select(ci => ci.As<TimetableAppointmentPart>());
 }
예제 #15
0
 public static string TimetableRemove(this UrlHelper urlHelper, TimetablePart TimetablePart) {
     return urlHelper.Action("Remove", "TimetableAdmin", new { TimetableId = TimetablePart.Id, area = "Alois.Timetables" });
 }
예제 #16
0
 public static string TimetableAppointmentCreate(this UrlHelper urlHelper, TimetablePart TimetablePart) {
     return urlHelper.Action("Create", "TimetableAppointmentAdmin", new { TimetableId = TimetablePart.Id, area = "Alois.Timetables" });
 }
예제 #17
0
 public static void Register(this IFeedManager feedManager, TimetablePart TimetablePart) {
     feedManager.Register(TimetablePart.Name, "rss", new RouteValueDictionary { { "containerid", TimetablePart.Id } });
     feedManager.Register(TimetablePart.Name + " - Comments", "rss", new RouteValueDictionary { { "commentedoncontainer", TimetablePart.Id } });
 }