73 lines
1.7 KiB
C#
73 lines
1.7 KiB
C#
|
using System;
|
|||
|
using Payroll.BO;
|
|||
|
using System.Data;
|
|||
|
using System.Linq;
|
|||
|
using System.Data.SqlClient;
|
|||
|
using Ease.CoreV35.DataAccess;
|
|||
|
using System.Collections.Generic;
|
|||
|
using Ease.Core.DataAccess;
|
|||
|
using HRM.BO;
|
|||
|
|
|||
|
namespace Payroll.Service
|
|||
|
{
|
|||
|
#region PRBKpiDA
|
|||
|
|
|||
|
internal class PRBKpiDA
|
|||
|
{
|
|||
|
#region Constructor
|
|||
|
|
|||
|
private PRBKpiDA() { }
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Insert function
|
|||
|
|
|||
|
internal static void Insert(TransactionContext tc, PRBKpi item)
|
|||
|
{
|
|||
|
tc.ExecuteNonQuery("INSERT INTO PRBKpi(kpiID,TargetSerial, KpiName, PRBMonth,Description) " +
|
|||
|
" VALUES(%n,%s,%s,%d,%s)",
|
|||
|
item.ID,item.Serial, item.KpiName, item.PRBMonth,item.Description);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Update function
|
|||
|
|
|||
|
internal static void Update(TransactionContext tc, PRBKpi item)
|
|||
|
{
|
|||
|
tc.ExecuteNonQuery("UPDATE PRBKpi SET TargetSerial=%n, KpiName=%n,PRBMonth=%n,Description=%n " +
|
|||
|
" WHERE kpiID=%n", item.Serial, item.KpiName, item.PRBMonth, item.Description, item.ID);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Get Function
|
|||
|
|
|||
|
internal static IDataReader Get(TransactionContext tc)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM PRBKpi");
|
|||
|
}
|
|||
|
|
|||
|
internal static IDataReader GetKpiByPrbMonth(TransactionContext tc,DateTime prbmonth)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM PRBKpi WHERE MONTH(PRBMonth)=MONTH(%d)", prbmonth);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Delete function
|
|||
|
|
|||
|
internal static void Delete(TransactionContext tc, int nID)
|
|||
|
{
|
|||
|
tc.ExecuteNonQuery("DELETE FROM PRBKpi WHERE KpiID=%n", nID);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|