using HRM.BO; using Ease.Core.DataAccess; using System; using System.Data; namespace HRM.DA { #region DirectorListDA internal class DirectorListDA { #region Constructor private DirectorListDA() { } #endregion #region Insert function internal static void Insert(TransactionContext tc, DirectorList item) { tc.ExecuteNonQuery("INSERT INTO DirectorList(DirectorListID, EmployeeNo,SequenceNo, Status,ProjectID)" + " VALUES(%n, %s, %n,%n,%n)", item.ID, item.EmployeeNo, item.Sequence, item.Status, item.ProjectID); } #endregion #region Update function internal static void Update(TransactionContext tc, DirectorList item) { tc.ExecuteNonQuery("UPDATE DirectorList SET EmployeeNo=%s, SequenceNo=%n, Status=%n" + "WHERE DirectorListID=%n", item.EmployeeNo, item.Sequence, item.Status, item.ID); } #endregion #region Get Function internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM DirectorList Order By EmployeeNo"); } internal static IDataReader Get(TransactionContext tc, EnumStatus status) { if (EnumStatus.Active == status || EnumStatus.Inactive == status) { return tc.ExecuteReader("SELECT * FROM DirectorList where Status=%n order by SequenceNO", status); } else { return tc.ExecuteReader("SELECT * FROM DirectorList order by SequenceNO"); } } internal static IDataReader Get(TransactionContext tc, string sEmpNo) { return tc.ExecuteReader("SELECT * FROM DirectorList where EmployeeNo=%s ", sEmpNo); } #endregion #region Delete function internal static void Delete(TransactionContext tc, int nID) { tc.ExecuteNonQuery("DELETE FROM [DirectorList] Where DirectorListID=%n", nID); } internal static void Delete(TransactionContext tc, string sEmpNo) { tc.ExecuteNonQuery("DELETE FROM [DirectorList] Where EmployeeNo=%s", sEmpNo); } #endregion } #endregion }