EchoTex_Payroll/HRM.DA/DA/PMP/ReviewRoleDA.cs

86 lines
3.2 KiB
C#
Raw Normal View History

2024-10-14 10:01:49 +06:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Ease.CoreV35.DataAccess;
using Ease.Core.DataAccess;
using HRM.BO;
namespace HRM.DA
{
public class ReviewRoleDA
{
#region Constructor
private ReviewRoleDA()
{
}
#endregion
#region Insert
internal static void Insert(TransactionContext tc, ReviewRole item)
{
tc.ExecuteNonQuery(
"INSERT INTO ReviewRole(ReviewRoleID, PMPYearID, GradeID, KPISelf,KPISupervisor,BehaviourSelf,BehaviourSupervisor,TechnicalSelf,TechnicalSupervisor,ValueSelf,"
+ " ValueSupervisor,DevelopmentSelf,DevelopmentSupervisor,PeerAppraisals,CreatedBy, CreationDate)" +
" VALUES(%n, %n, %n,%n, %n,%n,%n,%n,%n,%n,%n,%n,%n,%n, %n, %d)",
item.ID, item.PMPYearID, item.GradeID, item.KPISelf, item.KPISupervisor,
item.BehaviourSelf, item.BehaviourSupervisor, item.TechnicalSelf, item.TechnicalSupervisor,
item.ValueSelf, item.ValueSupervisor, item.DevelopmentSelf, item.DevelopmentSupervisor,
item.PeerAppraisal, item.CreatedBy, item.CreatedDate);
}
#endregion
#region Update
internal static void Update(TransactionContext tc, ReviewRole item)
{
tc.ExecuteNonQuery(
"UPDATE ReviewRole SET PMPYearID=%n, GradeID=%n, KPISelf = %n,KPISupervisor=%n,BehaviourSelf= %n,BehaviourSupervisor = %n,TechnicalSelf = %n,TechnicalSupervisor = %n,"
+ " ValueSelf = %n,ValueSupervisor = %n,DevelopmentSelf = %n,DevelopmentSupervisor = %n,PeerAppraisals = %n,ModifiedBy=%n, ModifiedDate=%d WHERE ReviewRoleID=%n)"
, item.PMPYearID, item.GradeID, item.KPISelf, item.KPISupervisor,
item.BehaviourSelf, item.BehaviourSupervisor, item.TechnicalSelf, item.TechnicalSupervisor,
item.ValueSelf, item.ValueSupervisor, item.DevelopmentSelf, item.DevelopmentSupervisor,
item.PeerAppraisal, item.ModifiedBy, item.ModifiedDate, item.ID);
}
#endregion
#region Get
internal static IDataReader GetByReviewRoleId(TransactionContext tc, int nID)
{
return tc.ExecuteReader("SELECT * FROM ReviewRole Where ReviewRoleID=%n", nID);
}
internal static IDataReader GetByPmpYearId(TransactionContext tc, int nPmpYearID)
{
return tc.ExecuteReader("SELECT * FROM ReviewRole where PMPYearID=%n", nPmpYearID);
}
internal static IDataReader GetWithGrade(TransactionContext tc, int nPmpYearID, int nGradeID)
{
return tc.ExecuteReader("SELECT * FROM ReviewRole where PMPYearID=%n And GradeID=%n", nPmpYearID, nGradeID);
}
#endregion
#region Delete
internal static void Delete(TransactionContext tc, int nID)
{
tc.ExecuteNonQuery("DELETE FROM ReviewRole Where ReviewRoleID=%n", nID);
}
internal static void DeleteWithYear(TransactionContext tc, int nPMPYearID)
{
tc.ExecuteNonQuery("DELETE FROM ReviewRole Where PMPYearID=%n", nPMPYearID);
}
#endregion
}
}