using System; using System.Data; using Ease.Core.DataAccess; using HRM.BO; namespace HRM.DA { public class ClaimTranDA { #region Constructor private ClaimTranDA() { } #endregion #region Get internal static IDataReader Get(TransactionContext tc, int id) { return tc.ExecuteReader("SELECT * FROM ClaimTran WHERE ClaimTranID=%n", id); } internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM ClaimTran"); } internal static IDataReader GetByEmployeeId(TransactionContext tc, int employeeid) { return tc.ExecuteReader("SELECT * FROM ClaimTran WHERE EmployeeID=%n", employeeid); } #endregion #region Insert internal static void Insert(TransactionContext tc, ClaimTran oClaimTran) { string sql = SQLParser.MakeSQL("INSERT INTO ClaimTran(ClaimTranID, EmployeeID,TranDate," + " Trantype, ReferenceID, Remarks,Transide,TranAmount)" + " VALUES(%n, %n, %d, %n, %n, %s, %n,%n)", oClaimTran.ID, oClaimTran.EmployeeID, oClaimTran.TranDate, oClaimTran.TranType, oClaimTran.ReferenceID, oClaimTran.Remarks, oClaimTran.TranSide, oClaimTran.TranAmount); tc.ExecuteNonQuery(sql); } #endregion #region Update internal static void Update(TransactionContext tc, ClaimTran oClaimTran) { string sSQL = SQLParser.MakeSQL("UPDATE ClaimTran SET EmployeeID=%n,TranDate=%d,Trantype=%n,ReferenceID=%n" + " Remarks=%s,Transide=%n,TranAmount=%n", oClaimTran.EmployeeID, oClaimTran.TranDate, oClaimTran.TranDate, oClaimTran.TranType, oClaimTran.ReferenceID, oClaimTran.Remarks, oClaimTran.TranSide, oClaimTran.TranAmount, oClaimTran.ID); tc.ExecuteNonQuery(sSQL); } #endregion #region Delete internal static void Delete(TransactionContext tc, int id) { tc.ExecuteNonQuery("DELETE FROM ClaimTran WHERE AssetSerialTranID=%n", id); } #endregion } }