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

📄 supplier_caizepeng042_04.pas

📁 这个是我的数据库的课程设计:超市商品数据管理系统的设计,,采用面向C/S模式的通用开发工具Delphi设计其前台的操作
💻 PAS
📖 第 1 页 / 共 2 页
字号:

begin
if edit24.text<>'' then
begin
Adoquery2.Close;
Adoquery2.SQL.Clear;
Adoquery2.sql.Add('update  product_caizepeng042_04 set 商品名称='''+edit24.text+''' where 商品编号='''+edit29.text+'''');
adoquery2.execsql;
end;
if edit25.text<>'' then
begin
Adoquery2.Close;
Adoquery2.SQL.Clear;
Adoquery2.sql.Add('update  product_caizepeng042_04 set 计量单位='''+edit25.text+''' where 商品编号='''+edit29.text+'''');
adoquery2.execsql;
end;
if edit26.text<>'' then
begin
Adoquery2.Close;
Adoquery2.SQL.Clear;
Adoquery2.sql.Add('update  product_caizepeng042_04 set 进货价格=convert(money,'''+edit26.text+''') where 商品编号='''+edit29.text+'''');
adoquery2.execsql;
end;
if edit27.text<>'' then
begin
Adoquery2.Close;
Adoquery2.SQL.Clear;
Adoquery2.sql.Add('update  product_caizepeng042_04 set 规格型号='''+edit27.text+''' where 商品编号='''+edit29.text+'''');
adoquery2.execsql;
end;
if edit28.text<>'' then
begin
Adoquery2.Close;
Adoquery2.SQL.Clear;
Adoquery2.sql.Add('update  product_caizepeng042_04 set 销售价格=convert(money,'''+edit28.text+''') where 商品编号='''+edit29.text+'''');
adoquery2.execsql;
end;

end
else
begin
showmessage('该商品不存在');
end;
end;


Adoquery2.Close;
Adoquery2.SQL.Clear;
Adoquery2.SQL.Add('select * from product_caizepeng042_04');
Adoquery2.Open;
end;

procedure TForm3.Button10Click(Sender: TObject);
begin
if edit30.text='' then
messagebox(form3.Handle,'该项不能为空','警告',mb_ok+mb_iconwarning)
else
begin
Adoquery2.Close;
adoquery2.SQL.clear;
Adoquery2.SQL.Text:='select 商品编号 from product_caizepeng042_04 where 商品编号='''+edit30.text+'''';
adoquery2.Open;
if adoquery2.FieldByName('商品编号').AsString<>'' then
begin
Adoquery2.Close;
Adoquery2.SQL.Clear;
Adoquery2.SQL.Add('delete from  product_caizepeng042_04 where 商品编号='''+edit30.text+'''');
Adoquery2.ExecSQL;
end
else
begin
messagebox(form3.Handle,'该商品不存在','警告',mb_ok+mb_iconwarning);
end;
end;
adoquery2.Close;
adoquery2.SQL.clear;
adoquery2.SQL.Add('select * from product_caizepeng042_04');
adoquery2.open;
end;

procedure TForm3.Button11Click(Sender: TObject);
var bianliang:string;
begin
bianliang:='select * from employee_caizepeng042_04 where(100=100)';
if edit31.text<>'' then
bianliang:=bianliang+'and(员工编号='''+edit31.Text+''')';
if edit32.text<>'' then
bianliang:=bianliang+'and(员工姓名='''+edit32.Text+''')';
if edit33.text<>'' then
bianliang:=bianliang+'and(联系电话='''+edit3.Text+''')';
if edit34.text<>'' then
bianliang:=bianliang+'and(入司日期=convert(datetime,'''+edit34.Text+'''))';

adoquery3.close;
adoquery3.SQL.clear;
adoquery3.SQL.Add(bianliang);
adoquery3.Open;

if ADOQuery3.recordcount=0 then
messagebox(form3.Handle,'没有符合你所要找的员工,请重新查找','查询警告',mb_ok+mb_iconwarning);
adoquery3.Active:=true;
end;

procedure TForm3.Button12Click(Sender: TObject);
begin
Adoquery3.Close;
Adoquery3.SQL.clear;
Adoquery3.SQL.Add('select * from employee_caizepeng042_04');
Adoquery3.ExecSQL;
Adoquery3.Active:=true;
end;

procedure TForm3.Button13Click(Sender: TObject);
begin
if edit39.text='' then
messagebox(form3.Handle,'要修改的员工编号不能为空','警告',mb_ok+mb_iconwarning)
else
if edit39.Text<>edit35.text then
messagebox(form3.Handle,'要修改的员工编号不能进行修改','警告',mb_ok+mb_iconwarning)
else
begin
Adoquery3.Close;
adoquery3.SQL.clear;
Adoquery3.SQL.Text:='select 员工编号 from employee_caizepeng042_04 where 员工编号='''+edit39.text+'''';
adoquery3.Open;
if adoquery3.FieldByName('员工编号').AsString<>'' then

begin
if edit36.text<>'' then
begin
Adoquery3.Close;
Adoquery3.SQL.Clear;
Adoquery3.sql.Add('update  employee_caizepeng042_04 set 员工姓名='''+edit36.text+''' where 员工编号='''+edit39.text+'''');
adoquery3.execsql;
end;
if edit37.text<>'' then
begin
Adoquery3.Close;
Adoquery3.SQL.Clear;
Adoquery3.sql.Add('update  employee_caizepeng042_04 set 联系电话='''+edit37.text+''' where 员工编号='''+edit39.text+'''');
adoquery3.execsql;
end;
if edit38.text<>'' then
begin
Adoquery3.Close;
Adoquery3.SQL.Clear;
Adoquery3.sql.Add('update  employee_caizepeng042_04 set 入司日期=convert(datetime,'''+edit38.text+''') where 员工编号='''+edit39.text+'''');
adoquery3.execsql;
end;

end
else
begin
showmessage('提示:该员工不存在');
end;
end;
Adoquery3.Close;
Adoquery3.SQL.Clear;
Adoquery3.SQL.Add('select * from employee_caizepeng042_04');
Adoquery3.Open;
end;

procedure TForm3.Button15Click(Sender: TObject);
begin
if edit35.text='' then
messagebox(form3.Handle,'员工编号不能为空','警告',mb_ok+mb_iconwarning)
else
begin
Adoquery3.Close;
adoquery3.SQL.clear;
Adoquery3.SQL.Text:='select 员工编号 from employee_caizepeng042_04 where 员工编号='''+edit35.text+'''';
adoquery3.Open;
if adoquery3.FieldByName('员工编号').AsString='' then
begin
Adoquery3.Close;
Adoquery3.SQL.Clear;
Adoquery3.SQL.Add('insert into employee_caizepeng042_04 values('''+edit35.Text+''','''+edit36.text+''','''+edit37.text+''',convert(datetime,'''+edit38.text+'''))');
adoquery3.execsql;
end
else
begin
showmessage('该员工已经存在,请确定');
end;
Adoquery3.Close;
Adoquery3.SQL.Clear;
Adoquery3.SQL.Add('select * from employee_caizepeng042_04');
Adoquery3.Open;
end;
end;

procedure TForm3.Button16Click(Sender: TObject);
var bianliang:string;
begin
bianliang:='select * from huoqu_caizepeng042_04 where(100=100)';
if edit41.text<>'' then
bianliang:=bianliang+'and(货区号='''+edit41.Text+''')';
if edit42.text<>'' then
bianliang:=bianliang+'and(货区描述='''+edit42.Text+''')';
if edit43.text<>'' then
bianliang:=bianliang+'and(员工编号='''+edit43.Text+''')';

adoquery4.close;
adoquery4.SQL.clear;
adoquery4.SQL.Add(bianliang);
adoquery4.Open;

if ADOQuery4.recordcount=0 then
messagebox(form3.Handle,'没有符合你所要找的货区,请重新查询','查询警告',mb_ok+mb_iconwarning);
adoquery4.Active:=true;
end;

procedure TForm3.Button17Click(Sender: TObject);
begin
Adoquery4.Close;
Adoquery4.SQL.clear;
Adoquery4.SQL.Add('select * from huoqu_caizepeng042_04');
Adoquery4.ExecSQL;
Adoquery4.Active:=true;
end;

procedure TForm3.Button18Click(Sender: TObject);
begin
if edit47.text='' then
messagebox(form3.Handle,'要修改的货区号好不能为空','警告',mb_ok+mb_iconwarning)
else
if edit47.Text<>edit44.text then
messagebox(form3.Handle,'要修改的货区号不能进行修改','警告',mb_ok+mb_iconwarning)
else
begin
Adoquery4.Close;
adoquery4.SQL.clear;
Adoquery4.SQL.Text:='select 货区号 from huoqu_caizepeng042_04 where 货区号='''+edit47.text+'''';
adoquery4.Open;
if adoquery4.FieldByName('货区号').AsString<>'' then

begin
if edit46.text<>'' then
begin
Adoquery4.Close;
Adoquery4.SQL.Clear;
Adoquery4.sql.Add('update  huoqu_caizepeng042_04 set 货区描述='''+edit45.text+''' where 货区号='''+edit47.text+'''');
adoquery4.execsql;
end;
if edit46.text<>'' then
begin
Adoquery4.Close;
Adoquery4.SQL.Clear;
Adoquery4.sql.Add('update huoqu_caizepeng042_04 set 员工编号='''+edit46.text+''' where 货区号='''+edit47.text+'''');
adoquery4.execsql;
end;

end
else
begin
showmessage('该商品不存在');
end;
end;


Adoquery4.Close;
Adoquery4.SQL.Clear;
Adoquery4.SQL.Add('select * from huoqu_caizepeng042_04');
Adoquery4.Open;
end;

procedure TForm3.Button20Click(Sender: TObject);
begin
if edit44.text='' then
messagebox(form3.Handle,'货区号不能为空','警告',mb_ok+mb_iconwarning)
else
begin
Adoquery4.Close;
adoquery4.SQL.clear;
Adoquery4.SQL.Text:='select 货区号 from huoqu_caizepeng042_04 where 货区号='''+edit44.text+'''';
adoquery4.Open;
if adoquery4.FieldByName('货区号').AsString='' then
begin
Adoquery4.Close;
Adoquery4.SQL.Clear;
Adoquery4.SQL.Add('insert into huoqu_caizepeng042_04 values('''+edit44.Text+''','''+edit45.text+''','''+edit46.text+''')');
adoquery4.execsql;
end
else
begin
messagebox(form3.Handle,'该货区已经存在','警告',mb_ok+mb_iconwarning)
end;

Adoquery4.Close;
Adoquery4.SQL.Clear;
Adoquery4.SQL.Add('select * from huoqu_caizepeng042_04');
Adoquery4.Open;
end;
end;

procedure TForm3.Button21Click(Sender: TObject);
var bianliang:string;
begin
bianliang:='select * from huojia_caizepeng042_04 where(100=100)';
if edit49.text<>'' then
bianliang:=bianliang+'and(货架号='''+edit49.Text+''')';
if edit50.text<>'' then
bianliang:=bianliang+'and(货架描述='''+edit50.Text+''')';
if edit51.text<>'' then
bianliang:=bianliang+'and(容量=convert(int,'''+edit51.Text+'''))';
if edit52.text<>'' then
bianliang:=bianliang+'and(货区号='''+edit52.Text+''')';

adoquery5.close;
adoquery5.SQL.clear;
adoquery5.SQL.Add(bianliang);
adoquery5.Open;

if ADOQuery5.recordcount=0 then
messagebox(form3.Handle,'没有符合你所要找的货架,请重新查找','查询警告',mb_ok+mb_iconwarning);
adoquery5.Active:=true;
end;

procedure TForm3.Button22Click(Sender: TObject);
begin
Adoquery5.Close;
Adoquery5.SQL.clear;
Adoquery5.SQL.Add('select * from huojia_caizepeng042_04');
Adoquery5.ExecSQL;
Adoquery5.Active:=true;
end;

procedure TForm3.Button23Click(Sender: TObject);
begin
if edit57.text='' then
messagebox(form3.Handle,'要修改的货架号不能为空','警告',mb_ok+mb_iconwarning)
else
if edit57.Text<>edit53.text then
messagebox(form3.Handle,'要修改的货架号不能进行修改','警告',mb_ok+mb_iconwarning)
else
begin
Adoquery5.Close;
adoquery5.SQL.clear;
Adoquery5.SQL.Text:='select 货架号 from huojia_caizepeng042_04 where 货架号='''+edit57.text+'''';
adoquery5.Open;
if adoquery5.FieldByName('货架号').AsString<>'' then

begin
if edit54.text<>'' then
begin
Adoquery5.Close;
Adoquery5.SQL.Clear;
Adoquery5.sql.Add('update  huojia_caizepeng042_04 set 货架描述='''+edit54.text+''' where 货架号='''+edit57.text+'''');
adoquery5.execsql;
end;
if edit55.text<>'' then
begin
Adoquery5.Close;
Adoquery5.SQL.Clear;
Adoquery5.sql.Add('update  huojia_caizepeng042_04 set 容量=convert(int,'''+edit55.text+''') where 货架号='''+edit57.text+'''');
adoquery5.execsql;
end;
if edit56.text<>'' then
begin
Adoquery5.Close;
Adoquery5.SQL.Clear;
Adoquery5.sql.Add('update  huojia_caizepeng042_04 set 货区号='''+edit56.text+''' where 货架号='''+edit57.text+'''');
adoquery5.execsql;
end;

end
else
begin
showmessage('提示:该员工不存在');
end;
end;
Adoquery5.Close;
Adoquery5.SQL.Clear;
Adoquery5.SQL.Add('select * from huojia_caizepeng042_04');
Adoquery5.Open;
end;

procedure TForm3.Button25Click(Sender: TObject);
begin
if edit53.text='' then
messagebox(form3.Handle,'货架号不能为空','警告',mb_ok+mb_iconwarning)
else
begin
Adoquery5.Close;
adoquery5.SQL.clear;
Adoquery5.SQL.Text:='select 货架号 from huojia_caizepeng042_04 where 货架号='''+edit53.text+'''';
adoquery5.Open;
if adoquery5.FieldByName('货架号').AsString='' then
begin
Adoquery5.Close;
Adoquery5.SQL.Clear;
Adoquery5.SQL.Add('insert into huojia_caizepeng042_04 values('''+edit53.Text+''','''+edit54.text+''',convert(int,'''+edit55.text+'''),'''+edit56.text+''')');
adoquery5.execsql;
end
else
begin
showmessage('该货架已经存在,请确定');
end;
Adoquery5.Close;
Adoquery5.SQL.Clear;
Adoquery5.SQL.Add('select * from huojia_caizepeng042_04');
Adoquery5.Open;
end;
end;

procedure TForm3.Button19Click(Sender: TObject);
begin
if edit48.text='' then
messagebox(form3.Handle,'该项不能为空','警告',mb_ok+mb_iconwarning)
else
begin
Adoquery4.Close;
adoquery4.SQL.clear;
Adoquery4.SQL.Text:='select 货区号 from huoqu_caizepeng042_04 where 货区号='''+edit48.text+'''';
adoquery4.Open;
if adoquery4.FieldByName('货区号').AsString<>'' then
begin
Adoquery4.Close;
Adoquery4.SQL.Clear;
Adoquery4.SQL.Add('delete from huoqu_caizepeng042_04 where 货区号='''+edit48.text+'''');
Adoquery4.ExecSQL;
end
else
begin
messagebox(form3.Handle,'该货区不存在','警告',mb_ok+mb_iconwarning);
end;
end;
adoquery4.Close;
adoquery4.SQL.clear;
adoquery4.SQL.Add('select * from huoqu_caizepeng042_04');
adoquery4.open;
end;

procedure TForm3.Button24Click(Sender: TObject);
begin
if edit58.text='' then
messagebox(form3.Handle,'该项不能为空','警告',mb_ok+mb_iconwarning)
else
begin
Adoquery5.Close;
adoquery5.SQL.clear;
Adoquery5.SQL.Text:='select 货架号 from huojia_caizepeng042_04 where 货架号='''+edit58.text+'''';
adoquery5.Open;
if adoquery5.FieldByName('货架号').AsString<>'' then
begin
Adoquery5.Close;
Adoquery5.SQL.Clear;
Adoquery5.SQL.Add('delete from huojia_caizepeng042_04 where 货架号='''+edit58.text+'''');
Adoquery5.ExecSQL;
end
else
begin
messagebox(form3.Handle,'该货架不存在','警告',mb_ok+mb_iconwarning);
end;
end;
adoquery5.Close;
adoquery5.SQL.clear;
adoquery5.SQL.Add('select * from huojia_caizepeng042_04');
adoquery5.open;
end;

procedure TForm3.Button14Click(Sender: TObject);
begin
if edit40.text='' then
messagebox(form3.Handle,'该项不能为空','警告',mb_ok+mb_iconwarning)
else
begin
Adoquery3.Close;
adoquery3.SQL.clear;
Adoquery3.SQL.Text:='select 员工编号 from employee_caizepeng042_04 where 员工编号='''+edit40.text+'''';
adoquery3.Open;
if adoquery5.FieldByName('员工编号').AsString<>'' then
begin
Adoquery3.Close;
Adoquery3.SQL.Clear;
Adoquery3.SQL.Add('delete from employee_caizepeng042_04 where 货架号='''+edit40.text+'''');
Adoquery3.ExecSQL;
end
else
begin
messagebox(form3.Handle,'该员工不存在','警告',mb_ok+mb_iconwarning);
end;
end;
adoquery3.Close;
adoquery3.SQL.clear;
adoquery3.SQL.Add('select * from employee_caizepeng042_04');
adoquery3.open;
end;

end.

⌨️ 快捷键说明

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