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

📄 gl_enter_gain.pas

📁 一个MRPII系统源代码版本
💻 PAS
字号:
unit Gl_Enter_Gain;

Interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Base_Outer, Menus, ExtPrintReport, Db, ActnList, AdODB, Grids, DBGridEh,
  StdCtrls, ExtCtrls, ComCtrls, ToolWin, jpeg;

Type
  TFrm_Gl_Enter_Gain = Class(TFrm_Base_Outer)
    AdoQry_MainProjectCode: TStringField;
    AdoQry_MainISSum: TIntegerField;
    AdoQry_MainProjectName: TStringField;
    AdoQry_MainPLineNo: TIntegerField;
    AdoQry_MainMonthSum: TStringField;
    AdoQry_MainYearSum: TStringField;
    procedure FormDestroy(Sender: TObject);
    procedure Act_DeleteExecute(Sender: TObject);
  private
    { Private declarations }
  public
    procedure InitForm(AdOConnection:TAdOConnection;ReadOnly:Boolean);Override;
    function SetDeleteSql:String;Override;
    { Public declarations }
  end;

var
  Frm_Gl_Enter_Gain: TFrm_Gl_Enter_Gain;

implementation
uses Gl_Enter_Gain_D,Sys_Global;
{$R *.DFM}

{ TFrm_Ar_Enter_Gathering }

procedure TFrm_Gl_Enter_Gain.InitForm(AdOConnection: TAdOConnection;
  ReadOnly: Boolean);
begin
  Application.ProcessMessages;
  extendCaption:=False;
  Inherited;
  selectfromsql:='select * from Gl_Gain';
  AdoQry_Main.Connection:=AdOConnection;
  Orderbyfields:='projectCode';
  getdata;
  Frm_Sys_Detail:=TFrm_Gl_Enter_Gain_D.Create(Application);
end;

procedure TFrm_Gl_Enter_Gain.FormDestroy(Sender: TObject);
begin
  inherited;
  Frm_Gl_Enter_Gain:=nil;
end;

function TFrm_Gl_Enter_Gain.SetDeleteSql: String;
begin
  Result:='delete from Gl_Gain '
         +' where projectCode='+quotedstr(AdoQry_Main.fieldbyname('projectCode').asstring);
end;

procedure TFrm_Gl_Enter_Gain.Act_DeleteExecute(Sender: TObject);
begin
  if AdoQry_Main.RecordCount=0 then exit;
  if DispInfo(' 真的删除当前记录吗? ',2)<>'y' then exit;
  try
    dbconnect.beginTrans;
    saveGainhistory(dbconnect,AdoQry_Main.fieldbyname('projectCode').asstring,userCode,2);
    AdoQry_Tmp.Close;
    AdoQry_Tmp.SQL.Text:=SetDeleteSql;
    AdoQry_Tmp.ExecSQL;
    AdoQry_Main.Delete;
    dbconnect.CommitTrans;
  except
    if dbconnect.InTransaction then dbconnect.RollBackTrans;
    DispInfo(' 无法删除当前记录,可能已经被其他数据表引用!',1);
    Abort;
  end;
end;

end. 

⌨️ 快捷键说明

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