88 lines
2.8 KiB
C#
88 lines
2.8 KiB
C#
using HRM.BO;
|
|
using Ease.Core.DataAccess;
|
|
using System;
|
|
using System.Data;
|
|
|
|
|
|
namespace HRM.DA.Fund
|
|
{
|
|
internal class InvestmentTranDA
|
|
{
|
|
#region Constructor
|
|
|
|
public InvestmentTranDA()
|
|
{
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Insert function
|
|
|
|
internal static void Insert(TransactionContext tc, InvestmentTran oItem)
|
|
{
|
|
tc.ExecuteNonQuery(
|
|
"INSERT INTO InvestmentTran(ActivityID, TranTypeID, CategoryID, InvestmentID, TemplateVoucherID," +
|
|
" ProjectID, TranDate, TranID, Amount, CreatedBy, CreatedDate) VALUES(%n, %n, %n, %n, %n, %n, %d, %n, %n, %n, %d)",
|
|
DataReader.GetNullValue(oItem.ActivityID), oItem.TranTypeID, oItem.CategoryID, oItem.InvestmentID,
|
|
oItem.TemplateVoucherID, oItem.ID, oItem.TranDate, oItem.ID, oItem.PrincipalAmount, oItem.CreatedBy,
|
|
oItem.CreatedDate);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Update function
|
|
|
|
internal static void Update(TransactionContext tc, InvestmentTran oItem)
|
|
{
|
|
tc.ExecuteNonQuery(
|
|
"UPDATE InvestmentTran SET ActivityID=%n, TranTypeID=%n, CategoryID=%n, InvestmentID=%n, TemplateVoucherID=%n, ProjectID=%n, TranDate=%d, ModifiedBy=%n, ModifiedDate=%d" +
|
|
" WHERE TranID=%n", DataReader.GetNullValue(oItem.ActivityID), oItem.TranTypeID, oItem.CategoryID,
|
|
oItem.InvestmentID, oItem.TemplateVoucherID, oItem.ID, oItem.TranDate, oItem.ModifiedBy,
|
|
oItem.ModifiedDate, oItem.ID);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region int Generation function
|
|
|
|
internal static int GetNewID(TransactionContext tc)
|
|
{
|
|
return tc.GenerateID("InvestmentTran", "TranID");
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Get Function
|
|
|
|
internal static IDataReader Getbyfundtype(TransactionContext tc, int fundtypeid)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM InvestmentTran WHERE ProjectID=%n", fundtypeid);
|
|
}
|
|
|
|
internal static IDataReader Get(TransactionContext tc, int nTranID)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM InvestmentTran WHERE TranID=%n", nTranID);
|
|
}
|
|
|
|
internal static IDataReader Get(TransactionContext tc, InvestmentInfo investmentInfo)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM InvestmentTran WHERE InvestmentID = %n ", investmentInfo.ID);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Delete function
|
|
|
|
internal static void Delete(TransactionContext tc, int nTranID)
|
|
{
|
|
tc.ExecuteNonQuery("DELETE FROM InvestmentTran WHERE TranID=%n", nTranID);
|
|
}
|
|
|
|
internal static void DeleteByParent(TransactionContext tc, int nID)
|
|
{
|
|
tc.ExecuteNonQuery("DELETE FROM InvestmentTran WHERE InvestmentID=%n ", nID);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |