68 lines
2.0 KiB
C#
68 lines
2.0 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System;
|
|||
|
using System.Data;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using Ease.Core.DataAccess;
|
|||
|
using HRM.BO;
|
|||
|
|
|||
|
namespace HRM.DA.Fund
|
|||
|
{
|
|||
|
internal class ESBDefinitionDA
|
|||
|
{
|
|||
|
public ESBDefinitionDA()
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
#region Insert Function
|
|||
|
|
|||
|
internal static void Insert(TransactionContext tc, ESBDefinition item)
|
|||
|
{
|
|||
|
string sql = SQLParser.MakeSQL(
|
|||
|
"INSERT INTO ESBDefinition (Description,ESBID,ServiceLength,Trading,CreatedBy,CreatedDate,UserID)" +
|
|||
|
" VALUES(%s,%n,%n,%n,%n,%n,%D,%n,%n)", DataReader.GetNullValue(item.Description), item.ID,
|
|||
|
item.MaxServiceLength, item.Trading, item.CreatedBy, item.CreatedDate, item.UserID);
|
|||
|
|
|||
|
tc.ExecuteNonQuery(sql);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Update function
|
|||
|
|
|||
|
internal static void Update(TransactionContext tc, ESBDefinition item)
|
|||
|
{
|
|||
|
string sql = SQLParser.MakeSQL(
|
|||
|
"UPDATE ESBDefinition Set Description = %s, ServiceLength = %n, Trading = %n, ModifiedBy = %n, ModifiedDate = %D, UserID = %n" +
|
|||
|
"WHERE ESBID = %n ", DataReader.GetNullValue(item.Description), item.MaxServiceLength, item.Trading,
|
|||
|
item.ModifiedBy, item.ModifiedDate, item.UserID, item.ID);
|
|||
|
tc.ExecuteNonQuery(sql);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Delete Function
|
|||
|
|
|||
|
internal static void Delete(TransactionContext tc, int ESBID)
|
|||
|
{
|
|||
|
tc.ExecuteNonQuery("DELETE FROM ESBDefinition WHERE ESBID=%n", ESBID);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Get Function
|
|||
|
|
|||
|
internal static IDataReader Get(TransactionContext tc, int ESBID)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM ESBDefinition WHERE ESBID=%n", ESBID);
|
|||
|
}
|
|||
|
|
|||
|
internal static IDataReader Get(TransactionContext tc)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM ESBDefinition");
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|
|||
|
}
|