示例#1
0
 public async Task <IEnumerable <Schedule> > FindByCinemaHallAsync(CinemaHall ch)
 {
     return(await adoTemplate.QueryAsync(@"SELECT * FROM Schedule
                                           INNER JOIN CinemaHall ON CinemaHall.CinemaHallId = Schedule.CinemaHallId
                                           INNER JOIN Movie ON Movie.MovieId = Schedule.MovieId 
                                           WHERE Schedule.CinemaHallId = @CId AND Movie.Archived = 0",
                                         MapRowToSchedule,
                                         new QueryParameter("@CId", ch.CinemaHallId)));
 }
示例#2
0
 public async Task <Seat> FindByIdAsync(int id)
 {
     return((await adoTemplate.QueryAsync("SELECT * FROM Seat " +
                                          "INNER JOIN Row ON Row.RowId = Seat.RowId " +
                                          "INNER JOIN SeatCategory ON SeatCategory.SeatCategoryId = Row.SeatCategoryId " +
                                          "WHERE Seat.SeatId = @SId",
                                          MapRowToSeat,
                                          new QueryParameter(@"@SId", id))).FirstOrDefault());
 }
示例#3
0
        public async Task <IEnumerable <Row> > FindByCinemaHallAsync(CinemaHall ch)
        {
            IEnumerable <Row> rows = await adoTemplate.QueryAsync(@"SELECT * FROM Row
                                                            INNER JOIN SeatCategory ON Row.SeatCategoryId = SeatCategory.SeatCategoryId
                                                            INNER JOIN CinemaHall ON CinemaHall.CinemaHallId = Row.CinemaHallId
                                                            WHERE Row.CinemaHallId = @CId",
                                                                  MapRowToRow,
                                                                  new QueryParameter("@CId", ch.CinemaHallId));

            ch.Rows = rows;

            return(rows);
        }
        public Task <IEnumerable <Measurements> > FindAllMeasurementsByStationInTimeIntervalAsync(Stations station, DateTime begin, DateTime end)
        {
            // List<Measurements> res = new List<Measurements>();
            var res = template.QueryAsync("select * from Measurements where Station=@station and Timestamp>=@begin and Timestamp<=@end",
                                          measurementMapper,
                                          new[]
            {
                new SqlParameter("@station", station.Station),
                new SqlParameter("@begin", begin),
                new SqlParameter("@end", end)
            });

            return(res);
        }
 public async Task <StationType> FindByIdAsync(int id)
 {
     return((await _template.QueryAsync("SELECT * FROM station_type WHERE id =@id",
                                        new[] { new QueryParameter("@id", id) }, StationTypeMapper)).FirstOrDefault());
 }
示例#6
0
 public async Task <IEnumerable <Actor> > FindAllAsync()
 {
     return(await adoTemplate.QueryAsync("SELECT * FROM Actor", MapRowToActor));
 }
 public async Task <IEnumerable <Measurement> > FindAllAsync()
 {
     return(await _template.QueryAsync("select * from measurement", MeasurementMapper));
 }
示例#8
0
 public async Task <IEnumerable <Genre> > FindAllAsync()
 {
     return(await adoTemplate.QueryAsync("SELECT * FROM Genre", MapRowToGenre));
 }
示例#9
0
 public async Task <IEnumerable <CinemaHall> > FindAllAsync()
 {
     return(await adoTemplate.QueryAsync(@"SELECT * FROM CinemaHall", MapRowToCinemaHall));
 }
示例#10
0
 public async Task <IEnumerable <Reservation> > FindAllAsync()
 {
     return(await adoTemplate.QueryAsync("SELECT * FROM Reservation " +
                                         "INNER JOIN Schedule ON Schedule.ScheduleId = Reservation.ScheduleId",
                                         MapRowToReservation));
 }
示例#11
0
 public async Task <IEnumerable <Unit> > FindAllAsync()
 {
     return(await _template.QueryAsync("select * from unit", unitMapper));
 }
示例#12
0
 public async Task <IEnumerable <District> > FindAllAsync()
 {
     return(await _template.QueryAsync("select * from district", districtMapper));
 }
示例#13
0
 public async Task <SeatCategory> FindByIdAsync(int id)
 {
     return((await adoTemplate.QueryAsync("SELECT * FROM SeatCategory WHERE SeatCategoryId = @SId",
                                          MapRowToSeatCategory,
                                          new QueryParameter(@"SId", id))).FirstOrDefault());
 }
示例#14
0
 public async Task <User> FindByIdAsync(int id)
 {
     return((await _template.QueryAsync("SELECT * FROM user WHERE id = @id",
                                        new[] { new QueryParameter("@id", id) }, UserMapper)).FirstOrDefault());
 }
示例#15
0
 public async Task <IEnumerable <Province> > FindAllAsync()
 {
     //Thread.Sleep(100000);
     return(await _template.QueryAsync("select * from province", provinceMapper));
 }
示例#16
0
 public async Task <IEnumerable <Community> > FindAllAsync()
 {
     return(await _template.QueryAsync("select * from community", communityMapper));
 }
示例#17
0
 public async Task <IEnumerable <Movie> > FindAllAsync()
 {
     return(await adoTemplate.QueryAsync("SELECT * FROM Movie WHERE Movie.Archived = 0", MapRowToMovie));
 }