예제 #1
0
 public CalendarEntry GetMemberNextShift(int memberID)
 {
     using (ICalendarDAL dal = SERVDALFactory.Factory.CalendarDAL())
     {
         SERVDataContract.DbLinq.CalendarEntry lret = dal.GetMemberNextShift(memberID);
         if (lret != null)
         {
             return(new CalendarEntry(lret));
         }
         return(null);
     }
 }
예제 #2
0
 public CalendarEntry GetCalendarEntry(int calendarEntryId)
 {
     using (ICalendarDAL dal = SERVDALFactory.Factory.CalendarDAL())
     {
         SERVDataContract.DbLinq.CalendarEntry entry = dal.GetCalendarEntry(calendarEntryId);
         if (entry == null)
         {
             return(null);
         }
         return(new CalendarEntry(entry));
     }
 }
예제 #3
0
        public CalendarEntry GetCalendarEntry(DateTime date, int calendarId, int memberId)
        {
            DateTime cleanDate = new DateTime(date.Year, date.Month, date.Day);

            using (ICalendarDAL dal = SERVDALFactory.Factory.CalendarDAL())
            {
                SERVDataContract.DbLinq.CalendarEntry entry = dal.GetCalendarEntry(cleanDate, calendarId, memberId);
                if (entry == null)
                {
                    return(null);
                }
                return(new CalendarEntry(entry));
            }
        }
예제 #4
0
 public CalendarEntry(SERVDataContract.DbLinq.CalendarEntry metal)
 {
     this.AdHoc                = metal.AdHoc == 1;
     this.ManuallyAdded        = metal.ManuallyAdded == 1;
     this.CalendarEntryID      = metal.CalendarEntryID;
     this.CoverCalendarEntryID = metal.CoverCalendarEntryID;
     this.CoverNeeded          = metal.CoverNeeded == 1;
     this.EntryDate            = metal.EntryDate;
     this.MemberID             = metal.MemberID;
     this.CalendarID           = metal.CalendarID;
     this.CalendarName         = metal.Calendar.Name;
     this.CalendarSortOrder    = metal.Calendar.SortOrder != null? (int)metal.Calendar.SortOrder : 9999;
     this.MemberName           = string.Format("{0} {1}", metal.Member.FirstName, metal.Member.LastName);
 }