EchoTex_Payroll/HRM.DA/DA/Survey/SurveyQuestionDA.cs
2024-10-14 10:01:49 +06:00

72 lines
1.9 KiB
C#

using HRM.BO;
using Ease.Core.DataAccess;
using System;
using System.Collections.Generic;
using System.Data;
namespace HRM.DA
{
internal class SurveyQuestionDA
{
#region Constructor
private SurveyQuestionDA()
{
}
#endregion
#region Insert function
internal static void Insert(TransactionContext tc, SurveyQuestion item)
{
tc.ExecuteNonQuery("INSERT INTO SurveyQuestion(SurveyID, QuestionID)" +
" VALUES(%n, %n)", item.SurveyID, item.QuestionID);
}
#endregion
#region Update function
internal static void Update(TransactionContext tc, SurveyQuestion item)
{
tc.ExecuteNonQuery("UPDATE SurveyQuestion SET QuestionID=%n" +
" WHERE SurveyID=%n", item.QuestionID, item.SurveyID);
}
#endregion
#region Get Function
public static IDataReader GetSurveyQuestion(TransactionContext tc, int nSurveyId)
{
return tc.ExecuteReader("SELECT * FROM SurveyQuestion WHERE SurveyId=%n", nSurveyId);
}
public static IDataReader GetSurveyQuestions(TransactionContext tc, string nSurveyIds)
{
return tc.ExecuteReader("SELECT * FROM SurveyQuestion WHERE SurveyId in (%q)", nSurveyIds);
}
public static IDataReader GetSurveyQuestion(TransactionContext tc)
{
return tc.ExecuteReader("SELECT * FROM SurveyQuestion");
}
#endregion
#region Delete function
internal static void Delete(TransactionContext tc, int nID)
{
tc.ExecuteNonQuery("DELETE FROM SurveyQuestion WHERE SurveyID=%n", nID);
}
public static void DeleteSurveyQuestion(TransactionContext tc, int nSurveyId)
{
tc.ExecuteNonQuery("DELETE FROM SurveyQuestion WHERE SurveyId=%n", nSurveyId);
}
#endregion
}
}