EchoTex_Payroll/HRM.DA/DA/SearchTools/ObjectGroupingDA.cs

59 lines
1.6 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.Data;
using System.Text;
namespace HRM.DA
{
internal class ObjectGroupingDA
{
#region Constructor
private ObjectGroupingDA()
{
}
#endregion
#region Action Query
internal static void Insert(TransactionContext tc, ObjectGrouping g)
{
tc.ExecuteNonQuery("INSERT INTO ObjectGrouping(ObjectGroupingID, Name)"
+ " VALUES(%n, %s)", g.ID, g.Name);
}
internal static void Update(TransactionContext tc, ObjectGrouping g)
{
tc.ExecuteNonQuery("UPDATE ObjectGrouping SET Name=%s"
+ " WHERE ObjectGroupingID=%n", g.Name, g.ID);
}
internal static void Delete(TransactionContext tc, int objectGroupingID)
{
tc.ExecuteNonQuery("DELETE FROM ObjectGrouping WHERE ObjectGroupingID=%n", objectGroupingID);
}
#endregion
#region Select Query
internal static int GenID(TransactionContext tc)
{
return tc.GenerateID("ObjectGrouping", "ObjectGroupingID");
}
internal static IDataReader Get(TransactionContext tc, int objectGroupingID)
{
return tc.ExecuteReader("SELECT * FROM ObjectGrouping WHERE ObjectGroupingID=%n", objectGroupingID);
}
internal static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("SELECT * FROM ObjectGrouping ORDER BY Name");
}
#endregion
}
}