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

📄 bas200_16.pas.svn-base

📁 这是一个功能齐全的,代码完整的ERP企业信息管理系统,现在上传和大家分享
💻 SVN-BASE
字号:
unit Bas200_16;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Bas100_01, Menus, ExtCtrls, StdCtrls, Buttons, DB, ADODB;

type
  TBas200_16Form = class(TBas100_01Form)
    Bevel1: TBevel;
    bbtnOk: TBitBtn;
    bbtnExit: TBitBtn;
    ADOQuery1: TADOQuery;
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure ADOQuery1AfterScroll(DataSet: TDataSet);
    procedure bbtnOkClick(Sender: TObject);
    procedure bbtnExitClick(Sender: TObject);
  private
    procedure SaveData;
    { Private declarations }
  public
    { Public declarations }
  protected
    AMode,AOldCode:String;
    procedure SetInterface; virtual;
    procedure GetDataInfo; virtual;
    procedure SetEmptyInit; virtual;
    procedure InsertInit; virtual;
    procedure TableBeforePost; virtual;
    procedure TableAfterPost; virtual;
  end;

var
  Bas200_16Form: TBas200_16Form;

implementation

uses SYSDATA, CommFun;

{$R *.dfm}

//设置界面信息
procedure TBas200_16Form.SetInterface;
begin
  bbtnOk.Caption:=GetDBString('COM00008009');  //确定(&O)
  bbtnExit.Caption:=GetDBString('COM00008010');  //退出(&X)
end;

procedure TBas200_16Form.FormCreate(Sender: TObject);
begin
  inherited;
  SetInterface;
end;

procedure TBas200_16Form.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  inherited;
  ADOQuery1.Close;
end;

procedure TBas200_16Form.ADOQuery1AfterScroll(DataSet: TDataSet);
begin
  inherited;
  AOldCode:='';
  if ADOQuery1.State in [dsInsert,dsEdit] then Exit;
  if ADOQuery1.IsEmpty then
  begin
    SetEmptyInit;  //初始化
    Exit;
  end;
  if AMode='ADD' then
  begin
    InsertInit;
    Exit;
  end;
  GetDataInfo;  //取得界面信息
end;

procedure TBas200_16Form.bbtnOkClick(Sender: TObject);
begin
  inherited;
//保存
  try
    Screen.Cursor:=crHourGlass;
    SaveData;
  finally
    Screen.Cursor:=crDefault;
  end;
end;

procedure TBas200_16Form.bbtnExitClick(Sender: TObject);
begin
  inherited;
//取消
  Close;
end;

procedure TBas200_16Form.SaveData;
var
  ABookmark:TBookmark;
begin
  TableBeforePost;
  try
    ADOQuery1.Post;
    TableAfterPost;
    ADOQuery1.DisableControls;
    ABookmark:=ADOQuery1.GetBookmark;
    ADOQuery1.Close;
    ADOQuery1.Open;
    ADOQuery1.GotoBookmark(ABookmark);
    ADOQuery1.FreeBookmark(ABookmark);
    ADOQuery1.EnableControls;
    if AMode='ADD' then
    begin
      if ShowDialog('UMS10000309')=IDNO then  //记录保存成功,是否继续增加新记录?
        ModalResult:=1
      else
        InsertInit;
    end else
      ModalResult:=1;
  except
    if SYSDM.ADOC.Errors.Count<>0 then ShowMsg(SYSDM.ADOC.Errors[0].Description,1);
    Abort;
  end;
end;

procedure TBas200_16Form.GetDataInfo;
begin
end;

procedure TBas200_16Form.SetEmptyInit;
begin
end;

procedure TBas200_16Form.TableBeforePost;
begin
end;

procedure TBas200_16Form.InsertInit;
begin
end;

procedure TBas200_16Form.TableAfterPost;
begin
end;

end.

⌨️ 快捷键说明

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