public static void MapToEntity(this AdminBookingDetailsModel model, Booking booking) { booking.Address = model.Address; booking.Canton = model.Canton; booking.Date = DateTime.Parse(model.Date + " " + model.Time); booking.Email = model.Email; booking.EventId = model.EventId; booking.FirstName = model.FirstName; booking.Grade = model.Grade; booking.Id = model.Id; booking.LastName = model.LastName; booking.Notes = model.Notes; booking.NumberOfKids = model.NumberOfKids.Value; booking.Phone = model.Phone; booking.School = model.School; booking.Town = model.Town; booking.ZipCode = model.ZipCode; }
public static void MapFromEntity(this AdminBookingDetailsModel model, Booking booking) { model.Address = booking.Address; model.Canton = booking.Canton; model.Date = booking.Date.ToString("dd.MM.yyyy"); model.Email = booking.Email; model.EventId = booking.Event.Id; model.FirstName = booking.FirstName; model.Grade = booking.Grade; model.Id = booking.Id; model.IsActive = booking.IsActive; model.LastName = booking.LastName; model.Notes = booking.Notes; model.NumberOfKids = booking.NumberOfKids; model.Phone = booking.Phone; model.School = booking.School; model.Time = booking.Date.TimeOfDay.ToString("hh\\:mm"); model.Town = booking.Town; model.ZipCode = booking.ZipCode; }