コード例 #1
0
 public Attendance(DayActivity dayActivity, User user)
 {
     DayId       = dayActivity.DayId;
     ActivityId  = dayActivity.ActivityId;
     UserId      = user.UserId;
     DayActivity = dayActivity;
     User        = user;
     TimeOfDay   = dayActivity.TimeOfDay;
 }
コード例 #2
0
 public void AddDayActivity(DayActivity dayActivity)
 {
     if (DayActivities.SingleOrDefault(da => da.DayId == dayActivity.DayId && da.ActivityId == dayActivity.ActivityId && da.TimeOfDay == dayActivity.TimeOfDay) == null)
     {
         DayActivities.Add(dayActivity);
     }
     else
     {
         throw new ArgumentException("DayActivity already exists");
     }
 }
コード例 #3
0
 public void RemoveDayActivity(DayActivity dayActivity)
 {
     if (DayActivities.SingleOrDefault(da => da.DayId == dayActivity.DayId && da.ActivityId == dayActivity.ActivityId && da.TimeOfDay == dayActivity.TimeOfDay) != null)
     {
         DayActivities.Remove(dayActivity);
     }
     else
     {
         throw new ArgumentException("DayActivity doesn't exist");
     }
 }