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

📄 xxwh.pas

📁 库房管理程序,希望能给大家一点启发.这个小程序现在已经用在我们这里的工段,反应良好.
💻 PAS
📖 第 1 页 / 共 2 页
字号:

begin
if edit14.Text='' then
     begin
        application.MessageBox('未输入设备名称','设备名称输入',mb_ok);

     end
  else
    begin
     if edit16.Text='' then
       begin
         application.MessageBox('未输入设备代码','设备代码输入',mb_ok);
       end
     else
    //zhongleizj.zhonglei.Active:=true;
        begin
          t:=edit16.Text;
      t:=rightstr(t,1);
           //showmessage(t);
             xxwh.Form8.ADOQuery3.Close;
             xxwh.Form8.adoquery3.Active:=false;
             xxwh.Form8.adoquery3.Connection:=xxwh.Form8.ADOConnection3;
             xxwh.Form8.adoquery3.SQL.Clear;
             xxwh.Form8.adoquery3.SQL.Add('select * from 工段设备归类');
             //adoquery1.SQL.Add('where 职务='''+Form_khlr.ComboBox1.Text+'''');
             xxwh.Form8.adoquery3.Active:=true;
             xxwh.Form8.adoquery3.Open;
             xxwh.Form8.adoquery3.Insert;
             //adoquery1.Fields[0].AsString:=datetostr(Form_khlr.datetimepicker1.Date );
             xxwh.Form8.adoquery3.Fields[1].AsString:=edit14.Text;
              if t='-'    then

       begin
       //if LeftbStr(t,length(t)-4);
       //showmessage('you');
        xxwh.Form8.adoquery3.Fields[2].AsString:=edit16.Text;
       // rkcx.Form4.Edit8.Text:=adoquery1.Fields[1].AsString;
      // rkcx.Form4.Edit9.Text:=adoquery1.Fields[2].AsString;
       // rkcx.Form4.Edit10.Text:=adoquery1.Fields[3].AsString;
       //sblx.Form9.close;

            end
        else
        begin
        //showmessage('mei');
             xxwh.Form8.adoquery3.Fields[2].AsString:=edit16.Text+'--';

        end;

             

             xxwh.Form8.adoquery3.Fields[3].AsString:=edit15.Text;
               xxwh.Form8.adoquery3.Fields[4].AsString:=denglu.gdlx;
             application.MessageBox('输入成功','设备种类录入',mb_ok);
             xxwh.Form8.adoquery3.Post;
             edit14.Text:='';
             edit16.Text:='';
      end
    end;
end;

procedure TForm8.Button13Click(Sender: TObject);
begin
xxwh.Form8.Close;
end;

procedure TForm8.Button6Click(Sender: TObject);
begin
xxwh.Form8.Close;
end;

procedure TForm8.Button4Click(Sender: TObject);
begin
xxwh.Form8.Close;
end;

procedure TForm8.Button2Click(Sender: TObject);
begin
xxwh.Form8.Close;
end;

procedure TForm8.Button8Click(Sender: TObject);
begin
xxwh.Form8.Close;
end;

procedure TForm8.Button10Click(Sender: TObject);
begin
xxwh.Form8.Close;
end;

procedure TForm8.Button17Click(Sender: TObject);
begin
xxwh.Form8.Close;
end;

procedure TForm8.Button14Click(Sender: TObject);
begin
 if edit17.Text=''  then
      begin
        application.MessageBox('输入失败,请重新输入','库房名称录入',mb_ok);
        edit17.Text:='';
      end
      else
       if edit17.Text=edit18.Text  then
          begin
           xxwh.Form8.ADOQuery4.Close;
           xxwh.Form8.adoquery4.Active:=false;
           xxwh.Form8.adoquery4.Connection:=xxwh.Form8.ADOConnection4;
           xxwh.Form8.adoquery4.SQL.Clear;
           xxwh.Form8.adoquery4.SQL.Add('select * from 工段库房库名');
           //adoquery1.SQL.Add('where 职务='''+Form_khlr.ComboBox1.Text+'''');
           xxwh.Form8.adoquery4.Active:=true;
           xxwh.Form8.adoquery4.Open;
           xxwh.Form8.adoquery4.Insert;
           //adoquery1.Fields[0].AsString:=datetostr(Form_khlr.datetimepicker1.Date );
           xxwh.Form8.adoquery4.Fields[1].AsString:=edit17.Text;
             xxwh.Form8.adoquery4.Fields[2].AsString:=denglu.gdlx;

           application.MessageBox('输入成功','库房名称录入',mb_ok);
           xxwh.Form8.adoquery4.Post;
           edit17.Text:='';
           edit18.Text:='';

      end
    else
      begin
        application.MessageBox('两次内容输入不一样,请从新输入','库房名称输入',mb_ok);
        edit17.Text:='';
        edit18.Text:='';
    end;
end;

procedure TForm8.Button15Click(Sender: TObject);
begin
xxwh.Form8.Close;
end;

procedure TForm8.Button16Click(Sender: TObject);
begin
 if edit19.Text=''  then
      begin
        application.MessageBox('输入失败,请重新输入','库房位置录入',mb_ok);
        edit19.Text:='';
      end
      else
       if edit19.Text=edit20.Text  then
          begin
           xxwh.Form8.ADOQuery5.Close;
           xxwh.Form8.adoquery5.Active:=false;
           xxwh.Form8.adoquery5.Connection:=xxwh.Form8.ADOConnection5;
           xxwh.Form8.adoquery5.SQL.Clear;
           xxwh.Form8.adoquery5.SQL.Add('select * from 工段物资位置');
           //adoquery1.SQL.Add('where 职务='''+Form_khlr.ComboBox1.Text+'''');
           xxwh.Form8.adoquery5.Active:=true;
           xxwh.Form8.adoquery5.Open;
           xxwh.Form8.adoquery5.Insert;
           //adoquery1.Fields[0].AsString:=datetostr(Form_khlr.datetimepicker1.Date );
           xxwh.Form8.adoquery5.Fields[1].AsString:=edit19.Text;
             xxwh.Form8.adoquery5.Fields[2].AsString:=denglu.gdlx;

           application.MessageBox('输入成功','工段物资位置录入',mb_ok);
           xxwh.Form8.adoquery5.Post;
           edit19.Text:='';
           edit20.Text:='';

      end
    else
      begin
        application.MessageBox('两次内容输入不一样,请从新输入','工段库房位置输入',mb_ok);
        edit19.Text:='';
        edit20.Text:='';
    end;
end;

procedure TForm8.Button18Click(Sender: TObject);
begin
xxwh.Form8.Close;
end;

procedure TForm8.Button19Click(Sender: TObject);
begin
if combobox4.Text='' then
     begin
        application.MessageBox('输入失败,请重新输入','工段库房库名删除',mb_ok);
     end
  else
    begin
     if edit22.Text='' then
       begin
         application.MessageBox('输入失败,请重新输入','工段库房库名删除',mb_ok);
       end
     else
    //zhongleizj.zhonglei.Active:=true;
        begin
          xxwh.Form8.ADOQuery4.Open;
          xxwh.Form8.ADOQuery4.MoveBy(strtoint(edit21.Text));
          xxwh.Form8.ADOQuery4.Delete;

         //form1.ADOQuery1.UpdateRecord;
          Application.MessageBox('删除数据成功!','提示信息',MB_OK);
          edit21.Text:='';
          edit22.Text:='';
    end
    end;
end;

procedure TForm8.Button20Click(Sender: TObject);
begin
xxwh.Form8.Close;
end;

procedure TForm8.Button22Click(Sender: TObject);
begin
xxwh.Form8.Close;
end;

