74 lines
2.0 KiB
C#
74 lines
2.0 KiB
C#
|
using HRM.BO;
|
|||
|
using Ease.Core.DataAccess;
|
|||
|
using Ease.Core.Model;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Data;
|
|||
|
using System.Data.SqlClient;
|
|||
|
|
|||
|
namespace HRM.DA
|
|||
|
{
|
|||
|
internal class ReportAuthorizationDA
|
|||
|
{
|
|||
|
#region Constructor
|
|||
|
|
|||
|
private ReportAuthorizationDA()
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Insert function
|
|||
|
|
|||
|
internal static void Insert(TransactionContext tc, ReportAuthorization item)
|
|||
|
{
|
|||
|
string sSQL = SQLParser.MakeSQL("INSERT into REPORTAUTHORISATION(ReportID, PersonID, Position)" +
|
|||
|
" Values(%n, %n, %n) ", item.ReportID, item.AuthorizePersionId,
|
|||
|
item.Position);
|
|||
|
tc.ExecuteNonQuery(sSQL);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Update function
|
|||
|
|
|||
|
internal static void Update(TransactionContext tc, ReportAuthorization item)
|
|||
|
{
|
|||
|
string sSQL = SQLParser.MakeSQL(
|
|||
|
"UPDATE REPORTAUTHORISATION Set PersonID = %n, Position=%n Where ReportID = %n",
|
|||
|
item.AuthorizePersionId, item.Position, item.ReportID);
|
|||
|
tc.ExecuteNonQuery(sSQL);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Get Function
|
|||
|
|
|||
|
internal static IDataReader Get(TransactionContext tc)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM REPORTAUTHORISATION");
|
|||
|
}
|
|||
|
|
|||
|
internal static IDataReader Get(TransactionContext tc, int nID)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM REPORTAUTHORISATION Where ReportID = %n", nID);
|
|||
|
}
|
|||
|
|
|||
|
internal static IDataReader Get(TransactionContext tc, int nID, int psition)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM REPORTAUTHORISATION Where ReportID = %n AND Position=%n", nID,
|
|||
|
psition);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Delete Function
|
|||
|
|
|||
|
internal static void Delete(TransactionContext tc, int nID)
|
|||
|
{
|
|||
|
tc.ExecuteNonQuery("DELETE FROM REPORTAUTHORISATION WHERE ReportID=%n", nID);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|
|||
|
}
|