CEL_Payroll/Payroll.Service/PMP/DA/PMPValueBehaviorDA.cs
2024-09-17 14:30:13 +06:00

47 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Ease.CoreV35.DataAccess;
using Payroll.BO;
using Ease.CoreV35.Model;
namespace Payroll.Service
{
public class PMPValueBehaviorDA
{
internal static IDataReader Get(TransactionContext tc, EnumStatus status)
{
if (status == EnumStatus.Regardless)
return tc.ExecuteReader("Select * From PMP_ValueBehavior");
else
{
return tc.ExecuteReader("Select * From PMP_ValueBehavior Where Status = %n", status);
}
}
internal static void Insert(TransactionContext tc, PMPValueBehavior item)
{
tc.ExecuteNonQuery("Insert Into PMP_ValueBehavior(PMPValueBehaviorID,Name,CreatedBy,CreatedDate,Status,Sequence) Values(%n,%s,%n,%d,%n,%n)", item.ID.Integer, item.Name, item.CreatedBy.Integer, item.CreatedDate, item.Status, item.Sequence);
}
internal static void Update(TransactionContext tc, PMPValueBehavior item)
{
tc.ExecuteNonQuery("Update PMP_ValueBehavior Set Name = %s, ModifiedBy = %n, ModifiedDate = %d, Status = %n , Sequence = %n Where PMPValueBehaviorID = %n", item.Name, item.ModifiedBy.Integer, item.ModifiedDate, item.Status, item.Sequence, item.ID.Integer);
}
internal static void Delete(TransactionContext tc,ID id)
{
tc.ExecuteNonQuery("Delete From PMP_ValueBehavior Where PMPValueBehaviorID = %n", id.Integer);
}
internal static IDataReader Get(TransactionContext tc, ID id)
{
return tc.ExecuteReader("Select * From PMP_ValueBehavior Where PMPValueBehaviorID = %n", id.Integer);
}
}
}