using HRM.BO; using Ease.Core.DataAccess; using System; using System.Data; namespace HRM.DA { #region EmpDirectorListDA internal class EmpDirectorListDA { #region Constructor private EmpDirectorListDA() { } #endregion #region Insert function internal static void Insert(TransactionContext tc, EmpDirectorList item) { tc.ExecuteNonQuery("INSERT INTO EmpDirectorList(EmpDirectorListID, EmployeeNo, DirectorNo)" + " VALUES(%n, %s, %s)", item.ID, item.EmployeeNo, item.DirectorNo); } #endregion #region Update function internal static void Update(TransactionContext tc, EmpDirectorList item) { tc.ExecuteNonQuery("UPDATE EmpDirectorList SET EmployeeNo=%s, DirectorNo=%s" + "WHERE EmpDirectorListID=%n", item.EmployeeNo, item.DirectorNo, item.ID); } #endregion #region Get Function internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM EmpDirectorList Order By EmployeeNo"); } internal static IDataReader Get(TransactionContext tc, string sEmpNo) { return tc.ExecuteReader("SELECT * FROM EmpDirectorList where DirectorNo=%s ", sEmpNo); } #endregion #region Delete function internal static void Delete(TransactionContext tc, int nID) { tc.ExecuteNonQuery("DELETE FROM [EmpDirectorList] Where EmpDirectorListID=%n", nID); } internal static void Delete(TransactionContext tc, string sEmpNo) { tc.ExecuteNonQuery("DELETE FROM [EmpDirectorList] Where EmployeeNo=%s", sEmpNo); } #endregion } #endregion }