68 lines
3.7 KiB
C#
68 lines
3.7 KiB
C#
using HRM.BO;
|
|
using Ease.Core.DataAccess;
|
|
using System;
|
|
using System.Data;
|
|
|
|
|
|
namespace HRM.DA
|
|
{
|
|
public class ObjectiveSetRemarksDA
|
|
{
|
|
internal static IDataReader Get(TransactionContext tc)
|
|
{
|
|
string sql = SQLParser.MakeSQL("SELECT * FROM ObjectiveSetRemarks");
|
|
return tc.ExecuteReader(sql);
|
|
}
|
|
|
|
internal static IDataReader GetByPMPYear(TransactionContext tc, int iD, string sEmpIDs)
|
|
{
|
|
string sql =
|
|
SQLParser.MakeSQL(
|
|
"select * from ObjectiveSetRemarks where objectivesetid in(select objectivesetid from objectiveset where pmpyearid=%n and Employeeid in(%q))",
|
|
iD, sEmpIDs);
|
|
return tc.ExecuteReader(sql);
|
|
}
|
|
|
|
internal static IDataReader Get(TransactionContext tc, int id)
|
|
{
|
|
string sql = SQLParser.MakeSQL("SELECT * FROM ObjectiveSetRemarks WHERE ObjectiveSetRemarksID = %n", id);
|
|
return tc.ExecuteReader(sql);
|
|
}
|
|
|
|
internal static void Save(TransactionContext tc, ObjectiveSetRemarks item)
|
|
{
|
|
string sql = SQLParser.MakeSQL(
|
|
"Insert Into ObjectiveSetRemarks(ObjectiveSetRemarksID, ObjectiveSetID, MidYearEmpRemarksOne, MidYearEmpRemarksTwo, MidYearLMRemarksOne, MidYearLMRemarksTwo, YearEndEmpRemarksOne, YearEndEmpRemarksTwo, YearEndLMRemarksOne, YearEndLMRemarksTwo, MidYearEmpRemarksDate, MidYearLMRemarksDate, YearEndEmpRemarksDate, YearEndLMRemarksDate) Values(%n, %n, %s, %s, %s, %s, %s, %s, %s, %s, %d, %d, %d, %d)",
|
|
DataReader.GetNullValue(item.ID), DataReader.GetNullValue(item.ObjectiveSetID),
|
|
item.MidYearEmpReviewOne, item.MidYearEmpReviewTwo, item.MidYearLMReviewOne, item.MidYearLMReviewTwo,
|
|
item.YearEndEmpReviewOne, item.YearEndEmpReviewTwo, item.YearEndLMReviewOne, item.YearEndLMReviewTwo,
|
|
DataReader.GetNullValue(item.MidYearEmpReviewDate), DataReader.GetNullValue(item.MidYearLMReviewDate),
|
|
DataReader.GetNullValue(item.YearEndEmpReviewDate), DataReader.GetNullValue(item.YearEndLMReviewDate));
|
|
tc.ExecuteNonQuery(sql);
|
|
}
|
|
|
|
internal static void Update(TransactionContext tc, ObjectiveSetRemarks item)
|
|
{
|
|
string sql = SQLParser.MakeSQL(
|
|
"Update ObjectiveSetRemarks Set ObjectiveSetID = %n, MidYearEmpRemarksOne = %s, MidYearEmpRemarksTwo = %s, MidYearLMRemarksOne = %s, MidYearLMRemarksTwo = %s, YearEndEmpRemarksOne = %s, YearEndEmpRemarksTwo = %s, YearEndLMRemarksOne = %s, YearEndLMRemarksTwo = %s, MidYearEmpRemarksDate = %d, MidYearLMRemarksDate = %d, YearEndEmpRemarksDate = %d, YearEndLMRemarksDate = %d Where ObjectiveSetRemarksID = %n",
|
|
item.ObjectiveSetID, item.MidYearEmpReviewOne, item.MidYearEmpReviewTwo, item.MidYearLMReviewOne,
|
|
item.MidYearLMReviewTwo, item.YearEndEmpReviewOne, item.YearEndEmpReviewTwo, item.YearEndLMReviewOne,
|
|
item.YearEndLMReviewTwo, DataReader.GetNullValue(item.MidYearEmpReviewDate),
|
|
DataReader.GetNullValue(item.MidYearLMReviewDate), DataReader.GetNullValue(item.YearEndEmpReviewDate),
|
|
DataReader.GetNullValue(item.YearEndLMReviewDate), item.ID);
|
|
tc.ExecuteNonQuery(sql);
|
|
}
|
|
|
|
internal static void Delete(TransactionContext tc, int id)
|
|
{
|
|
string sql = SQLParser.MakeSQL("Delete From ObjectiveSetRemarks Where ObjectiveSetRemarksID = %n", id);
|
|
tc.ExecuteNonQuery(sql);
|
|
}
|
|
|
|
internal static IDataReader GetByObjectiveSetID(TransactionContext tc, int sID)
|
|
{
|
|
string sql = SQLParser.MakeSQL("SELECT * FROM ObjectiveSetRemarks WHERE ObjectiveSetID = %n", sID);
|
|
return tc.ExecuteReader(sql);
|
|
}
|
|
}
|
|
} |