149 lines
5.3 KiB
C#
149 lines
5.3 KiB
C#
|
|
using System;
|
||
|
|
using System.Data;
|
||
|
|
using System.Linq;
|
||
|
|
using System.Text;
|
||
|
|
using Ease.Core.DataAccess;
|
||
|
|
using HRM.BO;
|
||
|
|
|
||
|
|
namespace HRM.DA
|
||
|
|
{
|
||
|
|
#region GLTranUserRecord
|
||
|
|
|
||
|
|
public class GLTranUserRecordDA
|
||
|
|
{
|
||
|
|
#region Constructor
|
||
|
|
|
||
|
|
public GLTranUserRecordDA()
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
#endregion
|
||
|
|
|
||
|
|
#region Insert function
|
||
|
|
|
||
|
|
public static void Insert(TransactionContext tc, GLTranUserRecord oItem)
|
||
|
|
{
|
||
|
|
string sSQL = SQLParser.MakeSQL("INSERT INTO FM_GLTranUserRecord(" +
|
||
|
|
"GLTranUserRecordID, " + //1
|
||
|
|
"GLID, " + //2
|
||
|
|
"GLTranID, " + //3
|
||
|
|
"GLTranDetailID, " + //4
|
||
|
|
"UserObject1ID, " + //5
|
||
|
|
"UserRecord1ID, " + //6
|
||
|
|
"UserObject2ID, " + //7
|
||
|
|
"UserRecord2ID, " + //8
|
||
|
|
"Description, " + //9
|
||
|
|
"Amount, " + //10
|
||
|
|
"OperationalStatus)" + //13
|
||
|
|
// 1 2 3 4 5 6 7 8 9 10 13
|
||
|
|
" VALUES(%n, %n, %n, %n, %n, %n, %n, %n, %s, %n, %n)",
|
||
|
|
oItem.ID, //1
|
||
|
|
oItem.GLID, //2
|
||
|
|
oItem.GLTranID, //3
|
||
|
|
oItem.GLTranDetailID, //4
|
||
|
|
oItem.UserObject1ID, //5
|
||
|
|
oItem.UserRecord1ID, //6
|
||
|
|
oItem.UserObject2ID, //7
|
||
|
|
oItem.UserRecord2ID, //8
|
||
|
|
oItem.Description, //9
|
||
|
|
oItem.Amount, //10
|
||
|
|
(int)oItem.OperationalStatus); //13);
|
||
|
|
|
||
|
|
tc.ExecuteNonQuery(sSQL);
|
||
|
|
}
|
||
|
|
|
||
|
|
#endregion
|
||
|
|
|
||
|
|
#region Update function
|
||
|
|
|
||
|
|
public static void Update(TransactionContext tc, GLTranUserRecord oItem)
|
||
|
|
{
|
||
|
|
tc.ExecuteNonQuery("UPDATE FM_GLTranUserRecord SET "
|
||
|
|
+ "GLID=%n, " //1
|
||
|
|
+ "GLTranID=%n, " //2
|
||
|
|
+ "GLTranDetailID=%n, " //3
|
||
|
|
+ "UserObject1ID=%n, " //4
|
||
|
|
+ "UserRecord1ID=%n, " //5
|
||
|
|
+ "UserObject2ID=%n, " //6
|
||
|
|
+ "UserRecord2ID=%n, " //7
|
||
|
|
+ "Description=%s, " //8
|
||
|
|
+ "Amount=%n, " //9
|
||
|
|
+ "Modifiedby=%n, " //10
|
||
|
|
+ "ModifiedDate=%d " //11
|
||
|
|
+ "WHERE GLTranUserRecordID=%n", //12
|
||
|
|
oItem.GLID, //1
|
||
|
|
oItem.GLTranID, //2
|
||
|
|
oItem.GLTranDetailID, //3
|
||
|
|
oItem.UserObject1ID, //4
|
||
|
|
oItem.UserRecord1ID, //5
|
||
|
|
oItem.UserObject2ID, //6
|
||
|
|
oItem.UserRecord2ID, //7
|
||
|
|
oItem.Description, //8
|
||
|
|
oItem.Amount, //9
|
||
|
|
oItem.ModifiedBy, //10
|
||
|
|
oItem.ModifiedDate, //11
|
||
|
|
oItem.ID //12
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
#endregion
|
||
|
|
|
||
|
|
#region Get Function
|
||
|
|
|
||
|
|
public static IDataReader Get(TransactionContext tc)
|
||
|
|
{
|
||
|
|
return tc.ExecuteReader("SELECT * FROM FM_GLTranUserRecord");
|
||
|
|
}
|
||
|
|
|
||
|
|
public static IDataReader Get(TransactionContext tc, int nGLTranUserRecordID)
|
||
|
|
{
|
||
|
|
return tc.ExecuteReader("SELECT * FROM FM_GLTranUserRecord WHERE GLTranUserRecordID = %n",
|
||
|
|
nGLTranUserRecordID);
|
||
|
|
}
|
||
|
|
|
||
|
|
public static IDataReader GetByGLTranID(TransactionContext tc, int nGLTranID)
|
||
|
|
{
|
||
|
|
return tc.ExecuteReader("SELECT * FROM FM_GLTranUserRecord WHERE GLTranID = %n", nGLTranID);
|
||
|
|
}
|
||
|
|
|
||
|
|
public static IDataReader GetByGLTranDetailID(TransactionContext tc, int nGLTranDetailID)
|
||
|
|
{
|
||
|
|
return tc.ExecuteReader("SELECT * FROM FM_GLTranUserRecord WHERE GLTranDetailID = %n", nGLTranDetailID);
|
||
|
|
}
|
||
|
|
|
||
|
|
public static IDataReader GetByGLID(TransactionContext tc, int gLID)
|
||
|
|
{
|
||
|
|
return tc.ExecuteReader("SELECT * FROM FM_GLTranUserRecord WHERE GLID = %n", gLID);
|
||
|
|
}
|
||
|
|
|
||
|
|
#endregion
|
||
|
|
|
||
|
|
#region Delete function
|
||
|
|
|
||
|
|
public static void Delete(TransactionContext tc, int nGLTranUserRecordID)
|
||
|
|
{
|
||
|
|
tc.ExecuteNonQuery("DELETE FROM FM_GLTranUserRecord WHERE GLTranUserRecordID=%n", nGLTranUserRecordID);
|
||
|
|
}
|
||
|
|
|
||
|
|
public static void DeleteGLTanUOByGLTranID(TransactionContext tc, int nGLTranID)
|
||
|
|
{
|
||
|
|
tc.ExecuteNonQuery("DELETE FROM FM_GLTranUserRecord WHERE GLTranID=%n", nGLTranID);
|
||
|
|
}
|
||
|
|
|
||
|
|
#endregion
|
||
|
|
|
||
|
|
|
||
|
|
public static IDataReader GetByGLTranIDOpen(TransactionContext tc, int nGLTranID)
|
||
|
|
{
|
||
|
|
return tc.ExecuteReader("SELECT * FROM FM_OpenGLTranUserRecord WHERE OpenGLTranID = %n", nGLTranID);
|
||
|
|
}
|
||
|
|
|
||
|
|
public static IDataReader GetByGLTranDetailIDOpen(TransactionContext tc, int nGLTranDetailID)
|
||
|
|
{
|
||
|
|
return tc.ExecuteReader("SELECT * FROM FM_OpenGLTranUserRecord WHERE OpenGLTranDetailID = %n",
|
||
|
|
nGLTranDetailID);
|
||
|
|
}
|
||
|
|
|
||
|
|
#endregion
|
||
|
|
}
|
||
|
|
}
|