67 lines
1.9 KiB
C#
67 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 SurveyWeightDefinitionDA
|
|
{
|
|
#region Constructor
|
|
|
|
private SurveyWeightDefinitionDA()
|
|
{
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Insert function
|
|
|
|
internal static void Insert(TransactionContext tc, SurveyWeightDefinition item)
|
|
{
|
|
tc.ExecuteNonQuery("INSERT INTO SurveyWeightDefinition(SurveyID, FromWeight,ToWeight,Remark)" +
|
|
" VALUES(%n, %n,%n,%s)", item.SurveyID, item.FromWeight, item.ToWeight, item.Remark);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Update function
|
|
|
|
internal static void Update(TransactionContext tc, SurveyWeightDefinition item)
|
|
{
|
|
tc.ExecuteNonQuery("UPDATE SurveyWeightDefinition SET FromWeight=%n,ToWeight=%n,Remark=%s" +
|
|
" WHERE SurveyID=%n", item.FromWeight, item.ToWeight, item.Remark, item.SurveyID);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Get Function
|
|
|
|
public static IDataReader GetSurveyWeightDefinition(TransactionContext tc, int nSurveyId)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM SurveyWeightDefinition WHERE SurveyId=%n", nSurveyId);
|
|
}
|
|
|
|
public static IDataReader GetSurveyWeightDefinition(TransactionContext tc)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM SurveyWeightDefinition");
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Delete function
|
|
|
|
internal static void Delete(TransactionContext tc, int nID)
|
|
{
|
|
tc.ExecuteNonQuery("DELETE FROM SurveyWeightDefinition WHERE SurveyID=%n", nID);
|
|
}
|
|
|
|
public static void DeleteSurveyWeightDefinition(TransactionContext tc, int nSurveyId)
|
|
{
|
|
tc.ExecuteNonQuery("DELETE FROM SurveyWeightDefinition WHERE SurveyId=%n", nSurveyId);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |