⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cllrwh.pas

📁 应对服装行业的生产成本控制系统
💻 PAS
📖 第 1 页 / 共 3 页
字号:
frmyg.checkyg(form1.yg,form1.gh,form1.fb,form1.fz);
if form1.yg='' then
begin
bsave.Enabled:=true;
bcancel.Enabled:=true;
tyg.SetFocus;
help.Caption:='  该员工不存在,请您输入正确的员工!';
 exit;
 end;
form1.yg:='';
form1.gh:='';
form1.fb:='';
form1.fz:='';
try
save;
if errcode or (errzt<>0) then save;
if errcode or (errzt<>0) then save;
if errcode or (errzt<>0) then save;
if errcode or (errzt<>0) then
begin
showmessage('   数据库在保存主记录时失败,请您稍后重新保存!');
//errdelete;
bsave.Enabled:=true;
bcancel.Enabled:=true;
exit;
end;
help.Caption:='   员工产量修改成功!' ;
tgh.Text:='';
tfb.Text:='';
tfz.Text:='';
tyg.Text:='';
tbh.Text:='';
tys.Text:='';
tcm.Text:='';
tgxmc.Text:='';
txs.Text:='';
tdj.Text:='';
tsl.Text:='';
tcz.Text:='';
tbz.Text:='';
bsh.Enabled:=true;
bprint.Enabled:=true;
dbgrid5.Enabled:=true;
except
bsave.Enabled:=true;
bcancel.Enabled:=true;
showmessage('     修改员工产量时出现了系统无法识别的错误,请您主动辨别该错误!');
end;
end;

function tFrmcllrwh.errdelete:boolean;
var
relation,cx:string;
begin
 relation:=' = ''';
 cx:='';
    try
  commandstring:='delete from dbo.cllrb';
  commandstring:=commandstring+' where (dbo.cllrb.clh'+relation+cx+clh+cx+''')';
  commandstring:=commandstring+' and (dbo.cllrb.ddh'+relation+cx+DataModule1.ClientDataSet17.fieldbyname('ddh').AsString+cx+''')';
  DataModule1.ClientDataSet25.CommandText:=commandstring;
  DataModule1.ClientDataSet25.Execute;
  khchange;
  except
  showmessage('数据库没有打开')
  end;
  end;

procedure TFrmcllrwh.FormActivate(Sender: TObject);
var
commandstring,relation,cx,str:string;
begin
rzjsj:=datetimetostr(now);
rzczy:=form1.StatusBar1.Panels[4].Text;
rzsj:='员工产量修改';
qq.DateTime:=date-30;
zq.DateTime:=date;
rq.DateTime:=date;
help.Caption:='';
bquery.Enabled:=true;
brework.Enabled:=false;
bsave.Enabled:=false;
bdelete.Enabled:=false;
bsh.Enabled:=false;
bcancel.Enabled:=false;
bprint.Enabled:=false;
dbgrid5.Enabled:=true;
pz.Enabled:=false;
tgh.Text:='';
tfb.Text:='';
tfz.Text:='';
tyg.Text:='';
tbh.Text:='';
tys.Text:='';
tcm.Text:='';
tgxmc.Text:='';
txs.Text:='';
tdj.Text:='';
tsl.Text:='';
tcz.Text:='';
tbz.Text:='';
help.Caption:='  请您点击< 查询>按钮开始查询订单记录!';
end;

procedure TFrmcllrwh.FormClose(Sender: TObject; var Action: TCloseAction);
begin
try
DataModule1.ClientDataSet25.IndexFieldNames:='';
if DataModule1.clientdataset25.Active then  DataModule1.ClientDataSet25.Active:=false;
if DataModule1.ClientDataSet3.Active then DataModule1.ClientDataSet3.Active:=false;
if DataModule1.clientdataset23.Active then DataModule1.ClientDataSet23.Active:=false;
if DataModule1.ClientDataSet24.Active then DataModule1.ClientDataSet24.Active:=false;
if rzcsj<>'' then exit;
rzcsj:=datetimetostr(now);
form16.WriteTorz(rzczy,rzsj,rzjsj,rzcsj);
except
showmessage('数据库没有打开!');
end;
close;
end;

procedure TFrmcllrwh.tygKeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then tbh.SetFocus;
end;

procedure TFrmcllrwh.rqKeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then tgh.SetFocus;
end;

