public static string AjouterReservationDansLaBase(RESERVATION_MODEL model) { RESERVATIONs reservation = IntReservationFromModel(model); using (unitOfWork unitOfWork = new unitOfWork()) { return(unitOfWork.ReservationRepository.Add(reservation)); } }
public static RESERVATIONs IntReservationFromModel(RESERVATION_MODEL model) { RESERVATIONs reservation = new RESERVATIONs(); reservation.PROMOTION = model.PROMOTION; reservation.MATIERE = model.MATIERE; reservation.SALLE = model.SALLE; reservation.PROFESSEUR = model.PROFFESSEUR; reservation.DATE_DEBUT = Convert.ToDateTime(model.DATE_DEBUT); reservation.DATE_FIN = Convert.ToDateTime(model.DATE_FIN); reservation.DATE = Convert.ToDateTime(model.DATE); return(reservation); }