98 lines
3.1 KiB
C#
98 lines
3.1 KiB
C#
using HRM.BO;
|
|
using Ease.Core.DataAccess;
|
|
using System;
|
|
using System.Data;
|
|
|
|
namespace HRM.DA
|
|
{
|
|
#region class InvestmentCategoryDA
|
|
|
|
internal class InvestmentCategoryDA
|
|
{
|
|
#region Constructor
|
|
|
|
public InvestmentCategoryDA()
|
|
{
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Insert function
|
|
|
|
internal static void Insert(TransactionContext tc, InvestmentCategory oItem)
|
|
{
|
|
tc.ExecuteNonQuery(
|
|
"INSERT INTO FM_InvestmentCategory(InvestmentCategoryID, Name, Code, UserObjectName, MinValue,CreatedBy, CreatedDate, interestrate, FundTypeID)" +
|
|
" VALUES(%n, %s, %s, %s, %n, %n, %D, %n, %n)", oItem.ID, oItem.Name, oItem.Code, oItem.UserObjectName,
|
|
oItem.MinValue, oItem.CreatedBy, oItem.CreatedDate, oItem.InterestRate, oItem.FundTypeID);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Update function
|
|
|
|
internal static void Update(TransactionContext tc, InvestmentCategory oItem)
|
|
{
|
|
tc.ExecuteNonQuery(
|
|
"UPDATE FM_InvestmentCategory SET Name=%s, Code=%s, UserObjectName=%s, MinValue=%n,ModifiedBy = %n, ModifiedDate = %D, interestrate=%n " +
|
|
"WHERE InvestmentCategoryID = %n", oItem.Name, oItem.Code, oItem.UserObjectName, oItem.MinValue,
|
|
oItem.ModifiedBy, oItem.ModifiedDate, oItem.InterestRate, oItem.ID);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region IsExist
|
|
|
|
internal static bool IsExist(TransactionContext tc, string code, int fundtypeid)
|
|
{
|
|
object ob = tc.ExecuteScalar(" SELECT COUNT(*) FROM FM_InvestmentCategory WHERE Code = %s AND FundTypeID = %n",
|
|
code, fundtypeid);
|
|
return Convert.ToInt32(ob) > 0;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region int Generation function
|
|
|
|
internal static int GetNewID(TransactionContext tc)
|
|
{
|
|
return tc.GenerateID("FM_InvestmentCategory", "InvestmentCategoryID");
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Get Function
|
|
|
|
internal static IDataReader GetByFundType(TransactionContext tc, int fundtypeid)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM FM_InvestmentCategory WHERE FundTypeID = %n", fundtypeid);
|
|
}
|
|
|
|
internal static IDataReader Get(TransactionContext tc, int InvestmentCategoryID)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM FM_InvestmentCategory WHERE InvestmentCategoryID=%n",
|
|
InvestmentCategoryID);
|
|
}
|
|
internal static IDataReader Get(TransactionContext tc)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM FM_InvestmentCategory");
|
|
}
|
|
internal static IDataReader GetbyFundTypeID(TransactionContext tc, int ID)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM FM_InvestmentCategory WHERE FundTypeID=%n", ID);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Delete function
|
|
|
|
internal static void Delete(TransactionContext tc, int InvestmentCategoryID)
|
|
{
|
|
tc.ExecuteNonQuery("DELETE FROM [FM_InvestmentCategory] WHERE InvestmentCategoryID=%n", InvestmentCategoryID);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
|
|
#endregion
|
|
} |