HRM-10/HRM.DA/DA/Fund/Transaction/UserRecordDA.cs

71 lines
2.8 KiB
C#
Raw Normal View History

2026-11-03 13:06:00 +06:00
using System;
using System.Data;
using Ease.Core.DataAccess;
using HRM.BO;
namespace HRM.DA
{
#region UserRecord
public class UserRecordDA
{
#region Constructor
public UserRecordDA() { }
#endregion
#region Insert function
public static void Insert(TransactionContext tc, UserRecord oItem)
{
string sql = SQLParser.MakeSQL("INSERT INTO FM_USERRECORD(UserRecordID, UserObjectID, PositionNo, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, CreatedBy, CreateDate, FundTypeID" +
" ) VALUES(%n, %n, %n, %s, %s, %s, %s, %s, %s, %s, %s, %n, %d, %n)", oItem.ID, oItem.UserObjectID, oItem.PositionNo,
oItem.Field1, oItem.Field2, oItem.Field3,
oItem.Field4, oItem.Field5, oItem.Field6,
oItem.Field7, oItem.Field8, oItem.CreatedBy,
oItem.CreatedDate, oItem.FundTypeID);
tc.ExecuteNonQuery(sql);
}
#endregion
#region Update function
public static void Update(TransactionContext tc, UserRecord oItem)
{
tc.ExecuteNonQuery("UPDATE FM_USERRECORD SET UserObjectID=%n, Field1=%s, Field2=%s, Field3=%s, Field4=%s, Field5=%s, Field6=%s, Field7=%s, Field8=%s, FundTypeID = %n, " +
" Modifiedby=%n, ModifiedDate=%D WHERE UserRecordID=%n", oItem.UserObjectID, oItem.Field1,
oItem.Field2, oItem.Field3, oItem.Field4,
oItem.Field5, oItem.Field6, oItem.Field7,
oItem.Field8, oItem.FundTypeID,
oItem.ModifiedBy, oItem.ModifiedDate, oItem.ID);
}
#endregion
#region Get Function
public static IDataReader GetByUserObjectID(TransactionContext tc, int UserObjectID, int fundtypeid)
{
return tc.ExecuteReader("SELECT * FROM FM_UserRecord WHERE UserObjectID = %n and fundtypeid=%n", UserObjectID, fundtypeid);
}
public static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("SELECT * FROM FM_UserRecord");
}
public static IDataReader Get(TransactionContext tc, int id)
{
return tc.ExecuteReader("SELECT * FROM FM_UserRecord where UserRecordID = %n", id);
}
public static IDataReader GetByField1(TransactionContext tc, string sUserRecordField1, int userObjectID, int fundTypeID)
{
return tc.ExecuteReader("SELECT * FROM FM_UserRecord WHERE Field1=%s and UserObjectID=%n and FundTypeID = %n", sUserRecordField1, userObjectID, fundTypeID);
}
#endregion
#region Delete function
public static void Delete(TransactionContext tc, int nUserRecordID)
{
tc.ExecuteNonQuery("DELETE FROM UserRecord WHERE UserRecordID=%n", nUserRecordID);
}
#endregion
}
#endregion
}