FormFind.pas
资源名称:__DCOM.rar [点击查看]
上传用户:etonglee
上传日期:2014-03-01
资源大小:698k
文件大小:2k
源码类别:
Internet/IE编程
开发平台:
Delphi
- unit FormFind;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, Grids, DBGrids, ExtCtrls, DB, DBClient, StdCtrls, ComCtrls;
- type
- TFrmFind = class(TForm)
- Panel1: TPanel;
- DBGrid1: TDBGrid;
- Label1: TLabel;
- Label2: TLabel;
- edtBegin: TDateTimePicker;
- edtEnd: TDateTimePicker;
- btnFind: TButton;
- cltdsFind: TClientDataSet;
- dsFind: TDataSource;
- StatusBar: TStatusBar;
- cltdsFindOrderID: TIntegerField;
- cltdsFindCompanyName: TWideStringField;
- cltdsFindOrderDate: TDateTimeField;
- cltdsFindRequiredDate: TDateTimeField;
- cltdsFindShippedDate: TDateTimeField;
- cltdsFindShipName: TWideStringField;
- procedure btnFindClick(Sender: TObject);
- procedure DBGrid1DblClick(Sender: TObject);
- procedure cltdsFindAfterScroll(DataSet: TDataSet);
- private
- { Private declarations }
- FResult:integer;
- Procedure OpenFind(BeginDate,EndDate:TDateTime);
- public
- { Public declarations }
- Class Function ShowFind():integer;
- end;
- var
- FrmFind: TFrmFind;
- implementation
- uses SvrObj_Orders_TLB, UnitShare;
- {$R *.dfm}
- Class Function TFrmFind.ShowFind():integer;
- begin
- result:=-1;
- FrmFind.FResult:=-1;
- FrmFind.ShowModal();
- if FrmFind.FResult<>-1 then
- result:=FrmFind.FResult;
- end;
- Procedure TFrmFind.OpenFind(BeginDate,EndDate:TDateTime);
- var
- RetData:OleVariant;
- Orders:IOrders;
- begin
- Orders:=CoOrders.CreateRemote(APPSVR);
- Orders.GetOrders(BeginDate,EndDate,RetData);
- cltdsFind.Data:=RetData;
- cltdsFind.ReadOnly:=true;
- end;
- procedure TFrmFind.btnFindClick(Sender: TObject);
- begin
- OpenFind(edtBegin.Date,edtEnd.Date);
- end;
- procedure TFrmFind.DBGrid1DblClick(Sender: TObject);
- begin
- if not cltdsFind.Active then
- exit;
- if cltdsFindOrderID.IsNull then
- begin
- StatusBar.Panels[0].Text:='没有选中订单。';
- exit;
- end;
- FResult:=cltdsFindOrderID.AsInteger;
- close();
- end;
- procedure TFrmFind.cltdsFindAfterScroll(DataSet: TDataSet);
- begin
- StatusBar.Panels[0].Text:=inttostr(cltdsFind.RecNo)+'/'+inttostr(cltdsFind.RecordCount);
- end;
- end.