EchoTex_Payroll/HRM.DA/DA/PMP/CalibrationAudianceDA.cs
2024-10-14 10:01:49 +06:00

71 lines
2.5 KiB
C#

using System;
using System.Data;
using Ease.Core.DataAccess;
using HRM.BO;
using static iTextSharp.text.pdf.AcroFields;
namespace HRM.DA
{
public class CalibrationAudianceDA
{
#region Insert function
internal static void Insert(TransactionContext tc, CalibrationAudiance oItem)
{
tc.ExecuteNonQuery(
"INSERT INTO CalibrationAudiance(CalibrationAudianceID, CalibrationId, EmployeeId, CreatedBy, CreatedDate, ModifiedBy, ModifiedDate)" +
" VALUES(%n, %n, %n, %n, %d, %n, %d)", oItem.ID, oItem.CalibrationId, oItem.EmployeeId,
DataReader.GetNullValue(oItem.CreatedBy), DataReader.GetNullValue(oItem.CreatedDate), DataReader.GetNullValue(oItem.ModifiedBy), DataReader.GetNullValue(oItem.ModifiedDate));
}
#endregion
#region Update function
internal static void Update(TransactionContext tc, CalibrationAudiance item)
{
string sql = SQLParser.MakeSQL("Update CalibrationAudiance Set CalibrationId = %n, EmployeeId = %n, ModifiedBy = %n, ModifiedDate = %d " +
"where CalibrationAudianceId=%n", item.CalibrationId, item.EmployeeId, DataReader.GetNullValue(item.ModifiedBy), DataReader.GetNullValue(item.ModifiedDate)
,item.ID);
tc.ExecuteNonQuery(sql);
}
#endregion
#region Get Function
internal static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("SELECT * FROM CalibrationAudiance");
}
internal static IDataReader Get(TransactionContext tc, int nID)
{
return tc.ExecuteReader("SELECT * FROM CalibrationAudiance WHERE CalibrationAudianceID =%n", nID);
}
internal static IDataReader GetByCalibrationID(TransactionContext tc, int CalibrationID)
{
return tc.ExecuteReader("SELECT * FROM CalibrationAudiance Where CalibrationID=%n", CalibrationID);
}
#endregion
#region Delete function
internal static void Delete(TransactionContext tc, int nID)
{
tc.ExecuteNonQuery("DELETE FROM CalibrationAudiance WHERE CalibrationAudianceID=%n", nID);
}
internal static void DeleteByCalibrationId(TransactionContext tc, int calibrationid)
{
tc.ExecuteNonQuery("DELETE FROM CalibrationAudiance WHERE CalibrationId=%n", calibrationid);
}
#endregion
}
}