public OwnerShowingCalendar SecondOwnerShowingCalendar() { var secondOwnerShowingCalendar = new OwnerShowingCalendar { EventID = new Int32() , EventTitle = null, StartDate = new DateTime(), EndDate = new DateTime(), IsAllDay = new Boolean(), OwnerId = new Int32() , UnitId = new Int32() , RequesterName = null, RequesterEmail = null, RequesterTelephone = null }; return secondOwnerShowingCalendar; }
public void OwnerAcceptShowingRequest(int eventId) { var pendingrequest = UnitofWork.OwnerPendingShowingCalendarRepository.FirstOrDefault(x => x.EventID == eventId); if (pendingrequest != null) { var newownershowingcalender = new OwnerShowingCalendar { EventTitle = GetOwner().FirstName + " " + GetOwner().LastName + " has confirmed the scheduling", StartDate = pendingrequest.StartDate, EndDate = pendingrequest.EndDate, IsAllDay = pendingrequest.IsAllDay, OwnerId = pendingrequest.OwnerId, UnitId = pendingrequest.UnitId, RequesterEmail = pendingrequest.RequesterEmail, RequesterName = pendingrequest.RequesterName, RequesterTelephone = pendingrequest.RequesterTelephone }; UnitofWork.OwnerShowingCalendarRepository.Add(newownershowingcalender); UnitofWork.OwnerPendingShowingCalendarRepository.Delete(pendingrequest); UnitofWork.Save(); } //TODO Insert into OwnerShowingCalendars //TODO Send Email Confirmation to both parties }