コード例 #1
0
        private CalendarEntry GetCalendarEntry(CalendarEntryType calendarEntryType)
        {
            CalendarEntry calendarEntry;

            return(calendarEntries.TryGetValue(calendarEntryType, out calendarEntry)
                ? calendarEntry
                : new NullCalendarEntry());
        }
コード例 #2
0
ファイル: CalendarEntry.cs プロジェクト: adsurg/DDDEastAnglia
 protected CalendarEntry(int id, CalendarEntryType entryType, string description, bool isPublic, bool isAuthorised)
 {
     this.id           = id;
     this.entryType    = entryType;
     this.description  = description;
     this.isPublic     = isPublic;
     this.isAuthorised = isAuthorised;
 }
コード例 #3
0
 protected CalendarEntry(int id, CalendarEntryType entryType, string description, bool isPublic, bool isAuthorised)
 {
     this.id = id;
     this.entryType = entryType;
     this.description = description;
     this.isPublic = isPublic;
     this.isAuthorised = isAuthorised;
 }
コード例 #4
0
 private static TimeRangeEntry GetTimeRangeEntry(CalendarEntryType calendarEntryType, DateTimeOffset startDate, DateTimeOffset endDate)
 {
     return(new TimeRangeEntry(0,
                               calendarEntryType,
                               "",
                               true,
                               true,
                               startDate,
                               endDate));
 }
コード例 #5
0
 private static TimeRangeEntry GetTimeRangeEntry(CalendarEntryType calendarEntryType, DateTimeOffset startDate, DateTimeOffset endDate)
 {
     return new TimeRangeEntry(0,
                               calendarEntryType,
                               "",
                               true,
                               true,
                               startDate,
                               endDate);
 }
コード例 #6
0
 public SingleTimeEntry(int calendarItemId, CalendarEntryType entryType, string description, bool isPublic, bool isAuthorised, DateTimeOffset startDate)
     : base(calendarItemId, entryType, description, isPublic, isAuthorised)
 {
     this.startDate = startDate;
 }
コード例 #7
0
 public SingleTimeEntry(int calendarItemId, CalendarEntryType entryType, string description, bool isPublic, bool isAuthorised, DateTimeOffset startDate)
     : base(calendarItemId, entryType, description, isPublic, isAuthorised)
 {
     this.startDate = startDate;
 }
コード例 #8
0
 public TimeRangeEntry(int id, CalendarEntryType entryType, string description, bool isPublic, bool isAuthorised, DateTimeOffset startDate, DateTimeOffset endDate)
     : base(id, entryType, description, isPublic, isAuthorised)
 {
     this.startDate = startDate;
     this.endDate   = endDate;
 }
コード例 #9
0
 public CalendarItem GetFromType(CalendarEntryType voting)
 {
     return(db.CalendarItems.FindByEntryTypeString(voting.ToString()));
 }
コード例 #10
0
 private static SingleTimeEntry GetSingleTimeEntry(CalendarEntryType calendarEntryType, DateTimeOffset startTime)
 {
     return(new SingleTimeEntry(1, calendarEntryType, "", true, true, startTime));
 }
コード例 #11
0
 private CalendarEntry GetCalendarEntry(CalendarEntryType calendarEntryType)
 {
     CalendarEntry calendarEntry;
     return calendarEntries.TryGetValue(calendarEntryType, out calendarEntry)
         ? calendarEntry
         : new NullCalendarEntry();
 }
コード例 #12
0
 public CalendarItem GetFromType(CalendarEntryType voting)
 {
     return db.CalendarItems.FindByEntryTypeString(voting.ToString());
 }
コード例 #13
0
        private void LoadCalendarData()
        {
            if (cmbMonth.SelectedItem == null || cmbYear.SelectedItem == null)
            {
                return;
            }

            var dtFrom = new DateTime((cmbYear.SelectedItem as IdValue).Id, (cmbMonth.SelectedItem as IdValue).Id, 1);
            var dtTo   = dtFrom.AddMonths(1).AddSeconds(-1);

            int pmId = 0;

            if (cbFilterPM.Checked && cbPM.SelectedItem != null)
            {
                pmId = (cbPM.SelectedItem as IdValue).Id;
            }

            CalendarEntryType entryType = CalendarEntryType.Financial;

            if (rbStaff.Checked)
            {
                entryType = CalendarEntryType.Staff;
            }


            using (var context = SqlDataHandler.GetDataContext())
            {
                var q = from c in context.BuildingCalendarEntrySet
                        join i in context.CalendarEntryAttachmentSet on c.id equals i.BuildingCalendarEntryId into attach
                        from a in attach.DefaultIfEmpty()
                        where c.EntryDate >= dtFrom &&
                        c.EntryDate <= dtTo &&
                        (pmId == 0 || c.UserId == pmId)
                        //                && c.CalendarEntryType == entryType
                        select new CalendarPrintItem
                {
                    Id                  = c.id,
                    EventDate           = c.EntryDate,
                    EventToDate         = c.EventToDate,
                    BuildingId          = c.BuildingId,
                    BuildingAbreviation = c.Building.Code,
                    BuildingDataPath    = c.Building.DataPath,
                    BuildingName        = c.Building.Building,
                    Event               = c.Event,
                    Venue               = c.Venue,
                    PM                  = c.User.name,
                    PMEmail             = c.User.email,
                    NotifyTrustees      = c.NotifyTrustees,
                    InviteSubject       = c.InviteSubject,
                    InviteBody          = c.InviteBody,
                    BCCEmailAddress     = c.BCCEmailAddress,
                    TrusteesNotified    = c.TrusteesNotified,
                    FileName            = a != null ? a.FileName : string.Empty,
                    EventyType          = c.CalendarEntryType,
                    Room                = c.MeetingRoomId != null ? c.MeetingRoom.Name : string.Empty
                };

                _Data = q.OrderBy(a => a.EventDate).ThenBy(a => a.BuildingName).ToList();
            }

            BindDataGrid();
        }
コード例 #14
0
 private static SingleTimeEntry GetSingleTimeEntry(CalendarEntryType calendarEntryType, DateTimeOffset startTime)
 {
     return new SingleTimeEntry(1, calendarEntryType, "", true, true, startTime);
 }
コード例 #15
0
 public TimeRangeEntry(int id, CalendarEntryType entryType, string description, bool isPublic, bool isAuthorised, DateTimeOffset startDate, DateTimeOffset endDate)
     : base(id, entryType, description, isPublic, isAuthorised)
 {
     this.startDate = startDate;
     this.endDate = endDate;
 }