EchoTex_Payroll/HRM.DA/DA/Claim/ClaimBasicItemDA.cs

78 lines
2.8 KiB
C#
Raw Permalink Normal View History

2024-10-14 10:01:49 +06:00
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 ClaimBasicItemDA
internal class ClaimBasicItemDA
{
#region Constructor
private ClaimBasicItemDA()
{}
#endregion
#region Insert function
internal static void Insert(TransactionContext tc, ClaimBasicItem item)
{
string sSQL = SQLParser.MakeSQL("INSERT INTO ClaimBasicItem(ClaimBasicItemID, ClaimBasicID, Name, Serial, GlCode, GlSide, GlSideCode,IsFamilyMemberNeeded, CreatedBy, CreatedDate,FixedAmount,MonthlyOnce,IsAttachment)" +
" VALUES(%n,%n,%s,%n,%s,%s,%s,%n,%n,%d,%n,%n,%b)", item.ID, item.ClaimBasicID, item.Name, item.Serial, item.GlCode, item.GlSide, item.GlSideCode, item.IsFamilyMemberNeeded, item.CreatedBy, item.CreatedDate, item.FixedAmount, item.MonthlyOnce,item.IsAttachment);
tc.ExecuteNonQuery(sSQL);
}
#endregion
#region Update function
internal static void Update(TransactionContext tc, ClaimBasicItem item)
{
tc.ExecuteNonQuery("UPDATE ClaimBasicItem SET ClaimBasicID=%n, Name=%s, Serial=%s, GlCode=%s, GlSide=%s, GlSideCode=%s,IsFamilyMemberNeeded=%b, ModifiedBy=%n, ModifiedDate=%d,FixedAmount=%n,MonthlyOnce=%n,IsAttachment=%b" +
" WHERE ClaimBasicItemID=%n", item.ClaimBasicID, item.Name, item.Serial, item.GlCode, item.GlSide, item.GlSideCode, item.IsFamilyMemberNeeded, item.ModifiedBy, item.ModifiedDate, item.FixedAmount, item.MonthlyOnce, item.IsAttachment, item.ID);
}
#endregion
#region Get Function
internal static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("SELECT * FROM ClaimBasicItem");
}
internal static IDataReader Get(TransactionContext tc, int nID)
{
return tc.ExecuteReader("SELECT * FROM ClaimBasicItem WHERE ClaimBasicItemID=%n", nID);
}
#endregion
#region Delete function
internal static void Delete(TransactionContext tc, int nID)
{
tc.ExecuteNonQuery("DELETE FROM ClaimBasicItem WHERE ClaimBasicItemID=%n", nID);
}
internal static void DeleteByClaimBasicID(TransactionContext tc, int nID)
{
tc.ExecuteNonQuery("DELETE FROM ClaimBasicItem WHERE ClaimBasicID=%n", nID);
}
#endregion
internal static IDataReader GetByClaimBasicID(TransactionContext tc, int claimBasicID)
{
return tc.ExecuteReader("SELECT * FROM ClaimBasicItem WHERE ClaimBasicID=%n", claimBasicID);
}
}
#endregion
}