public int BookSeats(CoreModels.BookingInfo bookSeats) { using (var database = new Database("BookMyShow")) { return(Convert.ToInt16(database.Insert("BookingInfo", "Id", bookSeats.Map <DataModels.BookingInfo>()))); } }
public List <CoreModels.BookingInfo> GetBookedSeats(CoreModels.BookingInfo bookingInfo) { DataModels.BookingInfo dMbookingInfo = bookingInfo.Map <DataModels.BookingInfo>(); using (var database = new Database("BookMyShow")) { return(database.Fetch <DataModels.BookingInfo>("Select * from BookingInfo where MovieId=@0 AND TheaterId=@1 AND ShowDate=@2 AND ShowTime=@3", dMbookingInfo.MovieId, dMbookingInfo.TheaterId, dMbookingInfo.ShowDate, dMbookingInfo.ShowTime).MapCollection <List <DataModels.BookingInfo>, List <CoreModels.BookingInfo> >()); } }