119 lines
3.7 KiB
C#
119 lines
3.7 KiB
C#
|
|
using HRM.BO;
|
|||
|
|
using Ease.Core.DataAccess;
|
|||
|
|
using System;
|
|||
|
|
using System.Data;
|
|||
|
|
|
|||
|
|
|
|||
|
|
namespace HRM.DA.Fund
|
|||
|
|
{
|
|||
|
|
#region class TrusteeInfoDA
|
|||
|
|
|
|||
|
|
internal class TrusteeInfoDA
|
|||
|
|
{
|
|||
|
|
#region Constructor
|
|||
|
|
|
|||
|
|
public TrusteeInfoDA()
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region Insert function
|
|||
|
|
|
|||
|
|
internal static void Insert(TransactionContext tc, TrusteeInfo oItem)
|
|||
|
|
{
|
|||
|
|
tc.ExecuteNonQuery(
|
|||
|
|
"INSERT INTO FM_TrustyInfo(TrustyID, Name, Code, Email, Contacts, Status, FundTypeID, CreatedBy, CreatedDate)" +
|
|||
|
|
" VALUES(%n, %s, %s, %s, %s, %n, %n, %n, %D)", oItem.ID, oItem.Name, oItem.Code, oItem.Email,
|
|||
|
|
oItem.Contacts, oItem.StatusTrustee, oItem.FundTypeID, oItem.CreatedBy, oItem.CreatedDate);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region Update function
|
|||
|
|
|
|||
|
|
internal static void Update(TransactionContext tc, TrusteeInfo oItem)
|
|||
|
|
{
|
|||
|
|
tc.ExecuteNonQuery(
|
|||
|
|
"UPDATE FM_TrustyInfo SET Name=%s,Code=%s, Email=%s, Contacts=%s, Status=%n, FundTypeID=%n, ModifiedBy = %n, ModifiedDate = %D" +
|
|||
|
|
" WHERE TrustyID=%n", oItem.Name, oItem.Code, oItem.Email, oItem.Contacts, oItem.StatusTrustee, oItem.FundTypeID,
|
|||
|
|
oItem.ModifiedBy, oItem.ModifiedDate, oItem.ID);
|
|||
|
|
;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
internal static bool IsExist(TransactionContext tc, string TrusteeInfoCode, int fundtypeid)
|
|||
|
|
{
|
|||
|
|
object ob = tc.ExecuteScalar("SELECT COUNT(*) FROM FM_TrustyInfo WHERE Code=%s AND FundTypeID = %n",
|
|||
|
|
TrusteeInfoCode, fundtypeid);
|
|||
|
|
return Convert.ToInt32(ob) > 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#region IsInMinutes
|
|||
|
|
|
|||
|
|
internal static bool IsInMinutes(TransactionContext tc, int trusteeID)
|
|||
|
|
{
|
|||
|
|
object ob = tc.ExecuteScalar("SELECT COUNT(*) FROM FM_TrustyMinutesInfoRelation WHERE TrustyID = %n ",
|
|||
|
|
trusteeID);
|
|||
|
|
return Convert.ToInt32(ob) > 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region int Generation function
|
|||
|
|
|
|||
|
|
internal static int GetNewID(TransactionContext tc)
|
|||
|
|
{
|
|||
|
|
return tc.GenerateID("FM_TrustyInfo", "TrustyID");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region Get Function
|
|||
|
|
|
|||
|
|
internal static IDataReader Getbyfundtype(TransactionContext tc, int fundtypeid)
|
|||
|
|
{
|
|||
|
|
return tc.ExecuteReader("SELECT * FROM FM_TrustyInfo Where FundTypeID = %n", fundtypeid);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
internal static IDataReader Get(TransactionContext tc)
|
|||
|
|
{
|
|||
|
|
return tc.ExecuteReader("SELECT * FROM FM_TrustyInfo ");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
internal static IDataReader Get(TransactionContext tc, int fundTypeId)
|
|||
|
|
{
|
|||
|
|
return tc.ExecuteReader("SELECT * FROM FM_TrustyInfo WHERE FundTypeID=%n", fundTypeId);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
internal static IDataReader GetByFundTypeID(TransactionContext tc, int FundTypeID)
|
|||
|
|
{
|
|||
|
|
return tc.ExecuteReader("SELECT * FROM FM_TrustyInfo WHERE FundTypeID=%n", FundTypeID);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
internal static IDataReader GetByStatusAndFundTypeID(TransactionContext tc, int FundTypeID,
|
|||
|
|
EnumTrusteeStatus status)
|
|||
|
|
{
|
|||
|
|
return tc.ExecuteReader("SELECT * FROM FM_TrustyInfo WHERE FundTypeID=%n AND Status = %n", FundTypeID, status);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
internal static IDataReader GetbyStatus(TransactionContext tc, int Type, int fundtypeid)
|
|||
|
|
{
|
|||
|
|
return tc.ExecuteReader("SELECT * FROM FM_TrustyInfo WHERE Status=%n AND FundTypeID = %n", Type, fundtypeid);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region Delete function
|
|||
|
|
|
|||
|
|
internal static void Delete(TransactionContext tc, int TrusteeInfoID)
|
|||
|
|
{
|
|||
|
|
tc.ExecuteNonQuery("DELETE FROM [FM_TrustyInfo] WHERE TrustyID=%n", TrusteeInfoID);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
}
|