📄 depotpos.~pas
字号:
unit DepotPos;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ImgList, ComCtrls, ToolWin, Grids, DBGrids, StdCtrls, DB, ADODB,
ExtCtrls, Mask, DBCtrls,Theme;
type
TFrm_DepotPos = class(TBaseForm)
CoolBar1: TCoolBar;
ToolBar1: TToolBar;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ToolButton6: TToolButton;
ToolButton3: TToolButton;
ToolButton4: TToolButton;
ToolButton5: TToolButton;
ImageList1: TImageList;
StatusBar1: TStatusBar;
ADODepotPos: TADODataSet;
DSDepotPos: TDataSource;
Panel1: TPanel;
GroupBox1: TGroupBox;
DBGrid1: TDBGrid;
DBGrid2: TDBGrid;
ADODepot: TADODataSet;
DSDepot: TDataSource;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
DBEdit1: TDBEdit;
DBEdit2: TDBEdit;
DBEdit3: TDBEdit;
DBEdit4: TDBEdit;
DBEdit5: TDBEdit;
ToolButton7: TToolButton;
ADODepotMR_ID: TAutoIncField;
ADODepotMR_Code: TIntegerField;
ADODepotMR_Name: TStringField;
ADODepotMR_TelID: TStringField;
ADODepotMR_Addr: TStringField;
procedure FormShow(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
procedure ToolButton7Click(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_DepotPos: TFrm_DepotPos;
implementation
uses main,DM;
{$R *.dfm}
procedure TFrm_DepotPos.FormShow(Sender: TObject);
begin
ADODepot.Close;
ADODepotPos.Close;
ADODepot.Open;
ADODepotPos.Open;
end;
procedure TFrm_DepotPos.ToolButton1Click(Sender: TObject);
begin
if ADODepot.RecordCount=0 then
begin
Application.MessageBox('请选择仓库!','明日科技');
Exit;
end;
ADODepotPos.Append;
ADODepotPos.FieldByName('MR_DepotCode').AsInteger:=ADODepot.FieldByName('MR_Code').AsInteger;
ADODepotPos.FieldByName('MR_DepotName').AsString:=ADODepot.FieldByName('MR_Name').AsString;
end;
procedure TFrm_DepotPos.ToolButton7Click(Sender: TObject);
begin
if ADODepotPos.RecordCount=0 then
Exit;
ADODepotPos.Edit;
end;
procedure TFrm_DepotPos.ToolButton2Click(Sender: TObject);
begin
if ADODepotPos.RecordCount=0 then
Exit;
if Application.MessageBox('您是否要删除此记录!', '明日科技', MB_OKCANCEL) = IDOK then
begin
ADODepotPos.Delete;
ADODepotPos.UpdateBatch;
end;
end;
procedure TFrm_DepotPos.ToolButton3Click(Sender: TObject);
begin
if DBEdit3.Text='' then
begin
Application.MessageBox('库位编号不能为空!','明日科技');
DBEdit3.SetFocus;
exit;
end;
if DBEdit4.Text='' then
begin
Application.MessageBox('库位名称不能为空!','明日科技');
DBEdit4.SetFocus;
Exit;
end;
ADODepotPos.UpdateBatch;
end;
procedure TFrm_DepotPos.ToolButton4Click(Sender: TObject);
begin
ADODepotPos.CancelBatch;
end;
procedure TFrm_DepotPos.ToolButton5Click(Sender: TObject);
begin
Close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -