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

49 lines
1.8 KiB
C#

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