Source code of file oscpmwin_v0.4.1.816/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:     SysUtils, Forms, StdCtrls, Buttons, ExtCtrls, Classes, Controls;
0028:   
0029:   type
0030:     Topm_Form_SearchProduct = class(TForm)
0031:       opm_ComboBox_SearchCat: TComboBox;
0032:       opm_ComboBox_SearchMan: TComboBox;
0033:       opm_Edit_SearchModel: TEdit;
0034:       opm_Edit_SearchName: TEdit;
0035:       opm_Label_SearchCat: TLabel;
0036:       opm_Label_SearchMan: TLabel;
0037:       opm_Label_SearchModel: TLabel;
0038:       opm_Label_SearchName: TLabel;
0039:       opm_BitBtn_SearchOk: TBitBtn;
0040:       opm_BitBtn_SearchCancel: TBitBtn;
0041:       opm_Label_SearchDescription: TLabel;
0042:       opm_Edit_SearchDescription: TEdit;
0043:       opm_RadioGroup_SearchSPrice: TRadioGroup;
0044:       opm_RadioGroup_SearchImgURL: TRadioGroup;
0045:       opm_RadioGroup_SearchAvailable: TRadioGroup;
0046:       procedure FormShow(Sender: TObject);
0047:       procedure opm_BitBtn_SearchOkClick(Sender: TObject);
0048:       procedure FormCreate(Sender: TObject);
0049:     private
0050:       { Private declarations }
0051:     public
0052:     end;
0053:   
0054:   var
0055:     opm_Form_SearchProduct: Topm_Form_SearchProduct;
0056:   
0057:   implementation
0058:   
0059:   {$R *.dfm}
0060:   
0061:   Uses gnugettext, main, oscpmdata;
0062:   
0063:   
0064:   
0065:   
0066:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0067:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0068:   procedure Topm_Form_SearchProduct.FormShow(Sender: TObject);
0069:   VAR
0070:     CurMan : opmR_Manufacturer;
0071:     CurCat : opmR_Category;
0072:   begin
0073:     opm_Form_SearchProduct.Caption := _('Search product');
0074:     CurCat := opm_Form_Main.FNopm_GetCategory (opmG_CategoryList, opm_Search_PCategory, opmC_FindByID);
0075:     CurMan := opm_Form_Main.FNopm_GetManufacturer (opmG_ManufacturerList, opm_Search_PManufacturer, opmC_FindByID);
0076:     opm_ComboBox_SearchCat.Items := opmG_CategoryBoxList;
0077:     opm_ComboBox_SearchCat.ItemIndex := CurCat.ListIndex;
0078:     opm_ComboBox_SearchMan.Items := opmG_ManufacturerBoxList;
0079:     opm_ComboBox_SearchMan.ItemIndex := CurMan.ListIndex;
0080:     opm_Edit_SearchModel.Text := TRIM (opm_Search_PModel);
0081:     opm_Edit_SearchName.Text := TRIM (opm_Search_PName);
0082:     opm_Edit_SearchDescription.Text := TRIM (opm_Search_PDesc);
0083:     opm_RadioGroup_SearchSPrice.ItemIndex := ABS (opm_Search_PSPrice);
0084:     opm_RadioGroup_SearchImgURL.ItemIndex := ABS (opm_Search_PImagURL);
0085:     opm_RadioGroup_SearchAvailable.ItemIndex := ABS (opm_Search_PAvailable);
0086:   end;
0087:   
0088:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0089:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0090:   procedure Topm_Form_SearchProduct.opm_BitBtn_SearchOkClick(Sender: TObject);
0091:   VAR
0092:     CurCat : opmR_Category;
0093:     CurMan : opmR_Manufacturer;
0094:   begin
0095:     CurCat := opm_Form_Main.FNopm_GetCategory (opmG_CategoryList, opm_ComboBox_SearchCat.ItemIndex, opmC_FindByIndex);
0096:     opm_Search_PCategory := CurCat.ID;
0097:     CurMan := opm_Form_Main.FNopm_GetManufacturer (opmG_ManufacturerList, opm_ComboBox_SearchMan.ItemIndex, opmC_FindByIndex);
0098:     opm_Search_PManufacturer := CurMan.ID;
0099:     opm_Search_PModel := TRIM (opm_Edit_SearchModel.Text);
0100:     opm_Search_PName := TRIM (opm_Edit_SearchName.Text);
0101:     opm_Search_PDesc := TRIM (opm_Edit_SearchDescription.Text);
0102:     opm_Search_PSPrice := ABS (opm_RadioGroup_SearchSPrice.ItemIndex);
0103:     opm_Search_PImagURL := ABS (opm_RadioGroup_SearchImgURL.ItemIndex);
0104:     opm_Search_PAvailable := ABS (opm_RadioGroup_SearchAvailable.ItemIndex);
0105:   end;
0106:   
0107:   
0108:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0109:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0110:   procedure Topm_Form_SearchProduct.FormCreate(Sender: TObject);
0111:   begin
0112:     TranslateComponent (self);
0113:   end;
0114:   
0115:   end.
 
 
NA fum/lmd: 2007.07.15
Copyright ©1994-2024 by Mario A. Valdez-Ramírez.
no siga este enlace / do not follow this link