EchoTex_Payroll/HRM.DA/DA/Fund/VoucherSetup/ActivityRelatedSourceDA.cs
2024-10-14 10:01:49 +06:00

78 lines
2.6 KiB
C#

using HRM.BO;
using Ease.Core.DataAccess;
using System;
using System.Data;
namespace HRM.DA.Fund
{
internal class ActivityRelatedSourceDA
{
#region Constructor
public ActivityRelatedSourceDA()
{
}
#endregion
#region Insert Function
internal static void Insert(TransactionContext tc, ActivityRelatedSource oARS)
{
string sql = SQLParser.MakeSQL(
"INSERT INTO ActivityRelatedSource (ActivityRelatedID, ProjectID, SourceTable, ValueField, CreatedBy, CreatedDate, ModifiedBy, ModifiedDate, ObjectType, ObjectTypeSubsidiary)" +
" VALUES(%n, %n, %s,%s, %s, %n,%D,%n,%D, %s, %s)", oARS.ID, oARS.ID, oARS.SourceTable, oARS.ValueField,
oARS.CreatedBy, oARS.CreatedDate,
oARS.ModifiedBy, oARS.ModifiedDate, oARS.ObjectType,
DataReader.GetNullValue(oARS.ObjectTypeSubsidiary));
tc.ExecuteNonQuery(sql);
}
#endregion
#region Update function
internal static void Update(TransactionContext tc, ActivityRelatedSource oARS)
{
string sql = SQLParser.MakeSQL(
"UPDATE ActivityRelatedSource Set SourceTable = %s, ValueField = %s, ModifiedBy = %n, ModifiedDate = %D, ObjectType = %s, ObjectTypeSubsidiary = %s" +
"WHERE ActivityRelatedID = %n ", oARS.SourceTable, oARS.ValueField, oARS.ModifiedBy, oARS.ModifiedDate,
oARS.ObjectType, DataReader.GetNullValue(oARS.ObjectTypeSubsidiary), oARS.ID);
tc.ExecuteNonQuery(sql);
}
#endregion
#region Delete Function
internal static void Delete(TransactionContext tc, int Id)
{
tc.ExecuteNonQuery("DELETE FROM ActivityRelatedSource WHERE ActivityRelatedID=%n", Id);
}
#endregion
#region Get Function
internal static IDataReader Get(TransactionContext tc, int ID)
{
return tc.ExecuteReader("SELECT * FROM ActivityRelatedSource WHERE ActivityRelatedID=%n", ID);
}
internal static IDataReader GetbyFundtype(TransactionContext tc, int fundtypeid)
{
return tc.ExecuteReader("SELECT * FROM ActivityRelatedSource Where ProjectID=%n", fundtypeid);
}
internal static IDataReader GetActivityVoucherSetupByProcessActivityID(TransactionContext tc, int ID,
int fundtypeid)
{
return tc.ExecuteReader("SELECT * FROM ProcessActivity WHERE ActivityID=%n AND ProjectID=%n", ID,
fundtypeid);
}
#endregion
}
}