📄 dailystorefindfrm.pas
字号:
unit DailyStoreFindFrm;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
FindFrameFrm, Db, ADODB, ActnList, Grids, DBGridEh, StdCtrls, Buttons,
ComCtrls, jpeg, ExtCtrls, EHGrids,import1;
type
TDailyStoreFindForm = class(TFindFrameForm)
Label4: TLabel;
ADOQuery2: TADOQuery;
ADOQuery1DSDesigner: TWideStringField;
ADOQuery1DSDesigner2: TWideStringField;
ADOQuery1DSDesigner3: TDateTimeField;
ADOQuery1DSDesigner4: TFloatField;
ADOQuery1DSDesigner5: TFloatField;
// cbStoreName: TComboBox;
procedure FormDestroy(Sender: TObject);
// procedure cbStoreNameChange(Sender: TObject);
procedure AExecExecute(Sender: TObject);
procedure APrintExecute(Sender: TObject);
procedure AReviewExecute(Sender: TObject);
private
FStoreName: string;
procedure SetStoreName(const Value: string);
{ Private declarations }
protected
// procedure InitInterface; override;
/// procedure InitCondition; override;
// procedure CreateConditionString; override;
public
{ Public declarations }
// property StoreName: string read FStoreName write SetStoreName;
end;
var
DailyStoreFindForm: TDailyStoreFindForm;
implementation
uses U_DM, Ufunction;
{$R *.DFM}
{ TDailyStoreFindForm }
const AllStoreInfo = '<<全部>>';
{procedure TDailyStoreFindForm.InitInterface;
procedure SetStoreNameList(StoreNameList: TStrings);
begin
StoreNameList.Clear;
StoreNameList.Add(AllStoreInfo);
with ADOQuery2 do
begin
Close;
SQL.Clear;
SQL.Add(' SELECT * FROM s_customer ');
SQL.Add(' ORDER BY ncname ');
Open;
end;
if ADOQuery2.RecordCount>0 then
begin
while not ADOQuery2.Eof do
begin
StoreNameList.Add(ADOQuery2.FieldByName('ncname').asstring);
ADOQuery2.Next;
end;//while
end;//if
end;//function
begin
inherited;
SetStoreNameList(cbStoreName.Items);
// cbStoreName.ItemIndex := 0;
end; }
{procedure TDailyStoreFindForm.InitCondition;
begin
inherited;
StoreName := AllStoreInfo;
ColumnIndex := 1;
IsASCOrder := false;
end; }
//procedure TDailyStoreFindForm.CreateConditionString;
//var
// sBeginDate,sEndDate,sStoreName: string;
//begin
{ inherited;
sBeginDate := DateToStr(BeginDate);
sEndDate := DateToStr(EndDate);
if StoreName=AllStoreInfo then sStoreName := '%' else sStoreName := StoreName;
if DTPEnd.Checked then
ConditionString := ' WHERE xs_rbm.drbDate<= '''+sEndDate+''''+
' AND s_customer.ncname LIKE '''+sStoreName+'''';
if DTPBegin.Checked then
ConditionString := ' WHERE xs_rbm.drbDate>= '''+sBeginDate+''''+
' AND s_customer.ncname LIKE '''+sStoreName+'''';
if DTPBegin.Checked and DTPEnd.Checked then
ConditionString := ' WHERE xs_rbm.drbDate>= '''+sBeginDate+''''+
' AND xs_rbm.drbDate<= '''+sEndDate+''''+
' AND s_customer.ncname LIKE '''+sStoreName+'''';
if not DTPBegin.Checked and not DTPEnd.Checked then
ConditionString := ' WHERE s_customer.ncname LIKE '''+sStoreName+''''; }
// ShowMessage(ConditionString);
//end;
procedure TDailyStoreFindForm.AExecExecute(Sender: TObject);
begin
inherited;
with ADOQuery1 do
begin
Close;
SQL.Clear;
SQL.Add(' SELECT xs_rbd.sgoodno, ');
SQL.Add(' sum(xs_rbd.ndd1) as ndd1, ');
SQL.Add(' sum(xs_rbd.ndd2) as ndd2, ');
SQL.Add(' sum(xs_rbd.ndd3) as ndd3, ');
SQL.Add(' sum(xs_rbd.ndd4) as ndd4, ');
SQL.Add(' sum(xs_rbd.ndd5) as ndd5, ');
SQL.Add(' sum(xs_rbd.ndd6) as ndd6, ');
SQL.Add(' sum(xs_rbd.ndd7) as ndd7, ');
SQL.Add(' sum(xs_rbd.ndd8) as ndd8, ');
SQL.Add(' sum(xs_rbd.ndd9) as ndd9, ');
SQL.Add(' sum(xs_rbd.ndd10) as ndd10, ');
SQL.Add(' sum(xs_rbd.ndd11) as ndd11, ');
SQL.Add(' sum(xs_rbd.ndd12) as ndd12, ');
SQL.Add(' sum(xs_rbd.ndd13) as ndd13, ');
SQL.Add(' sum(xs_rbd.ndd14) as ndd14, ');
SQL.Add(' sum(xs_rbd.ndd15) as ndd15, ');
SQL.Add(' Sum(xs_rbd.amount) AS amount, ');
SQL.Add(' Sum(xs_rbd.nprice) AS ntotal ');
SQL.Add(' FROM xs_rbd join xs_rbm ');
SQL.Add(' on xs_rbm.sxsrbno = xs_rbd.id ');
SQL.Add(ConditionString);
SQL.Add(' GROUP BY xs_rbd.sgoodno ');
Open;
Sort := SortString;
end;
end;
////////////////////////////////////////////////////////////////////////////////
procedure TDailyStoreFindForm.SetStoreName(const Value: string);
begin
// FStoreName := Value;
//if cbStoreName.Text<>Value then
// cbStoreName.ItemIndex := cbStoreName.Items.IndexOf(Value);
end;
procedure TDailyStoreFindForm.FormDestroy(Sender: TObject);
begin
inherited;
DailyStoreFindForm := nil;
end;
{procedure TDailyStoreFindForm.cbStoreNameChange(Sender: TObject);
begin
inherited;
StoreName := cbStoreName.Text;
AExec.OnExecute(nil);
end; }
procedure TDailyStoreFindForm.APrintExecute(Sender: TObject);
begin
inherited;
CreateReport(Application.Handle,DM.ADOConnection.ConnectionString,'301','0',
nil,TAdoQuery(DataSource1.DataSet),true) ;
end;
procedure TDailyStoreFindForm.AReviewExecute(Sender: TObject);
begin
CreateReport(Application.Handle,DM.ADOConnection.ConnectionString,'301','0',
nil,TAdoQuery(DataSource1.DataSet),false) ;
inherited;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -