Source code of file oscpmwin_v0.1.2.484/search.pas from the
osCommerce Product Manager for Windows.
0000: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001: osCommerce Product Manager for Windows (oscpmwin).
0002: Copyright �2003-2006 by Mario A. Valdez-Ramirez.
0003:
0004: You can contact Mario A. Valdez-Ramirez
0005: by email at mario@mariovaldez.org or paper mail at
0006: Olmos 809, San Nicolas, NL. 66495, Mexico.
0007:
0008: This program is free software; you can redistribute it and/or modify
0009: it under the terms of the GNU General Public License as published by
0010: the Free Software Foundation; either version 2 of the License, or (at
0011: your option) any later version.
0012:
0013: This program is distributed in the hope that it will be useful, but
0014: WITHOUT ANY WARRANTY; without even the implied warranty of
0015: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0016: General Public License for more details.
0017:
0018: You should have received a copy of the GNU General Public License
0019: along with this program; if not, write to the Free Software
0020: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0021: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0022: unit search;
0023:
0024: interface
0025:
0026: uses
0027: Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
0028: Dialogs, StdCtrls, Buttons, ExtCtrls;
0029:
0030: type
0031: Topm_Form_SearchProduct = class(TForm)
0032: opm_ComboBox_SearchCat: TComboBox;
0033: opm_ComboBox_SearchMan: TComboBox;
0034: opm_Edit_SearchModel: TEdit;
0035: opm_Edit_SearchName: TEdit;
0036: opm_Label_SearchCat: TLabel;
0037: opm_Label_SearchMan: TLabel;
0038: opm_Label_SearchModel: TLabel;
0039: opm_Label_SearchName: TLabel;
0040: opm_BitBtn_SearchOk: TBitBtn;
0041: opm_BitBtn_SearchCancel: TBitBtn;
0042: opm_Label_SearchDescription: TLabel;
0043: opm_Edit_SearchDescription: TEdit;
0044: opm_RadioGroup_SearchSPrice: TRadioGroup;
0045: opm_RadioGroup_SearchImgURL: TRadioGroup;
0046: opm_RadioGroup_SearchAvailable: TRadioGroup;
0047: procedure FormShow(Sender: TObject);
0048: procedure opm_BitBtn_SearchOkClick(Sender: TObject);
0049: procedure FormCreate(Sender: TObject);
0050: private
0051: { Private declarations }
0052: public
0053: end;
0054:
0055: var
0056: opm_Form_SearchProduct: Topm_Form_SearchProduct;
0057:
0058: implementation
0059:
0060: {$R *.dfm}
0061:
0062: Uses gnugettext, main, oscpmdata, balloons;
0063:
0064:
0065:
0066:
0067: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0068: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0069: procedure Topm_Form_SearchProduct.FormShow(Sender: TObject);
0070: VAR
0071: CurMan : opmR_Manufacturer;
0072: CurCat : opmR_Category;
0073: begin
0074: opm_Form_SearchProduct.Caption := _('Search product');
0075: CurCat := opm_Form_Main.FNopm_GetCategory (opmG_CategoryList, opm_Search_PCategory, opmC_FindByID);
0076: CurMan := opm_Form_Main.FNopm_GetManufacturer (opmG_ManufacturerList, opm_Search_PManufacturer, opmC_FindByID);
0077: opm_ComboBox_SearchCat.Items := opmG_CategoryBoxList;
0078: opm_ComboBox_SearchCat.ItemIndex := CurCat.ListIndex;
0079: opm_ComboBox_SearchMan.Items := opmG_ManufacturerBoxList;
0080: opm_ComboBox_SearchMan.ItemIndex := CurMan.ListIndex;
0081: opm_Edit_SearchModel.Text := TRIM (opm_Search_PModel);
0082: opm_Edit_SearchName.Text := TRIM (opm_Search_PName);
0083: opm_Edit_SearchDescription.Text := TRIM (opm_Search_PDesc);
0084: opm_RadioGroup_SearchSPrice.ItemIndex := ABS (opm_Search_PSPrice);
0085: opm_RadioGroup_SearchImgURL.ItemIndex := ABS (opm_Search_PImagURL);
0086: opm_RadioGroup_SearchAvailable.ItemIndex := ABS (opm_Search_PAvailable);
0087: end;
0088:
0089: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0090: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0091: procedure Topm_Form_SearchProduct.opm_BitBtn_SearchOkClick(Sender: TObject);
0092: VAR
0093: CurCat : opmR_Category;
0094: CurMan : opmR_Manufacturer;
0095: begin
0096: CurCat := opm_Form_Main.FNopm_GetCategory (opmG_CategoryList, opm_ComboBox_SearchCat.ItemIndex, opmC_FindByIndex);
0097: opm_Search_PCategory := CurCat.ID;
0098: CurMan := opm_Form_Main.FNopm_GetManufacturer (opmG_ManufacturerList, opm_ComboBox_SearchMan.ItemIndex, opmC_FindByIndex);
0099: opm_Search_PManufacturer := CurMan.ID;
0100: opm_Search_PModel := TRIM (opm_Edit_SearchModel.Text);
0101: opm_Search_PName := TRIM (opm_Edit_SearchName.Text);
0102: opm_Search_PDesc := TRIM (opm_Edit_SearchDescription.Text);
0103: opm_Search_PSPrice := ABS (opm_RadioGroup_SearchSPrice.ItemIndex);
0104: opm_Search_PImagURL := ABS (opm_RadioGroup_SearchImgURL.ItemIndex);
0105: opm_Search_PAvailable := ABS (opm_RadioGroup_SearchAvailable.ItemIndex);
0106: end;
0107:
0108:
0109: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0110: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0111: procedure Topm_Form_SearchProduct.FormCreate(Sender: TObject);
0112: begin
0113: TranslateComponent (self);
0114: end;
0115:
0116: end.