HRM-10/HRM.DA/DA/Fund/VoucherSetup/WPPFFundDistributionDA.cs
Mohaimen Hasan 838b8d4480 first commit
2026-11-03 13:06:00 +06:00

97 lines
3.8 KiB
C#

using Ease.Core.DataAccess;
using HRM.BO;
using System.Data;
namespace HRM.DA.DA.Fund.VoucherSetup
{
internal class WPPFFundDistributionDA
{
#region Constructor
private WPPFFundDistributionDA() { }
#endregion
#region All Functions
#region INSERT Function
internal static void Insert(TransactionContext tc, WPPFFundDistribution oFundDistribution)
{
string sql = SQLParser.MakeSQL(
@"INSERT INTO FM_WPPFFundDistribution(FiscalDate, ReceivedFund, ReceivedFundGLID, ParticipationFund, ParticipationFundGLID,
CompanyWelfareFund, CompanyWelfareFundGLID, GovernmentWelfareFund, GovernmentWelfareFundGLID, FundTypeID, GLTranID, VoucherDate,
CreatedBy, CreatedDate)
VALUES(%d, %n, %n, %n, %n, %n, %n, %n, %n, %n, %n, %d, %n, %d)",
oFundDistribution.FiscalDate,
oFundDistribution.ReceivedFund,
oFundDistribution.ReceivedFundGLID,
oFundDistribution.ParticipationFund,
oFundDistribution.ParticipationFundGLID,
oFundDistribution.CompanyWelfareFund,
oFundDistribution.CompanyWelfareFundGLID,
oFundDistribution.GovernmentWelfareFund,
oFundDistribution.GovernmentWelfareFundGLID,
oFundDistribution.FundTypeID,
oFundDistribution.GLTranID,
oFundDistribution.VoucherDate,
oFundDistribution.CreatedBy,
oFundDistribution.CreatedDate);
tc.ExecuteNonQuery(sql);
}
#endregion
#region UPDATE Function
internal static void Update(TransactionContext tc, WPPFFundDistribution oFundDistribution)
{
string sql = SQLParser.MakeSQL(
@"UPDATE FM_WPPFFundDistribution SET
FiscalDate = %d,
ReceivedFund = %n,
ReceivedFundGLID = %n,
ParticipationFund = %n,
ParticipationFundGLID = %n,
CompanyWelfareFund = %n,
CompanyWelfareFundGLID = %n,
GovernmentWelfareFund = %n,
GovernmentWelfareFundGLID = %n,
FundTypeID = %n,
ModifiedBy = %n,
ModifiedDate = %d
WHERE FundDistributionID = %n",
oFundDistribution.FiscalDate,
oFundDistribution.ReceivedFund,
oFundDistribution.ReceivedFundGLID,
oFundDistribution.ParticipationFund,
oFundDistribution.ParticipationFundGLID,
oFundDistribution.CompanyWelfareFund,
oFundDistribution.CompanyWelfareFundGLID,
oFundDistribution.GovernmentWelfareFund,
oFundDistribution.GovernmentWelfareFundGLID,
oFundDistribution.FundTypeID,
oFundDistribution.ModifiedBy,
oFundDistribution.ModifiedDate,
oFundDistribution.FundDistributionID);
tc.ExecuteNonQuery(sql);
}
#endregion
#region Get Functions
internal static IDataReader GetAllFundDistributions(TransactionContext tc, int fundTypeID)
{
return tc.ExecuteReader("SELECT * FROM FM_WPPFFundDistribution where FundTypeID = %n", fundTypeID);
}
internal static IDataReader Get(TransactionContext tc, int id)
{
return tc.ExecuteReader("SELECT * FROM FM_WPPFFundDistribution WHERE FundDistributionID = %n", id);
}
internal static void Delete(TransactionContext tc, int id)
{
tc.ExecuteNonQuery("DELETE FROM FM_WPPFFundDistribution WHERE FundDistributionID = %n", id);
}
#endregion
#endregion
}
}