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

📄 datamodule.pas

📁 一套非常发好的财务管理软件,想从事此方面开发的可以借签
💻 PAS
字号:
unit DataModule;

interface

uses
  SysUtils, Classes, DB, ADODB, ExtFunc;

type
  TDM = class(TDataModule)
    adoc: TADOConnection;
    procedure DataModuleCreate(Sender: TObject);
  private
    { Private declarations }
  public
    SoftName,SoftVersionNumber,SoftName2:string;
    AccountName,DeptName,DeptManager,FinanceManager,DeptProperty:string;
    AccountStartState:Boolean;
    AccountStartDate:TDatetime;
    AccountStartYear,AccountStartMonth:integer;
    AccountYear,AccountMonth:integer;
    CashAccountYear,CashAccountMonth:integer;
    BankAccountYear,BankAccountMonth:integer;
    CarryForwardInterval:string;
    MID,SN:string;
    SoftRegState:Boolean;

    UserID:integer;
    UserName,UserPassword,SupperPassword:string;
    UserRights:array of pBoolean;

    SubjectType:array of string;
    SubjectTypeNum:integer;
    SubjectCodeLen:array of integer;
    MaxSubjectLevel:integer;

    ReportName:array of string;
    ReportStoreProcedureName:array of string;
    ReportFileName:array of string;
    ReportPageHeight:array of integer;
    ReportPageWidth:array of integer;

    PDPageWidth,PDPageHeight:integer;
    AccountPageWidth,AccountPageHeight:integer;

    ExitBeforeBackup,isWriteLog:Boolean;

    function CheckRights(RightsNum:integer):Boolean;
    function CheckAccountStartedOperation:Boolean;
    procedure WriteLog(Msg:string);
    function CheckSoftReg:Boolean;
  end;

var
  DM: TDM;

implementation

{$R *.dfm}

procedure TDM.WriteLog(Msg:string);
begin
  if isWriteLog then Fun_WriteLog(DM.adoc,'P_WriteLog',Msg,UserID);
end;

function TDM.CheckRights(RightsNum:integer):Boolean;
begin
  if not UserRights[RightsNum-1]^ then
  begin
    Frm_MsgBox('系统信息','对不起,您没有这项操作的权限!',MsgBox_OK_INFO);
    result:=false;
  end
  else
    result:=true;
end;

function TDM.CheckSoftReg:Boolean;
var
  hh,mm,ss,ms:word;
begin
  result:=true;
  if DM.SoftRegState then Exit;
  DecodeTime(now,hh,mm,ss,ms);
  if StrToDate(IntToStr(AccountYear)+'-'+IntToStr(AccountMonth)+'-1')-DM.AccountStartDate>90 then
  begin
    Frm_MsgBox('系统信息','您使用的软件没有经过开发商的授权,并且已超过免费使用期限,请注册本软件,谢谢。',MsgBox_OK_ERROR);
    result:=false;
  end
  else
    if ms>800 then
      Frm_MsgBox('系统信息','您使用的软件没有经过开发商的授权,但在免费使用期限内并没有任何功能限制。请及时注册本软件,谢谢。',MsgBox_OK_INFO);
end;

function TDM.CheckAccountStartedOperation:Boolean;
begin
  if not AccountStartState then
  begin
    Frm_MsgBox('系统信息','帐套没有启用,请先进行必要的设置(设置科目、期初余额等),然后启用帐套!',MsgBox_OK_INFO);
    result:=false;
  end
  else
    result:=true;
end;

procedure TDM.DataModuleCreate(Sender: TObject);
begin
  SoftName:='晓风财务管理系统';
  SoftVersionNumber:='1.0.1';
  SoftName2:='ShoveFinance 2004';
end;

end.

⌨️ 快捷键说明

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