Exemplo n.º 1
0
        public List <Reservering> GetReserveringenById(int id)
        {
            List <Reservering> reserveringen = new List <Reservering>();

            string sql = "Select R.ReserveringID, R.Datum, R.Status, R.RestaurantID, R.AccountID, A.Naam From Reservering R inner join Restaurant A on R.RestaurantID = A.RestaurantID where AccountID = @id and Status != 'Voltooid'";
            Dictionary <object, object> parameters = new Dictionary <object, object>();

            parameters.Add("id", id);

            DataSet results = GetDataSetSql(sql, parameters);

            if (results != null && results.Tables[0].Rows.Count > 0)
            {
                for (int x = 0; x < results.Tables[0].Rows.Count; x++)
                {
                    Reservering r = DataSetParser.DataSetToReservering(results, x);
                    reserveringen.Add(r);
                }
            }
            else
            {
                return(null);
            }
            return(reserveringen);
        }
Exemplo n.º 2
0
        public Reservering GetReserveringById(int id)
        {
            string sql = "Select * From Reservering Where ReserveringID = @reserveringID";
            Dictionary <object, object> parameters = new Dictionary <object, object>();

            parameters.Add("reserveringID", id);
            Reservering r       = new Reservering();
            DataSet     results = GetDataSetSql(sql, parameters);

            if (results != null && results.Tables[0].Rows.Count > 0)
            {
                r = DataSetParser.DataSetToReservering(results, 0);
            }
            else
            {
                return(null);
            }

            return(r);
        }
Exemplo n.º 3
0
        public Reservering GetReserveringByAccountAndRestaurantAndDate(int accountID, int restaurantID, string dtp)
        {
            string sql = "select * from Reservering Where AccountID = @AccountID and RestaurantID = @RestaurantID and Datum = @datum + ':00.000' ";
            Dictionary <object, object> parameters = new Dictionary <object, object>();

            parameters.Add("RestaurantID", restaurantID);
            parameters.Add("AccountID", accountID);
            parameters.Add("datum", dtp);
            DataSet results = GetDataSetSql(sql, parameters);

            Reservering r = new Reservering();

            if (results != null && results.Tables[0].Rows.Count == 1)
            {
                r = DataSetParser.DataSetToReservering(results, 0);
            }
            else
            {
                return(null);
            }
            return(r);
        }