feat: fmSalaryCalc GridView 改用 ObjectDataSource
- 新增 SacdDAC(SelectByProject) - dsSACD 改 ObjectDataSource
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.ComponentModel;
|
||||
using Wellan.Data;
|
||||
|
||||
/// <summary>
|
||||
/// 薪資科目匯總的資料處理類別
|
||||
/// </summary>
|
||||
[DataObject(true)]
|
||||
public class SacdDAC : Wellan.Data.WDAC
|
||||
{
|
||||
public SacdDAC()
|
||||
{
|
||||
}
|
||||
|
||||
public SacdDAC(string connectionConfig, string connectionConfigName)
|
||||
: this()
|
||||
{
|
||||
this._connectionConfig = connectionConfig;
|
||||
this._connectionConfigName = connectionConfigName;
|
||||
}
|
||||
|
||||
public SacdDAC(WQuery query)
|
||||
{
|
||||
this._query = query;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 取得某專案年月的科目預算與本月金額
|
||||
/// </summary>
|
||||
[DataObjectMethod(DataObjectMethodType.Select)]
|
||||
public DataTable SelectByProject(string BPPYN, DateTime SAYMM)
|
||||
{
|
||||
DbCommand cmd = Query.NewCommand(
|
||||
@"SELECT BPAB.BPPYN, BPAB.BPACC, ISNULL(BPAB.BPBGT, 0) AS BPBGT, BPAB.BPCLS, BPAB.BPAME, ISNULL(SACD.SAAMT, 0) AS SAAMT, SACD.SADOC
|
||||
FROM BPAB
|
||||
LEFT OUTER JOIN SACD ON BPAB.BPPYN = SACD.SAPYN AND BPAB.BPACC = SACD.SAACC AND SACD.SAYMM = @SAYMM
|
||||
WHERE (BPAB.BPPYN = @BPPYN) AND (SUBSTRING(BPAB.BPACC, 5, 2) <> '00')
|
||||
ORDER BY BPAB.BPCLS");
|
||||
cmd.Parameters.Add(Query.NewParameter("BPPYN", BPPYN));
|
||||
cmd.Parameters.Add(Query.NewParameter("SAYMM", SAYMM));
|
||||
return Query.Select(cmd);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user