Exemplo n.º 1
0
        public static DataSet filteredSearch(String name, int? stars, String city, String country)
        {

            SqlFunction func = new SqlFunction("[BOBBY_TABLES].SP_FILTER_HOTELS")
                                .WithParam("@Name").As(SqlDbType.VarChar).Value(name)
                                .WithParam("@City").As(SqlDbType.VarChar).Value(city)
                                .WithParam("@Country").As(SqlDbType.VarChar).Value(country);

            if (stars == null) {func.WithParam("@Stars").As(SqlDbType.Int).Value(DBNull.Value);}
            else { func.WithParam("@Stars").As(SqlDbType.Int).Value(stars); }

            SqlResults results = func.Execute();


            return (DataSet)results["ReturnedValues"];
        }
Exemplo n.º 2
0
        /*public DataTable filters(String name, String lastname, String docType, Decimal? docNumber, String mail) {
            SqlResults results = new SqlQuery()
        }*/
        public DataTable filteredSearch(String name, String lastname, String docType, Decimal? docNumber, String mail) {

            if (docNumber == -1)
            {
                SqlResults results = new SqlFunction("[BOBBY_TABLES].SP_FILTER_PERSONS_NULLDOC")
                                   .WithParam("@Name").As(SqlDbType.VarChar).Value(name)
                                   .WithParam("@Lastname").As(SqlDbType.VarChar).Value(lastname)
                                   .WithParam("@DocType").As(SqlDbType.VarChar).Value(docType)
                                   .WithParam("@Mail").As(SqlDbType.VarChar).Value(mail)
                                   .Execute();

                return (DataTable)results["ReturnedValues"];
            }
            else {
                SqlResults results = new SqlFunction("[BOBBY_TABLES].SP_FILTER_PERSONS")
                                   .WithParam("@Name").As(SqlDbType.VarChar).Value(name)
                                   .WithParam("@Lastname").As(SqlDbType.VarChar).Value(lastname)
                                   .WithParam("@DocType").As(SqlDbType.VarChar).Value(docType)
                                   .WithParam("@DocNumber").As(SqlDbType.Decimal).Value(docNumber)
                                   .WithParam("@Mail").As(SqlDbType.VarChar).Value(mail)
                                   .Execute();

                return (DataTable)results["ReturnedValues"];
            }

        }
Exemplo n.º 3
0
        public DataTable getGuestInformation(Int32 id) {
            SqlResults results = new SqlFunction("[BOBBY_TABLES].FUNCT_GET_INFO")
                                .WithParam("@IdPerson").As(SqlDbType.Int).Value(id)
                                .Execute();
            return (DataTable)results["ReturnedValues"];

        }
Exemplo n.º 4
0
        public DataSet filteredSearch(Int32 idHotel, Int32? roomNum, Int32? floor, Int32 location, Int32 type, String descrip)
        {

            SqlResults results = new SqlFunction("[BOBBY_TABLES].SP_FILTER_ROOMS")
                                .WithParam("@IdHotel").As(SqlDbType.Int).Value(idHotel)
                                .WithParam("@RoomNum").As(SqlDbType.Int).Value(roomNum)
                                .WithParam("@Floor").As(SqlDbType.Int).Value(floor)
                                .WithParam("@TypeDesc").As(SqlDbType.Int).Value(type)
                                .WithParam("@LocationDesc").As(SqlDbType.Int).Value(location)
                                .WithParam("@Descr").As(SqlDbType.VarChar).Value(descrip)
                                .Execute();

            return (DataSet)results["ReturnedValues"];

        }