EchoTex_Payroll/HRM.DA/Service/Basic/JobDefinitionDA.cs
2024-10-14 10:01:49 +06:00

126 lines
6.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using Ease.Core.DataAccess;
using HRM.BO.Basic;
namespace HRM.DA.Service.Basic
{
public class JobDefinitionDA
{
public JobDefinitionDA()
{
}
internal static void InsertJD(TransactionContext tc, JobDefinition item)
{
string sql = SQLParser.MakeSQL(
@"INSERT INTO dbo.JobDefinition (JdId, JdNo, JdName, RevisionDate, DepartmentId, DesignationId, GradeId, Purpose, FinancialInformation, TeamInformation, LMDesignationId, InternalComm, ExternalComm, ExperienceMinYear, ExperienceMaxYear, KnowledgeUnderstanding, AdherenceToCompany, ApprovedBy, ApprovedDate, ApprovarRemarks)
VALUES (%n, %n, %s, %d, %n, %n, %n, %s, %s, %s, %n, %s, %s, %n, %n, %s, %s, %n, %d, %s)", item.ID,
item.JdNo,
item.JdName, item.ApproveDate, item.DepartmentId, item.DesignationId, item.GradeId, item.Purpose,
item.FinancialInformation, item.TeamInformation, item.InternalComm,
item.ExternalComm, item.ExperienceMinYear, item.ExperienceMaxYear, item.KnowledgeUnderstanding,
item.AdherenceToCompany, item.ApprovedBy, item.ApproveDate, item.ApprovarRemarks);
tc.ExecuteNonQuery(sql);
}
internal static void UpdateJD(TransactionContext tc, JobDefinition item)
{
string sql = SQLParser.MakeSQL(@"UPDATE dbo.JobDefinition
SET JdNo=%n,
JdName = %s,
RevisionDate = %d,
DepartmentId = %n,
DesignationId = %n,
GradeId = %n,
Purpose = %s,
FinancialInformation = %s,
TeamInformation = %s,
InternalComm = %s,
ExternalComm = %s,
ExperienceMinYear = %n,
ExperienceMaxYear = %n,
KnowledgeUnderstanding = %s,
AdherenceToCompany = %s,
ApprovedBy = %n,
ApprovedDate = %d,
ApprovarRemarks = %s
WHERE JdId = %n", item.JdNo, item.JdName, item.ApproveDate,
item.DepartmentId,
item.DesignationId, item.GradeId, item.Purpose,
item.FinancialInformation, item.TeamInformation, item.InternalComm,
item.ExternalComm, item.ExperienceMinYear, item.ExperienceMaxYear, item.KnowledgeUnderstanding,
item.AdherenceToCompany, item.ApprovedBy, item.ApproveDate, item.ApprovarRemarks, item.ID);
tc.ExecuteNonQuery(sql);
}
internal static void InsertJDEducation(TransactionContext tc, JDEducation item)
{
string sql = SQLParser.MakeSQL(
@"INSERT INTO dbo.JDEducation (JdEducationId, JdId, ReferenceId, JdEducationName, remarks)
VALUES (%n, %n, %n, %s, %s)", item.ID, item.JdId, item.ReferenceId, item.JdEducationName,
item.Remarks);
tc.ExecuteNonQuery(sql);
}
internal static void InsertJDCertification(TransactionContext tc, JDCertification item)
{
string sql = SQLParser.MakeSQL(
@"INSERT INTO dbo.JDCertification (JDCertificationId, JdId, ReferenceId, JdCertificationName, remarks)
VALUES (%n, %n, %n, %s, %s)", item.ID, item.JdId, item.ReferenceId, item.JdCertificationName,
item.Remarks);
tc.ExecuteNonQuery(sql);
}
internal static void InsertJDResponsibility(TransactionContext tc, JDResponsibility item)
{
string sql = SQLParser.MakeSQL(
@"INSERT INTO dbo.JdResponsibility (JdResponsibilityId, JdId, Name, Description, TimeSpentPercent, MeasurementCriteria)
VALUES (%n, %n, %s, %s, %n, %s)", item.ID, item.JdId, item.Name, item.Description,
item.TimeSpentPercent, item.MeasurementCriteria);
tc.ExecuteNonQuery(sql);
}
internal static void DeleteJDEducation(TransactionContext tc, int id)
{
string sql = SQLParser.MakeSQL(@"Delete from JDEducation where JdId=%n", id);
tc.ExecuteNonQuery(sql);
}
internal static void DeleteJDResponsibility(TransactionContext tc, int id)
{
string sql = SQLParser.MakeSQL(@"Delete from JdResponsibility where JdId=%n", id);
tc.ExecuteNonQuery(sql);
}
internal static void DeleteJDCertification(TransactionContext tc, int id)
{
string sql = SQLParser.MakeSQL(@"Delete from JDCertification where JdId=%n", id);
tc.ExecuteNonQuery(sql);
}
internal static void DeleteJobDefinition(TransactionContext tc, int id)
{
string sql = SQLParser.MakeSQL(@"Delete from JobDefinition where JdId=%n", id);
tc.ExecuteNonQuery(sql);
}
internal static IDataReader GetAllJobDefinition(TransactionContext tc)
{
string sql = SQLParser.MakeSQL(@"select * from JobDefinition");
return tc.ExecuteReader(sql);
}
internal static IDataReader GetJDEducation(TransactionContext tc, int id)
{
string sql = SQLParser.MakeSQL(@"select * from JDEducation where JdId=%n", id);
return tc.ExecuteReader(sql);
}
internal static IDataReader GetJDResponsibility(TransactionContext tc, int id)
{
string sql = SQLParser.MakeSQL(@"select * from JdResponsibility where JdId=%n", id);
return tc.ExecuteReader(sql);
}
}
}