procedure TFrmcllrwh.tczKeyPress(Sender: TObject; var Key: Char);
begin
if not (key in['0'..'9',#8,#13,'.','-']) then
begin
key:=#0;
help.caption:='   请输入数字!';
if key=#13 then tbz.SetFocus;
end;
end;

procedure TFrmcllrwh.BqueryClick(Sender: TObject);
var
commandtring1,relation,cx:string;
begin
 relation:=' like ''';
    cx:='%';
commandstring:='select * from dbo.cllrb';
commandtring1:='select * from dbo.cllrb';
  try
if (trim(qddh.Text)<>'') and (cddh.Checked) then
   begin
 relation:=' like ''';
    cx:='%';
  if  commandstring=commandtring1 then
  begin
commandstring:=commandstring+' where (dbo.cllrb.ddh'+relation+cx+trim(qddh.Text)+cx+''')';
end
else
begin
commandstring:=commandstring+' and (dbo.cllrb.ddh'+relation+cx+trim(qddh.Text)+cx+''')';
end;
end
else
begin
qddh.Text:='';
end;
if (trim(qclh.Text)<>'') and (cclh.Checked) then
   begin
 relation:=' like ''';
    cx:='%';
  if  commandstring=commandtring1 then
  begin
commandstring:=commandstring+' where (dbo.cllrb.clh'+relation+cx+trim(qclh.Text)+cx+''')';
end
else
begin
commandstring:=commandstring+' and (dbo.cllrb.clh'+relation+cx+trim(qclh.Text)+cx+''')';
end;
end
else
begin
qclh.Text:='';
end;
if cqq.Checked then
 begin
if commandstring=commandtring1 then
begin
relation:=' >= ''';
    cx:='';
commandstring:=commandstring+' where (dbo.cllrb.rq'+ relation+FormatDateTime('yyyy-mm-dd',qq.Date)+cx+''')';
end
else
begin
relation:=' >= ''';
    cx:='';
commandstring:=commandstring+' and (dbo.cllrb.rq'+ relation+FormatDateTime('yyyy-mm-dd',qq.Date)+cx+''')';
end;
end;
if czq.Checked then
 begin
if commandstring=commandtring1 then
begin
relation:=' < ''';
    cx:='';
commandstring:=commandstring+' where (dbo.cllrb.rq'+ relation+FormatDateTime('yyyy-mm-dd',zq.Date+1)+cx+''')';
end
else
begin
relation:=' < ''';
    cx:='';
commandstring:=commandstring+' and (dbo.cllrb.rq'+ relation+FormatDateTime('yyyy-mm-dd',zq.Date+1)+cx+''')';
end;
end;
if (trim(qgh.Text)<>'') and (cgh.Checked) then
   begin
    relation:=' like ''';
    cx:='%';
  if  commandstring=commandtring1 then
  begin
commandstring:=commandstring+' where (dbo.cllrb.gh'+relation+cx+trim(qgh.Text)+cx+''')';
end
else
begin
commandstring:=commandstring+' and (dbo.cllrb.gh'+relation+cx+trim(qgh.Text)+cx+''')';
end;
end
else
begin
qgh.Text:='';
end;
if (trim(qfb.Text)<>'') and (cfb.Checked) then
   begin
    relation:=' like ''';
    cx:='%';
  if  commandstring=commandtring1 then
  begin
commandstring:=commandstring+' where (dbo.cllrb.fb'+relation+cx+trim(qfb.Text)+cx+''')';
end
else
begin
commandstring:=commandstring+' and (dbo.cllrb.fb'+relation+cx+trim(qfb.Text)+cx+''')';
end;
end
else
begin
qfb.Text:='';
end;
if (trim(qfz.Text)<>'') and (cfz.Checked) then
   begin
    relation:=' like ''';
    cx:='%';
  if  commandstring=commandtring1 then
  begin
commandstring:=commandstring+' where (dbo.cllrb.fz'+relation+cx+trim(qfz.Text)+cx+''')';
end
else
begin
commandstring:=commandstring+' and (dbo.cllrb.fz'+relation+cx+trim(qfz.Text)+cx+''')';
end;
end
else
begin
qfz.Text:='';
end;
if (trim(qyg.Text)<>'') and (cyg.Checked) then
   begin
    relation:=' like ''';
    cx:='%';
  if  commandstring=commandtring1 then
  begin
commandstring:=commandstring+' where (dbo.cllrb.yg'+relation+cx+trim(qyg.Text)+cx+''')';
end
else
begin
commandstring:=commandstring+' and (dbo.cllrb.yg'+relation+cx+trim(qyg.Text)+cx+''')';
end;
end
else
begin
qyg.Text:='';
end;
if (trim(qbh.Text)<>'') and (cbh.Checked) then
   begin
    relation:=' like ''';
    cx:='%';
  if  commandstring=commandtring1 then
  begin
commandstring:=commandstring+' where (dbo.cllrb.bh'+relation+cx+trim(qbh.Text)+cx+''')';
end
else
begin
commandstring:=commandstring+' and (dbo.cllrb.bh'+relation+cx+trim(qbh.Text)+cx+''')';
end;
end
else
begin
qbh.Text:='';
end;
if (trim(qys.Text)<>'') and (cys.Checked) then
   begin
    relation:=' like ''';
    cx:='%';
  if  commandstring=commandtring1 then
  begin
commandstring:=commandstring+' where (dbo.cllrb.ys'+relation+cx+trim(qys.Text)+cx+''')';
end
else
begin
commandstring:=commandstring+' and (dbo.cllrb.ys'+relation+cx+trim(qys.Text)+cx+''')';
end;
end
else
begin
qys.Text:='';
end;
if (trim(qcm.Text)<>'') and (ccm.Checked) then
   begin
    relation:=' like ''';
    cx:='%';
  if  commandstring=commandtring1 then
  begin
commandstring:=commandstring+' where (dbo.cllrb.cm'+relation+cx+trim(qcm.Text)+cx+''')';
end
else
begin
commandstring:=commandstring+' and (dbo.cllrb.cm'+relation+cx+trim(qcm.Text)+cx+''')';
end;
end
else
begin
qcm.Text:='';
end;
if (trim(qsl.Text)<>'') and (csl.Checked) then
   begin
    relation:=' like ''';
    cx:='%';
  if  commandstring=commandtring1 then
  begin
commandstring:=commandstring+' where (dbo.cllrb.sl'+relation+cx+trim(qsl.Text)+cx+''')';
end
else
begin
commandstring:=commandstring+' and (dbo.cllrb.sl'+relation+cx+trim(qsl.Text)+cx+''')';
end;
end
else
begin
qsl.Text:='';
end;
if (trim(qgxmc.Text)<>'') and (cgxmc.Checked) then
   begin
    relation:=' like ''';
    cx:='%';
  if  commandstring=commandtring1 then
  begin
commandstring:=commandstring+' where (dbo.cllrb.gxmc'+relation+cx+trim(qgxmc.Text)+cx+''')';
end
else
begin
commandstring:=commandstring+' and (dbo.cllrb.gxmc'+relation+cx+trim(qgxmc.Text)+cx+''')';
end;
end
else
begin
qgxmc.Text:='';
end;
if (trim(qdj.Text)<>'') and (cdj.Checked) then
   begin
    relation:=' like ''';
    cx:='%';
  if  commandstring=commandtring1 then
  begin
commandstring:=commandstring+' where (dbo.cllrb.dj'+relation+cx+trim(qdj.Text)+cx+''')';
end
else
begin
commandstring:=commandstring+' and (dbo.cllrb.dj'+relation+cx+trim(qdj.Text)+cx+''')';
end;
end
else
begin
qdj.Text:='';
end;
if (trim(qxs.Text)<>'') and (cxs.Checked) then
   begin
    relation:=' like ''';
    cx:='%';
  if  commandstring=commandtring1 then
  begin
commandstring:=commandstring+' where (dbo.cllrb.xs'+relation+cx+trim(qxs.Text)+cx+''')';
end
else
begin
commandstring:=commandstring+' and (dbo.cllrb.xs'+relation+cx+trim(qxs.Text)+cx+''')';
end;
end
else
begin
qxs.Text:='';
end;
if (trim(qcz.Text)<>'') and (ccz.Checked) then
   begin
    relation:=' like ''';
    cx:='%';
  if  commandstring=commandtring1 then
  begin
commandstring:=commandstring+' where (dbo.cllrb.cz'+relation+cx+trim(qcz.Text)+cx+''')';

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -