示例#1
0
        public DataSet Search(HouseSearch house)
        {
            Database  db      = DatabaseFactory.CreateDatabase(Constants.CONNECTIONSTRING);
            DbCommand command = db.GetStoredProcCommand("usp_HouseSearch");

            db.AddInParameter(command, "BathRooms", DbType.String, house.BathRooms);
            db.AddInParameter(command, "BedRooms", DbType.String, house.BedRooms);
            db.AddInParameter(command, "Zip", DbType.String, house.Zip);

            return(db.ExecuteDataSet(command));
        }
示例#2
0
        protected void FindHome_Click(object sender, EventArgs e)
        {
            StudentSearchresults.Visible = false;
            HouseSearch house = new HouseSearch();
            HouseDAO houseDAO = new HouseDAO();

            house.Zip = string.IsNullOrEmpty(Zipcode.Text.Trim()) ? null : Zipcode.Text.Trim();

            if (DrpBedRooms.SelectedItem.Value != "-1")
            {
                house.BedRooms = int.Parse(DrpBedRooms.SelectedItem.Value);
            }
            else
            {
                house.BedRooms = null;
            }

            if (DrpBathRooms.SelectedItem.Value != "-1")
            {
                house.BathRooms = int.Parse(DrpBathRooms.SelectedItem.Value);
            }
            else
            {
                house.BathRooms = null;
            }

            DataSet ds;
            ds = houseDAO.Search(house);

            if (ds != null)
            {
                DataListHouseSearchresults.DataSource = ds.Tables[0];
                DataListHouseSearchresults.DataBind();

                HouseSearchresults.Visible = true;
            }
            else
            {
                Searchresults.Visible = true;
            }
        }
示例#3
0
        public DataSet Search(HouseSearch house)
        {
            Database db = DatabaseFactory.CreateDatabase(Constants.CONNECTIONSTRING);
               DbCommand command = db.GetStoredProcCommand("usp_HouseSearch");

               db.AddInParameter(command, "BathRooms", DbType.String, house.BathRooms);
               db.AddInParameter(command, "BedRooms", DbType.String, house.BedRooms);
               db.AddInParameter(command, "Zip", DbType.String, house.Zip);

               return db.ExecuteDataSet(command);
        }