internal static SessionDetail TranslateSession(SessionBooking session) { var numPeople = -1; try { numPeople = int.Parse(session.NumPeople); } catch (Exception ex) { } return(new SessionDetail() { Id = session.SessionId, Title = session.LecturerFirstName + " " + session.LecturerLastName, Room = session.Campus, Time = HumanizeTimeSpan(session.StartDate, session.EndDate), DateHumanFriendly = HumanizeDate(session.StartDate), FilledPlaces = numPeople, Date = session.StartDate, DateEnd = session.EndDate, Type = session.AppointmentType, LecturerEmail = session.LecturerEmail, AssignmentType = session.AssignmentType + ((session.AssignTypeOther != null) ? Environment.NewLine + session.AssignTypeOther : null), AppointmentType = session.AppointmentType, Cancel = session.Cancel, Assistance = session.Assistance, Reason = session.Reason, IsGroup = session.IsGroup, LecturerComment = session.LecturerComment, Subject = session.Subject, AssistanceText = session.AssistanceText, Attended = session.Attended == 1 }); }
public async Task <bool> SessionBooking(SessionBookingRequest request) { try { SessionBooking booking = new SessionBooking { SessionBookingId = 0, SessionBookingGuid = System.Guid.NewGuid(), SessionId = request.SessionId, BookingDate = request.BookingDate, //MemberId = request.MemberId, SessionType = request.SessionType, CreatedDate = DateTime.UtcNow, CreatedBy = request.UserId, IsActive = true, IsDeleted = false, ModifiedBy = null, ModifiedDate = null }; return(await this._settingsRepo.SessionBooking(booking)); } catch (Exception ex) { throw ex; } }
public async Task <bool> SessionBooking(SessionBooking booking) { try { this.therapistContext.SessionBooking.Add(booking); await this.therapistContext.SaveChangesAsync(); return(true); } catch (Exception ex) { throw ex; } }