unttincomeexpenses.pas
来自「销售软件」· PAS 代码 · 共 78 行
PAS
78 行
(*===========================================================*)
(* *)
(* 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 + =
减小字号Ctrl + -
显示快捷键?