77 lines
1.8 KiB
C#
77 lines
1.8 KiB
C#
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 PunishmentDA
|
|
|
|
internal class PunishmentDA
|
|
{
|
|
#region Constructor
|
|
|
|
private PunishmentDA() { }
|
|
|
|
#endregion
|
|
|
|
#region Insert function
|
|
|
|
internal static void Insert(TransactionContext tc, Punishment item)
|
|
{
|
|
tc.ExecuteNonQuery("INSERT INTO Punishment(PunishmentID, code, Description)" +
|
|
" VALUES(%n, %s, %s)", item.ID.Integer, item.Code, item.Description);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Update function
|
|
|
|
internal static void Update(TransactionContext tc, Punishment item)
|
|
{
|
|
tc.ExecuteNonQuery("UPDATE Punishment SET code=%s, Description=%s" +
|
|
" WHERE PunishmentID=%n", item.Code, item.Description, item.ID.Integer);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Get Function
|
|
|
|
internal static IDataReader Get(TransactionContext tc, EnumStatus status)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM Punishment");
|
|
|
|
}
|
|
|
|
internal static IDataReader Get(TransactionContext tc, ID nID)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM Punishment WHERE PunishmentID=%n", nID.Integer);
|
|
}
|
|
|
|
|
|
internal static IDataReader Get(TransactionContext tc)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM Punishment");
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Delete function
|
|
|
|
internal static void Delete(TransactionContext tc, ID nID)
|
|
{
|
|
tc.ExecuteNonQuery("DELETE FROM [Punishment] WHERE PunishmentID=%n", nID.Integer);
|
|
}
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
#endregion
|
|
}
|