procedure TForm8.Button21Click(Sender: TObject);
begin
if combobox5.Text='' then
     begin
        application.MessageBox('输入失败,请重新输入','工段库房位置删除',mb_ok);
     end
  else
    begin
     if edit24.Text='' then
       begin
         application.MessageBox('输入失败,请重新输入','工段库房位置删除',mb_ok);
       end
     else
    //zhongleizj.zhonglei.Active:=true;
        begin
          xxwh.Form8.ADOQuery5.Open;
          xxwh.Form8.ADOQuery5.MoveBy(strtoint(edit23.Text));
          xxwh.Form8.ADOQuery5.Delete;

         //form1.ADOQuery1.UpdateRecord;
          Application.MessageBox('删除数据成功!','提示信息',MB_OK);
          edit23.Text:='';
          edit24.Text:='';
    end
    end;
end;

procedure TForm8.Edit3Change(Sender: TObject);
var
pw1:string;
begin
adoquery1.Close;
    adoquery1.Active:=false;
    adoquery1.Connection:=xxwh.Form8.ADOConnection1;
    adoquery1.SQL.Clear;
    adoquery1.SQL.Add('select * from 工段物资单位');
    adoquery1.SQL.Add('where 物资单位='''+edit3.Text+'''');
    adoquery1.Active:=true;
    adoquery1.Open;
    pw1:=adoquery1.FieldByName('id').AsString;
    edit4.Text:=pw1;
end;

procedure TForm8.Edit7Change(Sender: TObject);

var
pw1:string;
begin
adoquery2.Close;
    adoquery2.Active:=false;
    adoquery2.Connection:=xxwh.Form8.ADOConnection2;
    adoquery2.SQL.Clear;
    adoquery2.SQL.Add('select * from 工段领料名单');
    adoquery2.SQL.Add('where 人员姓名='''+edit7.Text+'''');
    adoquery2.Active:=true;
    adoquery2.Open;
    pw1:=adoquery2.FieldByName('id').AsString;
    edit8.Text:=pw1;
end;

procedure TForm8.Edit12Change(Sender: TObject);
var
pw1:string;
begin
adoquery3.Close;
    adoquery3.Active:=false;
    adoquery3.Connection:=xxwh.Form8.ADOConnection3;
    adoquery3.SQL.Clear;
    adoquery3.SQL.Add('select * from 工段发料名单');
    adoquery3.SQL.Add('where 人员名称='''+edit12.Text+'''');
    adoquery3.Active:=true;
    adoquery3.Open;
    pw1:=adoquery3.FieldByName('id').AsString;
    edit11.Text:=pw1;
end;

procedure TForm8.Edit22Change(Sender: TObject);
var
pw1:string;
begin
adoquery4.Close;
    adoquery4.Active:=false;
    adoquery4.Connection:=xxwh.Form8.ADOConnection4;
    adoquery4.SQL.Clear;
    adoquery4.SQL.Add('select * from 工段库房库名');
    adoquery4.SQL.Add('where 工段库房库名='''+edit22.Text+'''');
    adoquery4.Active:=true;
    adoquery4.Open;
    pw1:=adoquery4.FieldByName('id').AsString;
    edit21.Text:=pw1;
end;

procedure TForm8.Edit24Change(Sender: TObject);
var
pw1:string;
begin
adoquery5.Close;
    adoquery5.Active:=false;
    adoquery5.Connection:=xxwh.Form8.ADOConnection5;
    adoquery5.SQL.Clear;
    adoquery5.SQL.Add('select * from 工段物资位置');
    adoquery5.SQL.Add('where 工段物资位置='''+edit24.Text+'''');
    adoquery5.Active:=true;
    adoquery5.Open;
    pw1:=adoquery5.FieldByName('id').AsString;
    edit23.Text:=pw1;
end;

procedure TForm8.Label3Click(Sender: TObject);
begin
xxwh.Form8.ComboBox1.Clear;
        xxwh.Form8.adoquery1.Close;
        xxwh.Form8.adoquery1.Active:=false;
        xxwh.Form8.adoquery1.Connection:=xxwh.Form8.ADOConnection1;
        xxwh.Form8.adoquery1.SQL.Clear;
        xxwh.Form8.adoquery1.SQL.Add('select * from 工段物资单位');
        xxwh.Form8.adoquery1.Active:=true;
        xxwh.Form8.adoquery1.Open;
           while  not xxwh.Form8.adoquery1.Eof do
             begin
               xxwh.Form8.ComboBox1.Items.Add(xxwh.Form8.adoquery1.FieldByName('物资单位').AsString);
               xxwh.Form8.adoquery1.Next;
             end;
end;

procedure TForm8.Label7Click(Sender: TObject);
begin
xxwh.Form8.ADOQuery2.Close;
        xxwh.Form8.ComboBox2.Clear;
        xxwh.Form8.adoquery2.Close;
        xxwh.Form8.adoquery2.Active:=false;
        xxwh.Form8.adoquery2.Connection:=xxwh.Form8.ADOConnection2;
        xxwh.Form8.adoquery2.SQL.Clear;
        xxwh.Form8.adoquery2.SQL.Add('select * from 工段领料名单 where 工段名称='''+denglu.gdlx+'''');
        xxwh.Form8.adoquery2.Active:=true;
        xxwh.Form8.adoquery2.Open;
           while  not xxwh.Form8.adoquery2.Eof do
             begin
               xxwh.Form8.ComboBox2.Items.Add(xxwh.Form8.adoquery2.FieldByName('人员姓名').AsString);
               xxwh.Form8.adoquery2.Next;
             end;
        xxwh.Form8.adoquery2.Close;
end;

procedure TForm8.Label11Click(Sender: TObject);
begin
combobox3.Clear;
 xxwh.Form8.adoquery3.Close;
        xxwh.Form8.adoquery3.Active:=false;
        xxwh.Form8.adoquery3.Connection:=xxwh.Form8.ADOConnection3;
        xxwh.Form8.adoquery3.SQL.Clear;
        xxwh.Form8.adoquery3.SQL.Add('select * from 工段发料名单 where 工段名称='''+denglu.gdlx+'''');
        xxwh.Form8.adoquery3.Active:=true;
        xxwh.Form8.adoquery3.Open;
           while  not xxwh.Form8.adoquery3.Eof do
             begin
               xxwh.Form8.ComboBox3.Items.Add(xxwh.Form8.adoquery3.FieldByName('人员名单').AsString);
               xxwh.Form8.adoquery3.Next;
             end;
        xxwh.Form8.adoquery3.Close;
end;

procedure TForm8.Label21Click(Sender: TObject);
begin
combobox4.Clear;
 xxwh.Form8.adoquery4.Close;
        xxwh.Form8.adoquery4.Active:=false;
        xxwh.Form8.adoquery4.Connection:=xxwh.Form8.ADOConnection4;
        xxwh.Form8.adoquery4.SQL.Clear;
        xxwh.Form8.adoquery4.SQL.Add('select * from 工段库房库名 where 工段名称='''+denglu.gdlx+'''');
        xxwh.Form8.adoquery4.Active:=true;
        xxwh.Form8.adoquery4.Open;
           while  not xxwh.Form8.adoquery4.Eof do
             begin
               xxwh.Form8.ComboBox4.Items.Add(xxwh.Form8.adoquery4.FieldByName('工段库房库名').AsString);
              xxwh.Form8.adoquery4.Next;
             end;
        xxwh.Form8.adoquery4.Close;
end;

procedure TForm8.Label23Click(Sender: TObject);
begin
combobox5.Clear;
 xxwh.Form8.adoquery5.Close;
        xxwh.Form8.adoquery5.Active:=false;
        xxwh.Form8.adoquery5.Connection:=xxwh.Form8.ADOConnection5;
        xxwh.Form8.adoquery3.SQL.Clear;
        xxwh.Form8.adoquery5.SQL.Add('select * from 工段物资位置 where 工段名称='''+denglu.gdlx+'''');
        xxwh.Form8.adoquery5.Active:=true;
        xxwh.Form8.adoquery5.Open;
           while  not xxwh.Form8.adoquery5.Eof do
             begin
               xxwh.Form8.ComboBox5.Items.Add(xxwh.Form8.adoquery5.FieldByName('工段物资位置').AsString);
               xxwh.Form8.adoquery5.Next;
             end;
        xxwh.Form8.adoquery5.Close;
end;

end.

⌨️ 快捷键说明

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