EchoTex_Payroll/HRM.DA/DA/Survey/SurveyOrganizationDA.cs

88 lines
2.7 KiB
C#
Raw Permalink Normal View History

2024-10-14 10:01:49 +06:00
using HRM.BO;
using Ease.Core.DataAccess;
using System;
using System.Collections.Generic;
using System.Data;
namespace HRM.DA
{
internal class SurveyOrganizationDA
{
#region Constructor
private SurveyOrganizationDA()
{
}
#endregion
#region Insert function
internal static void Insert(TransactionContext tc, SurveyOrganization item)
{
tc.ExecuteNonQuery("INSERT INTO SurveyOrganization(SurveyID,GradeID,CompanyID,DepartmentID, LocationID)" +
" VALUES(%n, %n, %n, %n, %n)", item.SurveyID, DataReader.GetNullValue(item.GradeID, 0),
DataReader.GetNullValue(item.CompanyID, 0), DataReader.GetNullValue(item.DepartmentID, 0),
DataReader.GetNullValue(item.LocationID, 0));
}
#endregion
#region Update function
internal static void Update(TransactionContext tc, SurveyOrganization item)
{
tc.ExecuteNonQuery("UPDATE SurveyOrganization SET GradeID=%n,CompanyID=%n,DepartmentID=%n, LocationID=%n" +
" WHERE SurveyID=%n", item.GradeID, item.CompanyID, item.DepartmentID, item.LocationID,
item.SurveyID);
}
#endregion
#region Get Function
internal static IDataReader Get(TransactionContext tc, EnumStatus status)
{
if (EnumStatus.Active == status || EnumStatus.Inactive == status)
{
return tc.ExecuteReader("SELECT * FROM SurveyOrganization where Status=%n", status);
}
else
{
return tc.ExecuteReader("SELECT * FROM SurveyOrganization");
}
}
public static IDataReader GetSurveyOrganization(TransactionContext tc, int nSurveyId)
{
return tc.ExecuteReader("SELECT * FROM SurveyOrganization WHERE SurveyId=%n", nSurveyId);
}
internal static IDataReader Get(TransactionContext tc, int nID)
{
return tc.ExecuteReader("SELECT * FROM SurveyOrganization WHERE SurveyID=%n", nID);
}
internal static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("SELECT * FROM SurveyOrganization");
}
#endregion
#region Delete function
internal static void Delete(TransactionContext tc, int nID)
{
tc.ExecuteNonQuery("DELETE FROM SurveyOrganization WHERE SurveyID=%n", nID);
}
public static void DeleteSurveyOrganization(TransactionContext tc, int nSurveyId)
{
tc.ExecuteNonQuery("DELETE FROM SurveyOrganization WHERE SurveyId=%n", nSurveyId);
}
#endregion
}
}