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

📄 gcsxxgl.pas

📁 《仓库管理系统》 开发语言:Delphi7.0 数据库:SQLServer2000 数据库文件:仓库管理系统_Data.MDF,仓库管理系统_Log.LDF(mingrisoft仓库管理系统Da
💻 PAS
📖 第 1 页 / 共 2 页
字号:
    Edit4.Text :=  data.ADOQuery2.FieldByName('地址').Value;
    Edit5.Text :=  data.ADOQuery2.FieldByName('所属地区').Value;
    Edit10.Text :=  data.ADOQuery2.FieldByName('邮政编码').Value;
    MaskEdit1.Text :=  data.ADOQuery2.FieldByName('电话').Value;
    Edit11.Text :=  data.ADOQuery2.FieldByName('传真').Value;
    Edit12.Text :=  data.ADOQuery2.FieldByName('联系人').Value;
    Edit7.Text :=  data.ADOQuery2.FieldByName('联系人电话').Value;
    Edit8.Text :=  data.ADOQuery2.FieldByName('开户银行').Value;
    Edit9.Text :=  data.ADOQuery2.FieldByName('纳税人').Value;
    Edit13.Text :=  data.ADOQuery2.FieldByName('邮箱网址').Value;
    Edit14.Text :=  data.ADOQuery2.FieldByName('银行账号').Value;
  end
  else
  begin
    Edit1.Clear;
    Edit2.Clear;
    Edit3.Clear;
    Edit4.Clear;
    Edit5.Clear;
    Edit7.Clear;
    Edit8.Clear;
    Edit9.Clear;
    Edit10.Clear;
    Edit11.Clear;
    Edit12.Clear;
    Edit13.Clear;
    Edit14.Clear;
    MaskEdit1.Clear; 
  end;
end;

procedure TForm8.BitBtn1Click(Sender: TObject);
begin
  if Not data.ADOQuery2.Bof  then
  begin
    data.ADOQuery2.Prior;
    EditValue;
  end
  else
    BitBtn1.Enabled := False;
    BitBtn2.Enabled := True;
    BitBtn5.Enabled := True;
    BitBtn6.Enabled := True;
end;

procedure TForm8.BitBtn2Click(Sender: TObject);
begin
  if Not data.ADOQuery2.Eof then
  begin
    data.ADOQuery2.Next;
    EditValue;
  end
  else
    BitBtn2.Enabled := False;
  BitBtn1.Enabled := True;
  BitBtn5.Enabled := True;
  BitBtn6.Enabled := True;
end;

procedure TForm8.BitBtn6Click(Sender: TObject);
begin
  BitBtn4.Enabled := False;
  if data.ADOQuery2.FieldByName('供应商编号').Value = null then
  begin
    BitBtn6.Enabled := False;
    Exit;
  end;
  try
  If Application.MessageBox('确实要删除该条记录吗?','提示',MB_YESNO )= ID_Yes then
  begin
    with data.ADOQuery1 do
    begin
      Close;
      SQL.Clear;
      SQL.Add('delete 供应商基础信息表 where 供应商编号= :a');
      Parameters.ParamByName('a').Value := Trim(Edit1.Text);
      ExecSQL
    end;
    Application.MessageBox('该条记录已经删除。','提示',0+64);
    ShowDate;
  end ;
  Except
  Application.MessageBox('系统出错。','提示',0+64);
  Close
  end;
end;

procedure TForm8.BitBtn5Click(Sender: TObject);
begin
  if data.ADOQuery2.FieldByName('供应商编号').Value = null then
  begin
    BitBtn5.Enabled := False;
    BitBtn1.Enabled := False;
    BitBtn2.Enabled := False;
    Exit;
  end;
  Try
  if Application.MessageBox('确实要修改该条记录吗?','提示',MB_YESNO )= ID_Yes then
  begin
    if IsNullEdit = False then
    begin
      with data.ADOQuery2 do
      begin
        Edit;
        FieldByName('供应商编号').Value := Edit1.Text ;
        FieldByName('供应商全称').Value := Edit2.Text ;
        FieldByName('简称').Value := Edit3.Text ;
        FieldByName('地址').Value := Edit4.Text ;
        FieldByName('所属地区').Value := Edit5.Text ;
        FieldByName('邮政编码').Value := Edit10.Text ;
        FieldByName('电话').Value := MaskEdit1.Text ;
        FieldByName('传真').Value := Edit11.Text ;
        FieldByName('联系人').Value := Edit12.Text ;
        FieldByName('联系人电话').Value := Edit7.Text ;
        FieldByName('开户银行').Value := Edit8.Text ;
        FieldByName('纳税人').Value := Edit9.Text ;
        FieldByName('邮箱网址').Value := Edit13.Text ;
        FieldByName('银行账号').Value := Edit14.Text ;
        Post;
      end;
      Application.MessageBox('修改成功','提示',0+64);
      ShowDate;
    end
    else
    begin
      Application.MessageBox('数据项不能为空.','提示',64);
      Exit;
    end;    
  end
  else
    EditValue;
  Except
  Application.MessageBox('系统出错','提示',0+64);
  Close;
  end;
end;

procedure TForm8.Edit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = vk_return then
    Edit2.SetFocus;
end;

procedure TForm8.Edit2KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = vk_return then
    Edit3.SetFocus;
  if key = vk_up then
    Edit1.SetFocus;
end;

procedure TForm8.Edit3KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = vk_return then
    Edit4.SetFocus;
  if key = vk_up then
    Edit2.SetFocus;
end;

procedure TForm8.Edit4KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = vk_return then
    Edit5.SetFocus;
  if key = vk_up then
    Edit3.SetFocus;
end;

procedure TForm8.Edit5KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = vk_return then
    Edit10.SetFocus;
  if key = vk_up then
    Edit4.SetFocus;
end;

procedure TForm8.Edit10KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = vk_return then
    MaskEdit1.SetFocus;
  if key = vk_up then
    Edit5.SetFocus;
end;

procedure TForm8.MaskEdit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
 if key = vk_return then
    Edit11.SetFocus;
  if key = vk_up then
    Edit10.SetFocus;
end;

procedure TForm8.Edit11KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = vk_return then
    Edit12.SetFocus;
  if key = vk_up then
    MaskEdit1.SetFocus;
end;

procedure TForm8.Edit12KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = vk_return then
    Edit7.SetFocus;
  if key = vk_up then
    Edit11.SetFocus;
end;

procedure TForm8.Edit7KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = vk_return then
    Edit8.SetFocus;
  if key = vk_up then
    Edit12.SetFocus;
end;

procedure TForm8.Edit8KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = vk_return then
    Edit14.SetFocus;
  if key = vk_up then
    Edit7.SetFocus;
end;

procedure TForm8.Edit14KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
 if key = vk_return then
    Edit9.SetFocus;
  if key = vk_up then
    Edit8.SetFocus;
end;

procedure TForm8.Edit9KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = vk_return then
    Edit13.SetFocus;
  if key = vk_up then
    Edit14.SetFocus;
end;

procedure TForm8.Edit13KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = vk_up then
    Edit9.SetFocus;
end;

procedure TForm8.ShowDate;
begin
  with data.ADOQuery2 do
  begin
    Close;
    SQL.Clear;
    SQL.Add('select * from 供应商基础信息表');
    Open;
  end;
  EditValue;
end;

function TForm8.IsNullEdit: Boolean;
var
  Count: Integer;
begin
  IsNullEdit := False;
  For Count := 0 to Panel3.ControlCount-1 do
    if Panel3.Controls[Count]is TEdit then
      if Trim(TEdit(Panel3.Controls[Count]).Text)='' then
      begin
        IsNullEdit := True;
        Break;
      end;
end;

end.

⌨️ 快捷键说明

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