using System; using System.Collections.Generic; using System.Linq; using System.Text; using Payroll.BO; using System.Data; using Ease.CoreV35.Model; using System.Data.SqlClient; using Ease.CoreV35.DataAccess; using Ease.CoreV35.DataAccess.SQL; namespace Payroll.Service { 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.Integer, 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.Integer); } #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 GetSurveyQuestion(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM SurveyQuestion"); } #endregion #region Delete function internal static void Delete(TransactionContext tc, ID nID) { tc.ExecuteNonQuery("DELETE FROM [SurveyQuestion] WHERE SurveyID=%n", nID.Integer); } public static void DeleteSurveyQuestion(TransactionContext tc, int nSurveyId) { tc.ExecuteNonQuery("DELETE FROM [SurveyQuestion] WHERE SurveyId=%n", nSurveyId); } #endregion } }