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

📄 unttincomeexpenses.pas

📁 销售软件
💻 PAS
字号:
(*===========================================================*)
(*                                                           *)
(*              Jerk Computer Assembly Manager               *)
(*                                                           *)
(*                    程序作者:杨芹勍                       *)
(*          武汉科技大学 理学院 信息与计算科学031班          *)
(*                  武汉科技大学 莘特工作室                  *)
(*                                                           *)
(*              IDE:Borland Delphi 2006 Update 2            *)
(*                 第三方控件:Raize 4.03                    *)
(*             数据库:Microsoft SQL Server 2000             *)
(*            数据库访问引擎:原生ADO(ADODB_TLB)           *)
(*           数据库管理引擎:JERK DBMANAGER ALPHA            *)
(*                                                           *)
(*           此软件及源代码归 JERK SYSTEM 版权所有           *)
(*            (C)Copyright 2002-2006 Jerk System.            *)
(*                                                           *)
(*===========================================================*)

unit untTIncomeExpenses;

interface

uses
  SysUtils,
  ADODB_TLB,
  JCAMTableView,
  JCAMConsts,
  JCAMUtils;

const
  TN_INCOMEEXPENSES: string = 't_IncomeExpenses';
  VN_INCOMEEXPENSES: string = 'v_IncomeExpenses';
  KFN_INCOMEEXPENSES: string = 'IncomeExpenses_ID';
  FN_NOTEDATE: string = 'NoteDate';
  FN_INCOME: string = 'Income';
  FN_EXPENSES: string = 'Expenses';
  FN_TOTALINCOMEEXPENSES: string = 'TotalIncomeExpenses';
  PN_SAVEINCOMEEXPENSESINFO: string = 'sp_SaveIncomeExpensesInfo';
  PN_DELETEINCOMEEXPENSESINFO: string = 'sp_DeleteIncomeExpensesInfo';

type
  TTableIncomeExpenses = class( TCustomTableView )
  private
  public
    property Connection;
    function TotalIncomeByCondition( sCondition: string ): Integer;
    function TotalExpensesByCondition( sCondition: string ): Integer;
    function TotalIncomeExpensesByCondition( sCondition: string ): Integer;
  end;

implementation

{ TTableIncomeExpenses }

function TTableIncomeExpenses.TotalExpensesByCondition(
  sCondition: string ): Integer;
begin
  Result := GetFieldSumByCondition( FN_EXPENSES, VN_INCOMEEXPENSES, sCondition
    );
end;

function TTableIncomeExpenses.TotalIncomeByCondition(
  sCondition: string ): Integer;
begin
  Result := GetFieldSumByCondition( FN_INCOME, VN_INCOMEEXPENSES, sCondition );
end;

function TTableIncomeExpenses.TotalIncomeExpensesByCondition(
  sCondition: string ): Integer;
begin
  Result := TotalIncomeByCondition( sCondition ) - TotalExpensesByCondition(
    sCondition );
end;

end.

⌨️ 快捷键说明

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