public TicketAttribution GetById(long id) { const string sql = "SELECT * FROM \"TicketAttribution\" WHERE \"Id\"= @id;"; var par = new List <DbParameter> { new NpgsqlParameter("id", id) }; return(dataMapper.OneItemCommand(sql, par)); }
public Place GetById(long id) { const string sql = "SELECT * FROM public.\"Place\" WHERE \"Id\" = @p"; var parameters = new List <DbParameter> { new NpgsqlParameter("p", id) }; return(datamapper.OneItemCommand(sql, parameters)); }
public Subscription GetById(long id) { var sql = "SELECT * FROM public.\"Subscription\"" + InnerJoin + "WHERE \"Subscription\".\"Id\"= @p;"; var parameters = new List <DbParameter> { new NpgsqlParameter("p", id) }; return(dataMapper.OneItemCommand(sql, parameters)); }
public long Auth(string email, string password) { const string sql = "SELECT * FROM \"Login\" where \"Email\"= @email;"; var par = new List <DbParameter> { new NpgsqlParameter("email", email) }; var login = dataMapper.OneItemCommand(sql, par); if (login == null) { return(-1); } var result = PasswordHashing.VerifyPasswordHash(password, login.PasswordHash, login.PasswordSalt); return(result ? login.UserId : -1); }
public Ticket GetById(long id) { const string sql = "SELECT * FROM public.\"Tickets\"" + InnerJoin + "WHERE \"Tickets\".\"Id\"= @id"; var par = new List <DbParameter> { new NpgsqlParameter("id", id) }; return(dataMapper.OneItemCommand(sql, par)); }
public SubscriptionType GetById(long id) { const string sql = "SELECT * FROM public.\"SubscriptionType\" WHERE \"Id\"= @id;"; var parameters = new List <DbParameter> { new NpgsqlParameter("id", id) }; return(dataMapper.OneItemCommand(sql, parameters)); }
public Meal GetById(long id) { const string sql = "SELECT * FROM \"Meal\" WHERE \"Id\"= @p;"; var par = new List <DbParameter> { new NpgsqlParameter("p", id) }; return(dataMapper.OneItemCommand(sql, par)); }
public WareBooking GetById(long id) { var sql = "SELECT * FROM \"WareBooking\"" + innerJoin + "WHERE \"Id\"= @id"; var par = new List <DbParameter> { new NpgsqlParameter("id", id) }; return(dataMapper.OneItemCommand(sql, par)); }
public RoomBooking GetById(long id) { const string sql = "SELECT * FROM public.\"RoomBooking\"" + InnerJoin + "WHERE \"RoomBooking\".\"Id\"= @id;"; var parameters = new List <DbParameter> { new NpgsqlParameter("id", id) }; return(datamapper.OneItemCommand(sql, parameters)); }
public MealBooking GetById(long id) { const string sql = "SELECT * FROM \"MealReservation\"" + InnerJoin + "WHERE \"MealReservation\".\"Id\"= @id;"; var par = new List <DbParameter> { new NpgsqlParameter("id", id) }; return(datamapper.OneItemCommand(sql, par)); }