CEL_Payroll/Payroll.Service/Basic/DA/FestivalBonusProjectionDA.cs

82 lines
2.7 KiB
C#
Raw Permalink Normal View History

2024-09-17 14:30:13 +06:00
using System;
using Payroll.BO;
using System.Data;
using System.Linq;
using Ease.CoreV35.Model;
using System.Data.SqlClient;
using Ease.CoreV35.DataAccess;
using System.Collections.Generic;
using Ease.CoreV35.DataAccess.SQL;
namespace Payroll.Service
{
#region FestivalBonusProjectionDA
internal class FestivalBonusProjectionDA
{
#region Constructor
private FestivalBonusProjectionDA() { }
#endregion
#region Insert function
internal static void Insert(TransactionContext tc, FestivalBonusProjection item)
{
tc.ExecuteNonQuery("INSERT INTO FestivalBonusProjection(FestivalBonusProjectionID, basicmonth, noofbasic, CreatedBy, CreationDate, SequenceNo, Status)" +
" VALUES(%n, %n, %n, %n, %d, %n, %n)", item.ID.Integer, (int)item.BasicMonth, item.NoofBasic, DataReader.GetNullValue(item.CreatedBy.Integer), DataReader.GetNullValue(item.CreatedDate), item.Sequence, item.Status);
}
#endregion
#region Update function
internal static void Update(TransactionContext tc, FestivalBonusProjection item)
{
tc.ExecuteNonQuery("UPDATE FestivalBonusProjection SET basicmonth=%n, noofbasic=%n, ModifiedBy=%n, ModifiedDate=%d, SequenceNo=%n, Status=%n" +
" WHERE FestivalBonusProjectionID=%n", (int)item.BasicMonth, item.NoofBasic, DataReader.GetNullValue(item.ModifiedBy.Integer), DataReader.GetNullValue(item.ModifiedDate), item.Sequence, item.Status, item.ID.Integer);
}
#endregion
#region Get Function
internal static IDataReader Get(TransactionContext tc, EnumStatus status)
{
if (EnumStatus.Active == status || EnumStatus.Inactive == status)
{
return tc.ExecuteReader("SELECT * FROM FestivalBonusProjection Where Status=%n Order By SequenceNo", status);
}
else
{
return tc.ExecuteReader("SELECT * FROM FestivalBonusProjection Order By SequenceNo");
}
}
internal static IDataReader Get(TransactionContext tc, ID nID)
{
return tc.ExecuteReader("SELECT * FROM FestivalBonusProjection WHERE FestivalBonusProjectionID=%n", nID);
}
internal static IDataReader Get(TransactionContext tc, EnumMonths dBasicMonth)
{
return tc.ExecuteReader("SELECT * FROM FestivalBonusProjection WHERE basicmonth=%n", (int)dBasicMonth);
}
#endregion
#region Delete function
internal static void Delete(TransactionContext tc, ID nID)
{
tc.ExecuteNonQuery("DELETE FROM [FestivalBonusProjection] WHERE FestivalBonusProjectionID=%n", nID.Integer);
}
#endregion
}
#endregion
}