📄 uinputdata.~pas
字号:
edit81.Text:=floattostr(table1.FieldValues['Wcailj']);
edit82.Text:=floattostr(table1.FieldValues['Wluolc']);
edit83.Text:=floattostr(table1.FieldValues['Whlc']);
edit84.Text:=floattostr(table1.FieldValues['Wxianlc']);
edit85.Text:=floattostr(table1.FieldValues['Wbanlc']);
edit86.Text:=floattostr(table1.FieldValues['Wxinglc']);
edit87.Text:=floattostr(table1.FieldValues['Wrelc']);
edit88.Text:=floattostr(table1.FieldValues['Wlenglc']);
edit89.Text:=floattostr(table1.FieldValues['Wdulc']);
edit90.Text:=floattostr(table1.FieldValues['Wcailc']);
edit91.Text:=floattostr(table1.FieldValues['Yluolj']);
edit92.Text:=floattostr(table1.FieldValues['Yhlj']);
edit93.Text:=floattostr(table1.FieldValues['Yxianlj']);
edit94.Text:=floattostr(table1.FieldValues['Ybanlj']);
edit95.Text:=floattostr(table1.FieldValues['Yxinglj']);
edit96.Text:=floattostr(table1.FieldValues['Yrelj']);
edit97.Text:=floattostr(table1.FieldValues['Ylenglj']);
edit98.Text:=floattostr(table1.FieldValues['Ydulj']);
edit99.Text:=floattostr(table1.FieldValues['Ycailj']);
edit100.Text:=floattostr(table1.FieldValues['Yluolc']);
edit101.Text:=floattostr(table1.FieldValues['Yhlc']);
edit102.Text:=floattostr(table1.FieldValues['Yxianlc']);
edit103.Text:=floattostr(table1.FieldValues['Yxinglc']);
edit104.Text:=floattostr(table1.FieldValues['Ybanlc']);
edit105.Text:=floattostr(table1.FieldValues['Yrelc']);
edit106.Text:=floattostr(table1.FieldValues['Ylenglc']);
edit107.Text:=floattostr(table1.FieldValues['Ydulc']);
edit108.Text:=floattostr(table1.FieldValues['Ycailc']);
end;
if not table1.Locate('ddate',fminputdata.DateTimePicker1.Date,[]) then
begin
fminputdata.fmcleardata;
showmessage('没有'+formatdatetime('yyyy-mm-dd',fminputdata.DateTimePicker1.date)+'记录,请核对!!');
end;
end;
l24:=strtofloat(edit1.Text)+strtofloat(edit5.Text)+strtofloat(edit9.Text)+strtofloat(edit13.Text)+strtofloat(edit17.Text)+strtofloat(edit21.Text)+strtofloat(edit25.Text)+strtofloat(edit29.Text)+strtofloat(edit33.Text);
label24.Caption:=floattostr(l24);
l25:=strtofloat(edit2.Text)+strtofloat(edit6.Text)+strtofloat(edit10.Text)+strtofloat(edit14.Text)+strtofloat(edit18.Text)+strtofloat(edit22.Text)+strtofloat(edit26.Text)+strtofloat(edit30.Text)+strtofloat(edit34.Text);
label25.Caption:=floattostr(l25);
l26:=strtofloat(edit3.Text)+strtofloat(edit7.Text)+strtofloat(edit11.Text)+strtofloat(edit15.Text)+strtofloat(edit19.Text)+strtofloat(edit23.Text)+strtofloat(edit27.Text)+strtofloat(edit31.Text)+strtofloat(edit35.Text);
label26.Caption:=floattostr(l26);
l27:=strtofloat(edit4.Text)+strtofloat(edit8.Text)+strtofloat(edit12.Text)+strtofloat(edit16.Text)+strtofloat(edit20.Text)+strtofloat(edit24.Text)+strtofloat(edit28.Text)+strtofloat(edit32.Text)+strtofloat(edit36.Text);
label27.Caption:=floattostr(l27);
l28:=strtofloat(edit37.Text)+strtofloat(edit41.Text)+strtofloat(edit45.Text)+strtofloat(edit49.Text)+strtofloat(edit53.Text)+strtofloat(edit57.Text)+strtofloat(edit61.Text)+strtofloat(edit65.Text)+strtofloat(edit69.Text);
label28.Caption:=floattostr(l28);
l29:=strtofloat(edit38.Text)+strtofloat(edit42.Text)+strtofloat(edit46.Text)+strtofloat(edit50.Text)+strtofloat(edit54.Text)+strtofloat(edit58.Text)+strtofloat(edit62.Text)+strtofloat(edit66.Text)+strtofloat(edit70.Text);
label29.Caption:=floattostr(l29);
l30:=strtofloat(edit39.Text)+strtofloat(edit43.Text)+strtofloat(edit47.Text)+strtofloat(edit51.Text)+strtofloat(edit55.Text)+strtofloat(edit59.Text)+strtofloat(edit63.Text)+strtofloat(edit67.Text)+strtofloat(edit71.Text);
label30.Caption:=floattostr(l30);
l31:=strtofloat(edit40.Text)+strtofloat(edit44.Text)+strtofloat(edit48.Text)+strtofloat(edit52.Text)+strtofloat(edit56.Text)+strtofloat(edit60.Text)+strtofloat(edit64.Text)+strtofloat(edit68.Text)+strtofloat(edit72.Text);
label31.Caption:=floattostr(l31);
l28:=strtofloat(edit37.Text)+strtofloat(edit41.Text)+strtofloat(edit45.Text)+strtofloat(edit49.Text)+strtofloat(edit53.Text)+strtofloat(edit57.Text)+strtofloat(edit61.Text)+strtofloat(edit65.Text)+strtofloat(edit69.Text);
label28.Caption:=floattostr(l28);
l29:=strtofloat(edit38.Text)+strtofloat(edit42.Text)+strtofloat(edit46.Text)+strtofloat(edit50.Text)+strtofloat(edit54.Text)+strtofloat(edit58.Text)+strtofloat(edit62.Text)+strtofloat(edit66.Text)+strtofloat(edit70.Text);
label29.Caption:=floattostr(l29);
l30:=strtofloat(edit39.Text)+strtofloat(edit43.Text)+strtofloat(edit47.Text)+strtofloat(edit51.Text)+strtofloat(edit55.Text)+strtofloat(edit59.Text)+strtofloat(edit63.Text)+strtofloat(edit67.Text)+strtofloat(edit71.Text);
label30.Caption:=floattostr(l30);
l31:=strtofloat(edit40.Text)+strtofloat(edit44.Text)+strtofloat(edit48.Text)+strtofloat(edit52.Text)+strtofloat(edit56.Text)+strtofloat(edit60.Text)+strtofloat(edit64.Text)+strtofloat(edit68.Text)+strtofloat(edit72.Text);
label31.Caption:=floattostr(l31);
l36:=strtofloat(edit73.Text)+strtofloat(edit74.Text)+strtofloat(edit75.Text)+strtofloat(edit76.Text)+strtofloat(edit77.Text)+strtofloat(edit78.Text)+strtofloat(edit79.Text)+strtofloat(edit80.Text)+strtofloat(edit81.Text);
label36.Caption:=floattostr(l36);
l37:=strtofloat(edit82.Text)+strtofloat(edit83.Text)+strtofloat(edit84.Text)+strtofloat(edit85.Text)+strtofloat(edit86.Text)+strtofloat(edit87.Text)+strtofloat(edit88.Text)+strtofloat(edit89.Text)+strtofloat(edit90.Text);
label37.Caption:=floattostr(l37);
l38:=strtofloat(edit91.Text)+strtofloat(edit92.Text)+strtofloat(edit93.Text)+strtofloat(edit94.Text)+strtofloat(edit95.Text)+strtofloat(edit96.Text)+strtofloat(edit97.Text)+strtofloat(edit98.Text)+strtofloat(edit99.Text);
label38.Caption:=floattostr(l38);
l39:=strtofloat(edit100.Text)+strtofloat(edit101.Text)+strtofloat(edit102.Text)+strtofloat(edit103.Text)+strtofloat(edit104.Text)+strtofloat(edit105.Text)+strtofloat(edit106.Text)+strtofloat(edit107.Text)+strtofloat(edit108.Text);
label39.Caption:=floattostr(l39);
end;
procedure Tfminputdata.BitBtn4Click(Sender: TObject);
var l24,l25,l26,l27,l28,l29,l30,l31,l36,l37,l38,l39:real;
begin
i:=false;
if table1.Locate('ddate',fminputdata.DateTimePicker1.Date,[]) then
begin
table1.Edit;
fminputdata.appedit;
table1.Post;
l24:=strtofloat(edit1.Text)+strtofloat(edit5.Text)+strtofloat(edit9.Text)+strtofloat(edit13.Text)+strtofloat(edit17.Text)+strtofloat(edit21.Text)+strtofloat(edit25.Text)+strtofloat(edit29.Text)+strtofloat(edit33.Text);
label24.Caption:=floattostr(l24);
l25:=strtofloat(edit2.Text)+strtofloat(edit6.Text)+strtofloat(edit10.Text)+strtofloat(edit14.Text)+strtofloat(edit18.Text)+strtofloat(edit22.Text)+strtofloat(edit26.Text)+strtofloat(edit30.Text)+strtofloat(edit34.Text);
label25.Caption:=floattostr(l25);
l26:=strtofloat(edit3.Text)+strtofloat(edit7.Text)+strtofloat(edit11.Text)+strtofloat(edit15.Text)+strtofloat(edit19.Text)+strtofloat(edit23.Text)+strtofloat(edit27.Text)+strtofloat(edit31.Text)+strtofloat(edit35.Text);
label26.Caption:=floattostr(l26);
l27:=strtofloat(edit4.Text)+strtofloat(edit8.Text)+strtofloat(edit12.Text)+strtofloat(edit16.Text)+strtofloat(edit20.Text)+strtofloat(edit24.Text)+strtofloat(edit28.Text)+strtofloat(edit32.Text)+strtofloat(edit36.Text);
label27.Caption:=floattostr(l27);
l28:=strtofloat(edit37.Text)+strtofloat(edit41.Text)+strtofloat(edit45.Text)+strtofloat(edit49.Text)+strtofloat(edit53.Text)+strtofloat(edit57.Text)+strtofloat(edit61.Text)+strtofloat(edit65.Text)+strtofloat(edit69.Text);
label28.Caption:=floattostr(l28);
l29:=strtofloat(edit38.Text)+strtofloat(edit42.Text)+strtofloat(edit46.Text)+strtofloat(edit50.Text)+strtofloat(edit54.Text)+strtofloat(edit58.Text)+strtofloat(edit62.Text)+strtofloat(edit66.Text)+strtofloat(edit70.Text);
label29.Caption:=floattostr(l29);
l30:=strtofloat(edit39.Text)+strtofloat(edit43.Text)+strtofloat(edit47.Text)+strtofloat(edit51.Text)+strtofloat(edit55.Text)+strtofloat(edit59.Text)+strtofloat(edit63.Text)+strtofloat(edit67.Text)+strtofloat(edit71.Text);
label30.Caption:=floattostr(l30);
l31:=strtofloat(edit40.Text)+strtofloat(edit44.Text)+strtofloat(edit48.Text)+strtofloat(edit52.Text)+strtofloat(edit56.Text)+strtofloat(edit60.Text)+strtofloat(edit64.Text)+strtofloat(edit68.Text)+strtofloat(edit72.Text);
label31.Caption:=floattostr(l31);
l36:=strtofloat(edit73.Text)+strtofloat(edit74.Text)+strtofloat(edit75.Text)+strtofloat(edit76.Text)+strtofloat(edit77.Text)+strtofloat(edit78.Text)+strtofloat(edit79.Text)+strtofloat(edit80.Text)+strtofloat(edit81.Text);
label36.Caption:=floattostr(l36);
l37:=strtofloat(edit82.Text)+strtofloat(edit83.Text)+strtofloat(edit84.Text)+strtofloat(edit85.Text)+strtofloat(edit86.Text)+strtofloat(edit87.Text)+strtofloat(edit88.Text)+strtofloat(edit89.Text)+strtofloat(edit90.Text);
label37.Caption:=floattostr(l37);
l38:=strtofloat(edit91.Text)+strtofloat(edit92.Text)+strtofloat(edit93.Text)+strtofloat(edit94.Text)+strtofloat(edit95.Text)+strtofloat(edit96.Text)+strtofloat(edit97.Text)+strtofloat(edit98.Text)+strtofloat(edit99.Text);
label38.Caption:=floattostr(l38);
l39:=strtofloat(edit100.Text)+strtofloat(edit101.Text)+strtofloat(edit102.Text)+strtofloat(edit103.Text)+strtofloat(edit104.Text)+strtofloat(edit105.Text)+strtofloat(edit106.Text)+strtofloat(edit107.Text)+strtofloat(edit108.Text);
label39.Caption:=floattostr(l39);
showmessage(formatdatetime('yyyy-mm-dd',fminputdata.DateTimePicker1.date)+' 记录,修改成功!!');
fminputdata.DateTimePicker1.OnChange(sender);
end
else showmessage(formatdatetime('yyyy-mm-dd',fminputdata.DateTimePicker1.date)+' 当日记录不存在,请核对!!');
end;
procedure Tfminputdata.RadioGroup1Click(Sender: TObject);
begin
fminputdata.fmcleardata;
if radiogroup1.ItemIndex=0 then bitbtn1.Enabled:=true else bitbtn1.Enabled:=false;
if radiogroup1.ItemIndex=1 then bitbtn4.Enabled:=true else bitbtn4.Enabled:=false;
end;
procedure Tfminputdata.BitBtn3Click(Sender: TObject);
begin
application.CreateForm(tfmsumreport,fmsumreport);
fmsumreport.query1.Close;
fmsumreport.query1.Params[0].Value:=fminputdata.DateTimePicker1.Date;
fmsumreport.query1.ExecSQL;
fmsumreport.query1.Active:=true;
if fmsumreport.query1.RecordCount>0 then
fmsumreport.QuickRep1.Preview else showmessage('没有该天的记录,请核对!!');
end;
procedure Tfminputdata.BitBtn2Click(Sender: TObject);
begin
fminputdata.Close;
end;
procedure Tfminputdata.BitBtn5Click(Sender: TObject);
var m1:string;
begin
m1:=formatdatetime('mm',fminputdata.DateTimePicker1.Date);
if table2.Locate('ddate',m1,[]) then
begin
if MessageDlg('本月数据已经存在,是否更新?',
mtConfirmation, [mbYes, mbNo], 0) = mrYes then
begin
table2.Edit;
Table2.FieldValues['ddate']:=m1;
Table2.FieldValues['Wluolj']:=strtofloat(edit73.Text);
Table2.FieldValues['Whlj']:=strtofloat(edit74.Text);
Table2.FieldValues['Wxianlj']:=strtofloat(edit75.Text);
Table2.FieldValues['Wbanlj']:=strtofloat(edit76.Text);
Table2.FieldValues['Wxinglj']:=strtofloat(edit77.Text);
Table2.FieldValues['Wrelj']:=strtofloat(edit78.Text);
Table2.FieldValues['Wlenglj']:=strtofloat(edit79.Text);
Table2.FieldValues['Wdulj']:=strtofloat(edit80.Text);
Table2.FieldValues['Wcailj']:=strtofloat(edit81.Text);
Table2.FieldValues['Wluolc']:=strtofloat(edit82.Text);
Table2.FieldValues['Whlc']:=strtofloat(edit83.Text);
Table2.FieldValues['Wxianlc']:=strtofloat(edit84.Text);
Table2.FieldValues['Wbanlc']:=strtofloat(edit85.Text);
Table2.FieldValues['Wxinglc']:=strtofloat(edit86.Text);
Table2.FieldValues['Wrelc']:=strtofloat(edit87.Text);
Table2.FieldValues['Wlenglc']:=strtofloat(edit88.Text);
Table2.FieldValues['Wdulc']:=strtofloat(edit89.Text);
Table2.FieldValues['Wcailc']:=strtofloat(edit90.Text);
Table2.FieldValues['Yluolj']:=strtofloat(edit91.Text);
Table2.FieldValues['Yhlj']:=strtofloat(edit92.Text);
Table2.FieldValues['Yxianlj']:=strtofloat(edit93.Text);
Table2.FieldValues['Ybanlj']:=strtofloat(edit94.Text);
Table2.FieldValues['Yxinglj']:=strtofloat(edit95.Text);
Table2.FieldValues['Yrelj']:=strtofloat(edit96.Text);
Table2.FieldValues['Ylenglj']:=strtofloat(edit97.Text);
Table2.FieldValues['Ydulj']:=strtofloat(edit98.Text);
Table2.FieldValues['Ycailj']:=strtofloat(edit99.Text);
Table2.FieldValues['Yluolc']:=strtofloat(edit100.Text);
Table2.FieldValues['Yhlc']:=strtofloat(edit101.Text);
Table2.FieldValues['Yxianlc']:=strtofloat(edit102.Text);
Table2.FieldValues['Ybanlc']:=strtofloat(edit103.Text);
Table2.FieldValues['Yxinglc']:=strtofloat(edit104.Text);
Table2.FieldValues['Yrelc']:=strtofloat(edit105.Text);
Table2.FieldValues['Ylenglc']:=strtofloat(edit106.Text);
Table2.FieldValues['Ydulc']:=strtofloat(edit107.Text);
Table2.FieldValues['Ycailc']:=strtofloat(edit108.Text);
Table2.FieldValues['Wluoc']:=strtofloat(edit4.Text);
Table2.FieldValues['Whc']:=strtofloat(edit8.Text);
Table2.FieldValues['Wxianc']:=strtofloat(edit12.Text);
Table2.FieldValues['Wxingc']:=strtofloat(edit16.Text);
Table2.FieldValues['Wbanc']:=strtofloat(edit20.Text);
Table2.FieldValues['Wrec']:=strtofloat(edit24.Text);
Table2.FieldValues['Wlengc']:=strtofloat(edit28.Text);
Table2.FieldValues['Wduc']:=strtofloat(edit32.Text);
Table2.FieldValues['Wcaic']:=strtofloat(edit36.Text);
Table2.FieldValues['Yluoc']:=strtofloat(edit40.Text);
Table2.FieldValues['Yhc']:=strtofloat(edit44.Text);
Table2.FieldValues['Yxianc']:=strtofloat(edit48.Text);
Table2.FieldValues['Yxingc']:=strtofloat(edit52.Text);
Table2.FieldValues['Ybanc']:=strtofloat(edit56.Text);
Table2.FieldValues['Yrec']:=strtofloat(edit60.Text);
Table2.FieldValues['Ylengc']:=strtofloat(edit64.Text);
Table2.FieldValues['Yduc']:=strtofloat(edit68.Text);
Table2.FieldValues['Ycaic']:=strtofloat(edit72.Text);
table2.post;
showmessage('操作已成功!');
end;
end
else
begin
table2.Append;
Table2.FieldValues['ddate']:=m1;
Table2.FieldValues['Wluolj']:=strtofloat(edit73.Text);
Table2.FieldValues['Whlj']:=strtofloat(edit74.Text);
Table2.FieldValues['Wxianlj']:=strtofloat(edit75.Text);
Table2.FieldValues['Wbanlj']:=strtofloat(edit76.Text);
Table2.FieldValues['Wxinglj']:=strtofloat(edit77.Text);
Table2.FieldValues['Wrelj']:=strtofloat(edit78.Text);
Table2.FieldValues['Wlenglj']:=strtofloat(edit79.Text);
Table2.FieldValues['Wdulj']:=strtofloat(edit80.Text);
Table2.FieldValues['Wcailj']:=strtofloat(edit81.Text);
Table2.FieldValues['Wluolc']:=strtofloat(edit82.Text);
Table2.FieldValues['Whlc']:=strtofloat(edit83.Text);
Table2.FieldValues['Wxianlc']:=strtofloat(edit84.Text);
Table2.FieldValues['Wbanlc']:=strtofloat(edit85.Text);
Table2.FieldValues['Wxinglc']:=strtofloat(edit86.Text);
Table2.FieldValues['Wrelc']:=strtofloat(edit87.Text);
Table2.FieldValues['Wlenglc']:=strtofloat(edit88.Text);
Table2.FieldValues['Wdulc']:=strtofloat(edit89.Text);
Table2.FieldValues['Wcailc']:=strtofloat(edit90.Text);
Table2.FieldValues['Yluolj']:=strtofloat(edit91.Text);
Table2.FieldValues['Yhlj']:=strtofloat(edit92.Text);
Table2.FieldValues['Yxianlj']:=strtofloat(edit93.Text);
Table2.FieldValues['Ybanlj']:=strtofloat(edit94.Text);
Table2.FieldValues['Yxinglj']:=strtofloat(edit95.Text);
Table2.FieldValues['Yrelj']:=strtofloat(edit96.Text);
Table2.FieldValues['Ylenglj']:=strtofloat(edit97.Text);
Table2.FieldValues['Ydulj']:=strtofloat(edit98.Text);
Table2.FieldValues['Ycailj']:=strtofloat(edit99.Text);
Table2.FieldValues['Yluolc']:=strtofloat(edit100.Text);
Table2.FieldValues['Yhlc']:=strtofloat(edit101.Text);
Table2.FieldValues['Yxianlc']:=strtofloat(edit102.Text);
Table2.FieldValues['Ybanlc']:=strtofloat(edit103.Text);
Table2.FieldValues['Yxinglc']:=strtofloat(edit104.Text);
Table2.FieldValues['Yrelc']:=strtofloat(edit105.Text);
Table2.FieldValues['Ylenglc']:=strtofloat(edit106.Text);
Table2.FieldValues['Ydulc']:=strtofloat(edit107.Text);
Table2.FieldValues['Ycailc']:=strtofloat(edit108.Text);
Table2.FieldValues['Wluoc']:=strtofloat(edit4.Text);
Table2.FieldValues['Whc']:=strtofloat(edit8.Text);
Table2.FieldValues['Wxianc']:=strtofloat(edit12.Text);
Table2.FieldValues['Wxingc']:=strtofloat(edit16.Text);
Table2.FieldValues['Wbanc']:=strtofloat(edit20.Text);
Table2.FieldValues['Wrec']:=strtofloat(edit24.Text);
Table2.FieldValues['Wlengc']:=strtofloat(edit28.Text);
Table2.FieldValues['Wduc']:=strtofloat(edit32.Text);
Table2.FieldValues['Wcaic']:=strtofloat(edit36.Text);
Table2.FieldValues['Yluoc']:=strtofloat(edit40.Text);
Table2.FieldValues['Yhc']:=strtofloat(edit44.Text);
Table2.FieldValues['Yxianc']:=strtofloat(edit48.Text);
Table2.FieldValues['Yxingc']:=strtofloat(edit52.Text);
Table2.FieldValues['Ybanc']:=strtofloat(edit56.Text);
Table2.FieldValues['Yrec']:=strtofloat(edit60.Text);
Table2.FieldValues['Ylengc']:=strtofloat(edit64.Text);
Table2.FieldValues['Yduc']:=strtofloat(edit68.Text);
Table2.FieldValues['Ycaic']:=strtofloat(edit72.Text);
table2.post;
showmessage('操作已成功!');
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -