61 lines
1.9 KiB
C#
61 lines
1.9 KiB
C#
using System;
|
|
using System.Data;
|
|
using Ease.Core.DataAccess;
|
|
using HRM.BO;
|
|
|
|
namespace HRM.DA
|
|
{
|
|
internal class HRJoiningQuestionaryDA
|
|
{
|
|
#region Get
|
|
|
|
public static IDataReader Get(TransactionContext tc, int nID)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM HRJoiningQuestionary WHERE QuestionaryID=%n", nID);
|
|
}
|
|
|
|
public static IDataReader Get(TransactionContext tc, EnumStatus status)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM HRJoiningQuestionary");
|
|
}
|
|
|
|
public static IDataReader GetByQuestionNo(TransactionContext tc, string sQuesNo)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM HRJoiningQuestionary Where QuestionNo=%s", sQuesNo);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Insert
|
|
|
|
public static void Insert(TransactionContext tc, HRJoiningQuestionary item)
|
|
{
|
|
tc.ExecuteNonQuery(
|
|
"Insert into HRJoiningQuestionary(QuestionaryID,QuestionIndex,IsPrimary,QuestionNo,Description,AnsDatatype) Values" +
|
|
"(%n,%n,%b,%s,%s,%n)", item.ID, item.QuestionIndex, item.IsPrimary, item.QuestionNo, item.Description,
|
|
item.AnsDatatype);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Update
|
|
|
|
public static void Update(TransactionContext tc, HRJoiningQuestionary item)
|
|
{
|
|
tc.ExecuteNonQuery(
|
|
"Update HRJoiningQuestionary Set QuestionIndex = %n,IsPrimary = %b,QuestionNo = %s,Description = %s,AnsDatatype = %n Where QuestionaryID = %n"
|
|
, item.QuestionIndex, item.IsPrimary, item.QuestionNo, item.Description, item.AnsDatatype, item.ID);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Delete
|
|
|
|
public static void Delete(TransactionContext tc, int id)
|
|
{
|
|
tc.ExecuteNonQuery("delete from HRJoiningQuestionary where QuestionaryID=%n", id);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |