Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TFSearch.BitBtn1Click(Sender: TObject);
- var
- fwalls: string;
- begin
- if walls_P.Checked then fwalls := walls_P.Caption else fwalls := walls_K.Caption;
- //проверка значений
- if string.IsNullOrEmpty(Edittotal_area.Text) then
- Edittotal_area.Text := '0';
- if string.IsNullOrEmpty(Editliving_space.Text) then
- Editliving_space.Text := '0';
- if string.IsNullOrEmpty(Editkitchen_area.Text) then
- Editkitchen_area.Text := '0';
- if string.IsNullOrEmpty(Edittotal_floors.Text) then
- Edittotal_floors.Text := '0';
- if string.IsNullOrEmpty(Editfloors.Text) then
- Editfloors.Text := '0';
- if string.IsNullOrEmpty(EditCost_of_sale.Text) then
- EditCost_of_sale.Text := '0';
- if string.IsNullOrEmpty(Editborough.Text) then
- begin
- //вывод запроса, если район не введен
- Main.ADOQuery1.SQL.Clear;
- Main.ADOQuery1.SQL.Add('SELECT * FROM realtor WHERE total_area >= ' + Edittotal_area.Text +
- ' and living_space >= ' + Editliving_space.Text +
- ' and kitchen_area >= ' + Editkitchen_area.Text +
- ' and bathroom = ' + BoolToStr(CheckBoxbathroom.Checked) +
- ' and bathroom_affinity = ' + BoolToStr(CheckBoxbathroom_affinity.Checked) +
- ' and loggia = ' + BoolToStr(CheckBoxloggia.Checked) +
- ' and walls = ' + QuotedStr(fwalls) +
- ' and total_floors <= ' + Edittotal_floors.Text +
- ' and floors = ' + Editfloors.Text +
- ' and Cost_of_sale <= ' + EditCost_of_sale.Text);
- Main.ADOQuery1.Active := True;
- end
- else
- begin
- Main.ADOQuery1.SQL.Clear;
- Main.ADOQuery1.SQL.Add('SELECT * FROM realtor WHERE borough LIKE ''' + Editborough.text + '%''' +
- ' and total_area >= ' + Edittotal_area.Text +
- ' and living_space >= ' + Editliving_space.Text +
- ' and kitchen_area >= ' + Editkitchen_area.Text +
- ' and bathroom = ' + BoolToStr(CheckBoxbathroom.Checked) +
- ' and bathroom_affinity = ' + BoolToStr(CheckBoxbathroom_affinity.Checked) +
- ' and loggia = ' + BoolToStr(CheckBoxloggia.Checked) +
- ' and walls = ' + QuotedStr(fwalls) +
- ' and total_floors <= ' + Edittotal_floors.Text +
- ' and floors = ' + Editfloors.Text +
- ' and Cost_of_sale <= ' + EditCost_of_sale.Text);
- Main.ADOQuery1.Active := True;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement