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));
        }
Пример #2
0
        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));
        }
Пример #3
0
        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));
        }
Пример #4
0
        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);
        }
Пример #5
0
        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));
        }
Пример #7
0
        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));
        }
Пример #8
0
        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));
        }
Пример #9
0
        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));
        }
Пример #10
0
        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));
        }