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

52 lines
2.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Ease.CoreV35.DataAccess;
using Ease.CoreV35.Model;
using Payroll.BO;
namespace Payroll.Service
{
public class RecruitementSelectedCandidateDA
{
internal static IDataReader GetAllSelectedCandidates(ID processID, ID stepID, TransactionContext tc)
{
string sql = SQLParser.MakeSQL(@"Select * From RecruitementSelectedCandidate Where processID = %n And stepID = %n",processID.Integer,stepID.Integer);
return tc.ExecuteReader(sql);
}
internal static void Delete(ID stepID, ID processID, TransactionContext tc)
{
string sql =
SQLParser.MakeSQL(@"Delete From RecruitementSelectedCandidate Where processID = %n And stepID = %n",processID.Integer,stepID.Integer);
tc.ExecuteNonQuery(sql);
}
internal static void Insert(SelectedCandidate item, TransactionContext tc)
{
string sql = SQLParser.MakeSQL(@"Insert Into RecruitementSelectedCandidate(RecruitementSelectedCandidateID,processID,stepID,candidateID,isEmployee,isSelected) Values(%n,%n,%n,%n,%n,%n)", item.ID.Integer, item.ProcessId.Integer, item.StepId.Integer, item.CandidateId.Integer, Convert.ToInt32(item.IsEmployee),Convert.ToInt32(item.IsSelected));
tc.ExecuteNonQuery(sql);
}
internal static IDataReader GetAllSelectedCandidates(ID processID, ID stepID, bool flag, TransactionContext tc)
{
string sql;
if(flag)
sql = SQLParser.MakeSQL(@"Select * From RecruitementSelectedCandidate Where processID = %n And stepID = %n And isSelected = 1", processID.Integer, stepID.Integer);
else sql = SQLParser.MakeSQL(@"Select * From RecruitementSelectedCandidate Where processID = %n And stepID = %n", processID.Integer, stepID.Integer);
return tc.ExecuteReader(sql);
}
internal static void Delete(ID processID, ID canID, bool p, TransactionContext tc)
{
string sql =
SQLParser.MakeSQL(
@"Delete From RecruitementSelectedCandidate Where processID = %n And candidateID = %n And isEmployee = %n",
processID.Integer, canID.Integer, Convert.ToInt32(p));
tc.ExecuteNonQuery(sql);
}
}
}