81 lines
2.3 KiB
C#
81 lines
2.3 KiB
C#
|
using HRM.BO;
|
|||
|
using Ease.Core.DataAccess;
|
|||
|
using System.Data;
|
|||
|
|
|||
|
namespace HRM.DA
|
|||
|
{
|
|||
|
internal class OtherTalentDA
|
|||
|
{
|
|||
|
#region constructor
|
|||
|
|
|||
|
public OtherTalentDA()
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region insert function
|
|||
|
|
|||
|
internal static void Insert(TransactionContext tc, OtherTalent item)
|
|||
|
{
|
|||
|
tc.ExecuteNonQuery(
|
|||
|
"INSERT INTO OTHERTALENT(OTHERTALENTID, CODE, DESCRIPTION, SEQUENCENO, STATUS, CREATEDBY, CREATIONDATE)"
|
|||
|
+ "VALUES(%n, %s, %s, %n, %n, %n, %d)", item.ID, item.Code, item.Description, item.Sequence,
|
|||
|
item.Status, item.CreatedBy, item.CreatedDate);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region update function
|
|||
|
|
|||
|
internal static void Update(TransactionContext tc, OtherTalent item)
|
|||
|
{
|
|||
|
tc.ExecuteNonQuery(
|
|||
|
"UPDATE OTHERTALENT SET code=%s, description=%s, sequencenO=%n, status=%n, modifiedby=%n, modifieddate=%d"
|
|||
|
+ "WHERE OTHERTALENTID=%n", item.Code, item.Description, item.Sequence, item.Status, item.ModifiedBy,
|
|||
|
item.ModifiedDate, item.ID);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region get functions
|
|||
|
|
|||
|
internal static IDataReader Get(TransactionContext tc)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM OTHERTALENT");
|
|||
|
}
|
|||
|
|
|||
|
internal static IDataReader Get(TransactionContext tc, EnumStatus status)
|
|||
|
{
|
|||
|
if (EnumStatus.Active == status)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM OTHERTALENT Where Status=%n Order By SequenceNo", status);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM OTHERTALENT Order By SequenceNo");
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
internal static IDataReader Get(TransactionContext tc, int nID)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT *FROM OTHERTALENT WHERE OTHERTALENTID=%n", nID);
|
|||
|
}
|
|||
|
|
|||
|
internal static IDataReader Get(TransactionContext tc, string sCode)
|
|||
|
{
|
|||
|
return tc.ExecuteReader("SELECT * FROM OTHERTALENT WHERE code=%s", sCode);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region delete function
|
|||
|
|
|||
|
internal static void Delete(TransactionContext tc, int nID)
|
|||
|
{
|
|||
|
tc.ExecuteNonQuery("DELETE FROM OTHERTALENT WHERE OTHERTALENTID=%n", nID);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|
|||
|
}
|