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

86 lines
2.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ease.CoreV35.DataAccess;
using System.Data;
using HRM.BO;
using Ease.Core.DataAccess;
namespace HRM.DA
{
#region OutsideDutyDA
internal class OutsideDutyDA
{
#region Constructor
private OutsideDutyDA()
{
}
#endregion
#region Insert function
internal static void Insert(TransactionContext tc, OutsideDuty item)
{
tc.ExecuteNonQuery(
"INSERT INTO OutsideDuty(OutsideDutyID, Name, SequenceNo, Status, CreatedBy, CreatedDate)" +
" VALUES(%n, %s, %n, %n, %n, %D)", item.ID, item.Name, item.Sequence, item.Status, item.CreatedBy,
item.CreatedDate);
}
#endregion
#region Update function
internal static void Update(TransactionContext tc, OutsideDuty item)
{
tc.ExecuteNonQuery(
"UPDATE OutsideDuty SET Name=%s, ModifiedBy=%n, ModifiedDate=%d, SequenceNo=%n, Status=%n" +
" WHERE OutsideDutyID=%n", item.Name, item.ModifiedBy, item.ModifiedDate, item.Sequence, item.Status,
item.ID);
}
#endregion
#region Get Function
internal static IDataReader Get(TransactionContext tc, EnumStatus status)
{
if (EnumStatus.Active == status)
{
return tc.ExecuteReader("SELECT * FROM OutsideDuty where Status=%n Order By SequenceNo", status);
}
else
{
return tc.ExecuteReader("SELECT * FROM OutsideDuty Order By SequenceNo");
}
//return tc.ExecuteReader("SELECT * FROM OutsideDuty Where Status=%n Order By SequenceNo", status);
}
internal static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("SELECT * FROM OutsideDuty");
}
internal static IDataReader Get(TransactionContext tc, int nID)
{
return tc.ExecuteReader("SELECT * FROM OutsideDuty WHERE OutsideDutyID=%n", nID);
}
#endregion
#region Delete function
internal static void Delete(TransactionContext tc, int nID)
{
tc.ExecuteNonQuery("DELETE FROM OutsideDuty WHERE OutsideDutyID=%n", nID);
}
#endregion
}
#endregion
}