public UnavailableDate UnavailableDateByUnavailableDateId(int unavailableDateId) { UnavailableDate ud = (from u in repository.UnavailableDates where u.Id == unavailableDateId select u).Single(); return(ud); }
public void DeleteUnavailableDate(DateTime date, int memberId) { List <UnavailableDate> ud = UnavailableDateByMemberId(memberId); UnavailableDate ud1 = (from u in ud where u.DateUnavailable == date select u).Single(); repository.UnavailableDates.Remove(ud1); repository.SaveChanges(); }
public UnavailableDate UpdateUnavailableDate(int unavailableDateId, int memberId, DateTime dateUnavailable, string reason, bool meetingCancelled) { UnavailableDate ud = UnavailableDateByUnavailableDateId(unavailableDateId); ud.MemberId = memberId; ud.DateUnavailable = dateUnavailable; ud.Reason = reason; ud.MeetingCancelled = meetingCancelled; ud.UpdateDate = DateTime.Now; repository.SaveChanges(); return(ud); }
public UnavailableDate CreateUnavailableDate(int memberId, DateTime dateUnavailable, string reason) { UnavailableDate ud = new UnavailableDate(); ud.MemberId = memberId; ud.DateUnavailable = dateUnavailable; ud.Reason = reason; ud.CreateDate = DateTime.Now; repository.UnavailableDates.Add(ud); repository.SaveChanges(); return(ud); }
public UnavailableDate CreateUnavailableDate(int memberId, DateTime dateUnavailable, bool meetingCancelled, string reason, int congregationId) { UnavailableDate ud = new UnavailableDate(); ud.MemberId = memberId; ud.DateUnavailable = dateUnavailable; ud.MeetingCancelled = meetingCancelled; ud.CongregationId = congregationId; ud.Reason = reason; ud.CreateDate = DateTime.Now; repository.UnavailableDates.Add(ud); repository.SaveChanges(); return(ud); }
public UnavailableDate CreateUnavailableDate(int memberId, DateTime dateUnavailable, bool meetingCancelled, string reason, int congregationId) { UnavailableDate ud = new UnavailableDate(); ud.MemberId = memberId; ud.DateUnavailable = dateUnavailable; ud.MeetingCancelled = meetingCancelled; ud.CongregationId = congregationId; ud.Reason = reason; ud.CreateDate = DateTime.Now; repository.UnavailableDates.Add(ud); repository.SaveChanges(); return ud; }
public UnavailableDate CreateUnavailableDate(int memberId, DateTime dateUnavailable, string reason) { UnavailableDate ud = new UnavailableDate(); ud.MemberId = memberId; ud.DateUnavailable = dateUnavailable; ud.Reason = reason; ud.CreateDate = DateTime.Now; repository.UnavailableDates.Add(ud); repository.SaveChanges(); return ud; }