问题:文中在N1Clicksender:tobject中能再次弹出 scrollbox2并修改MEMO1显示内容吗?
描述:DELPHI
implementation
uses dazldatap,cldsearchp,scglformp,outdatap;
{$R *.dfm}
procedure Tchtzform.BitBtn6Click(Sender: TObject);
begin
outdata.clmxcds.Close;
outdata.chmxcds.Close;
outdata.cldcds.Close;
dazlmodule.clzlcds.Close;
if cldsearch.Showing then cldsearch.Close;
chtzform.Close;
end;
procedure Tchtzform.BitBtn7Click(Sender: TObject);
begin
cldsearch.Show;
end;
procedure Tchtzform.BitBtn1Click(Sender: TObject);
begin
with outdata.clmxcds do
begin
if Active then
begin
First;
while not Eof do
begin
edit;
if fieldbyname('chsl').IsNull then
FieldByName('chyd').Value :=fieldbyname('sl').Value
else
FieldByName('chyd').Value :=fieldbyname('sl').Value-fieldbyname('chsl').Value;
next;
end;
first;
end;
end;
end;
procedure Tchtzform.BitBtn4Click(Sender: TObject);
begin
with outdata.cldcds do
begin
if (FieldByName('sh').AsString='Y') or FieldByName('hth').IsNull or (FieldByName('bmbh').AsString='B028') or (FieldByName('bmbh').AsString='B029') or (fieldbyname('bmbh').AsString>'C') then
begin
memo1.Lines.Clear;
memo1.Lines.Add(dbedit10.Text+dazlmodule.ywycds.fieldbyname('dh').AsString+dbedit11.Text);
mprint :='first';
scrollbox2.Visible :=true;
edit1.SetFocus;
end
else
showmessage('请通过审核!');
end;
end;
procedure Tchtzform.FormShow(Sender: TObject);
begin{屏幕初始化}
dazlmodule.updatesql.SQL.Clear;
dazlmodule.updatesql.SQL.Add('chtz');
cldsearchp.mkg :=false;
end;
procedure Tchtzform.BitBtn3Click(Sender: TObject);
begin
scrollbox2.Visible :=false;
end;
procedure Tchtzform.BitBtn2Click(Sender: TObject);
var year :string;
i :integer;
begin
outdata.clmxcds.Filter :='chyd<>0';
outdata.clmxcds.Filtered :=true;
if outdata.clmxcds.RecordCount=0 then
begin
outdata.clmxcds.Filtered :=false;
showmessage('无数据打印!');
end
else
begin
if mprint='first' then
begin
dazlmodule.bmdmcds.Locate('bmbh',dbedit12.text,[]);
dazlmodule.bmdmcds.Edit;
year :=copy(formatdatetime('YYMMDD',date),1,2);
if strtoint(year)=dazlmodule.bmdmcds.FieldByName('nf').Value then
begin
if copy(dbedit1.Text,7,1)='C' then dazlmodule.bmdmcds.FieldByName('chzt').Value :=dazlmodule.bmdmcds.fieldbyname('chzt').Value+1;
if copy(dbedit1.Text,7,1)='P' then dazlmodule.bmdmcds.FieldByName('chlj').Value :=dazlmodule.bmdmcds.fieldbyname('chlj').Value+1;
if length(dbedit1.Text)<10 then dazlmodule.bmdmcds.FieldByName('chlj').Value :=dazlmodule.bmdmcds.fieldbyname('chlj').Value+1;
end
else
begin
dazlmodule.bmdmcds.FieldByName('nf').AsString :=year;
dazlmodule.bmdmcds.FieldByName('clzt').Value :=1;
dazlmodule.bmdmcds.FieldByName('cllj').Value :=1;
dazlmodule.bmdmcds.FieldByName('chzt').Value :=1;
dazlmodule.bmdmcds.FieldByName('chlj').Value :=1;
dazlmodule.bmdmcds.FieldByName('qys').Value :=1;
dazlmodule.bmdmcds.FieldByName('gjs').Value :=1;
end;
dazlmodule.bmdmcds.UpdateBatch(arall);
if dbedit12.Text='B030' then
mno:='X'+copy(dbedit12.Text,3,2)+'A'+year+copy('0000',1,4-length(dazlmodule.bmdmcds.fieldbyname('chlj').AsString))+dazlmodule.bmdmcds.fieldbyname('chlj').AsString
else
begin
if copy(dbedit1.Text,7,1)='C' then mno :='X'+copy(dbedit12.Text,3,2)+'A'+year+'C'+copy('0000',1,4-length(dazlmodule.bmdmcds.fieldbyname('chzt').AsString))+dazlmodule.bmdmcds.fieldbyname('chzt').AsString;
if copy(dbedit1.Text,7,1)='P' then mno :='X'+copy(dbedit12.Text,3,2)+'A'+year+'P'+copy('0000',1,4-length(dazlmodule.bmdmcds.fieldbyname('chlj').AsString))+dazlmodule.bmdmcds.fieldbyname('chlj').AsString;
if length(dbedit1.Text)<10 then mno :='X'+copy(dbedit12.Text,3,2)+'A'+year+'P'+copy('0000',1,4-length(dazlmodule.bmdmcds.fieldbyname('chlj').AsString))+dazlmodule.bmdmcds.fieldbyname('chlj').AsString;
end;
end;
QRLabel1.Caption :=mno;
QRLabel3.Caption :=copy(formatdatetime('YYYYMMDD',date),3,2);
QRLabel4.Caption :=copy(formatdatetime('YYYYMMDD',date),5,2);
QRLabel5.Caption :=copy(formatdatetime('YYYYMMDD',date),7,2);
QRLabel2.Caption :=edit1.Text;
QRLabel6.Caption :=edit2.Text;
QRLabel7.Caption :=dazlmodule.namecds.fieldbyname('name').AsString;
QRLabel8.Caption :=timetostr(time);
QRlabel9.Caption :=formatdatetime('YY.MM.DD',date);
QRMemo1.Lines :=memo1.Lines;
for i :=1 to strtoint(edit4.Text) do chtzprt.Print;
outdata.clmxcds.Filtered :=false;
ysfado.Close;
ysfado.Parameters[0].Value :=dbedit12.Text;
ysfado.Parameters[1].Value :=mno;
ysfado.Parameters[2].Value :=date;
ysfado.Parameters[3].Value :=dbedit1.Text;
ysfado.Parameters[4].Value :=dbedit2.Text;
ysfado.Parameters[5].Value :=edit2.Text;
ysfado.Parameters[6].Value :=0;
ysfado.ExecSQL;
outdata.ysfch.Close;
outdata.ysfch.Params[0].AsString :=dbedit1.Text ;
outdata.ysfch.Open;
if mprint='first' then
begin
outdata.cldcds.Edit;
outdata.cldcds.FieldByName('chlg').Value :=-1;
outdata.clmxcds.First;
i:=1;
while not outdata.clmxcds.Eof do
begin
if not (outdata.clmxcds.FieldByName('chyd').Value=0) then
begin
chmxado.Close;
chmxado.Parameters[0].Value :=dbedit12.Text;
chmxado.Parameters[1].Value :=mno;
chmxado.Parameters[2].Value :=i;
chmxado.Parameters[3].Value :=dbedit1.Text;
chmxado.Parameters[4].Value :=outdata.clmxcds.fieldbyname('xc').Value;
chmxado.Parameters[5].Value :=outdata.clmxcds.fieldbyname('clbh').Value;
chmxado.Parameters[6].Value :=outdata.clmxcds.fieldbyname('chyd').Value;
if copy(dbedit12.Text,1,1)='A' then
chmxado.Parameters[7].Value :=outdata.clmxcds.fieldbyname('dj').Value
else
chmxado.Parameters[7].Value :=0;
chmxado.Parameters[8].Value :=dbedit9.Text;
chmxado.Parameters[9].Value :=dbedit2.Text;
chmxado.Parameters[10].Value :=date;
chmxado.Parameters[11].Value :=0;
chmxado.Parameters[12].Value :=copy(formatdatetime('YYYYMMDD',date),1,2);
chmxado.ExecSQL;
i :=i+1;
end;
outdata.cldcds.Edit;
outdata.cldcds.FieldByName('xhje').Value :=outdata.cldcds.fieldbyname('xhje').Value+outdata.clmxcds.fieldbyname('chyd').Value*outdata.clmxcds.fieldbyname('dj').Value;
outdata.clmxcds.Edit;
outdata.clmxcds.FieldByName('chsl').Value :=outdata.clmxcds.fieldbyname('chsl').Value+outdata.clmxcds.fieldbyname('chyd').Value;
if outdata.clmxcds.FieldByName('sl').Value<>outdata.clmxcds.FieldByName('chsl').Value then outdata.cldcds.FieldByName('chlg').Value :=0;
outdata.clmxcds.FieldByName('chyd').Value :=0;
outdata.clmxcds.Next;
end;
outdata.cldcds.ApplyUpdates(-1);
outdata.clmxcds.ApplyUpdates(-1);
outdata.chmxcds.Close;
outdata.chmxcds.Params[0].AsString :=dbedit1.Text;
outdata.chmxcds.Open;
end
else
outdata.clmxcds.CancelUpdates;
end;
scrollbox2.Visible :=false;
end;
procedure Tchtzform.FormKeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
key:=#0;
perform(WM_NEXTDLGCTL,0,0);
end;
end;
procedure Tchtzform.BitBtn5Click(Sender: TObject);
beg
if cldsearchp.mkg then
begin
cldsearchp.mkg :=false;
bitbtn5.Caption :='未出';
end
else
begin
cldsearchp.mkg :=true;
bitbtn5.Caption :='已出';
end;
end;
procedure Tchtzform.N1Click(Sender: TObject);
begin
if not outdata.chmxcds.FieldByName('chdh').IsNull then
if messagedlg('确定再次打印吗?'+#13+mno,mtconfirmation,mbokcancel,0)=mrok then
begin
mno :=outdata.chmxcds.fieldbyname('chdh').AsString;
outdata.chmxcds.Filter :='chdh='''+mno+'''';
outdata.chmxcds.Filtered :=true;
outdata.chmxcds.First;
while not outdata.chmxcds.Eof do
begin
outdata.clmxcds.FindKey([outdata.chmxcds.FieldByName('xc').Value]);
outdata.clmxcds.Edit;
outdata.clmxcds.FieldByName('chsl').Value :=outdata.clmxcds.fieldbyname('chsl').Value-outdata.chmxcds.fieldbyname('sl').Value;
outdata.clmxcds.FieldByName('chyd').Value :=outdata.chmxcds.fieldbyname('sl').Value;
outdata.chmxcds.Next;
end;
outdata.chmxcds.Filtered :=false;
mprint :='second';
bitbtn2click(sender);
end;
end;
end.
- 明星图片
- 相关文章
-
联系邮箱:mxgf168#qq.com(#改为@)