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

📄 depotset.~pas

📁 企业商品管理系统
💻 ~PAS
字号:
unit DepotSet;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ImgList, ComCtrls, ToolWin, Grids, DBGrids, DB, ADODB,Theme;

type
  TFrm_DepotSet = class(TBaseForm)
    CoolBar1: TCoolBar;
    ToolBar1: TToolBar;
    ToolButton1: TToolButton;
    ToolButton2: TToolButton;
    ToolButton6: TToolButton;
    ToolButton3: TToolButton;
    ToolButton4: TToolButton;
    ToolButton5: TToolButton;
    ImageList1: TImageList;
    StatusBar1: TStatusBar;
    DBGrid1: TDBGrid;
    ADODepot: TADODataSet;
    DSDepot: TDataSource;
    procedure FormShow(Sender: TObject);
    procedure ToolButton1Click(Sender: TObject);
    procedure ToolButton2Click(Sender: TObject);
    procedure ToolButton3Click(Sender: TObject);
    procedure ToolButton4Click(Sender: TObject);
    procedure ToolButton5Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Frm_DepotSet: TFrm_DepotSet;

implementation
uses Main,DM;
{$R *.dfm}

procedure TFrm_DepotSet.FormShow(Sender: TObject);
begin
  ADODepot.Close;
  ADODepot.Open;
end;

procedure TFrm_DepotSet.ToolButton1Click(Sender: TObject);
begin
  ADODepot.Append;
end;

procedure TFrm_DepotSet.ToolButton2Click(Sender: TObject);
begin
  if ADODepot.RecordCount=0 then
    Exit;
  if Application.MessageBox('您是否要删除此记录!', '明日科技', MB_OKCANCEL) = IDOK then
  begin
    ADODepot.Delete;
    ADODepot.UpdateBatch;
  end;

end;

procedure TFrm_DepotSet.ToolButton3Click(Sender: TObject);
begin
  if ADODepot.FieldByName('MR_Code').AsString='' then
  begin
    Application.MessageBox('仓库编号不能为空!','明日科技');
    Exit;
  end;
  if ADODepot.FieldByName('MR_Name').AsString='' then
  begin
    Application.MessageBox('仓库名称不能为空!','明日科技');
    Exit;
  end;
  if ADODepot.FieldByName('MR_TelID').AsString='' then
  begin
    Application.MessageBox('仓库电话不能为空!','明日科技');
    Exit;
  end;
  if ADODepot.FieldByName('MR_Addr').AsString='' then
  begin
    Application.MessageBox('仓库地址不能为空!','明日科技');
    Exit;
  end;
  ADODepot.UpdateBatch;
end;

procedure TFrm_DepotSet.ToolButton4Click(Sender: TObject);
begin
  ADODepot.CancelBatch;
end;

procedure TFrm_DepotSet.ToolButton5Click(Sender: TObject);
begin
  Close;
end;

end.

⌨️ 快捷键说明

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