using System; using System.Data; using Ease.Core.DataAccess; using HRM.BO; namespace HRM.DA { #region SkilLevelDA internal class SkillLevelDA { #region Constructor private SkillLevelDA() { } #endregion #region Insert function internal static void Insert(TransactionContext tc, SkillLevel item) { //SkillPoint tc.ExecuteNonQuery( "INSERT INTO SkillLevel(SkillLevelID, Code, Name,CreatedBy, CreationDate, SequenceNo,Status)" + " VALUES(%n, %s, %s,%n, %d, %n,%n)", item.ID, item.Code, item.Name, item.CreatedBy, item.CreatedDate, item.Sequence, item.Status); } #endregion #region Update function internal static void Update(TransactionContext tc, SkillLevel item) { tc.ExecuteNonQuery( "UPDATE SkillLevel SET Code=%s, Name=%s,ModifiedBy=%n, ModifiedDate=%d, SequenceNo=%n, Status=%n" + "WHERE SkillLevelID=%n", item.Code, item.Name, item.ModifiedBy, item.ModifiedDate, item.Sequence, item.Status, item.ID); } #endregion #region Delete function internal static void Delete(TransactionContext tc, int nID) { tc.ExecuteNonQuery("DELETE FROM SkillLevel Where SkillLevelID=%n", nID); } #endregion #region Get Function internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM SkillLevel Order By SequenceNo"); } internal static IDataReader Get(TransactionContext tc, int nID) { return tc.ExecuteReader("SELECT * FROM SkillLevel Where SkillLevelID=%n", nID); } internal static IDataReader Get(TransactionContext tc, EnumStatus status) { if (EnumStatus.Active == status) { return tc.ExecuteReader("SELECT * FROM SkillLevel Where Status=%n Order By SequenceNo", status); } else { return tc.ExecuteReader("SELECT * FROM SkillLevel Order By SequenceNo"); } } //internal static IDataReader GetChilds(TransactionContext tc, int parentID) //{ // return tc.ExecuteReader("SELECT * FROM SkillLevel Where ParentID=%n", parentID); //} #endregion internal static bool IsExists(TransactionContext tc, string Code) { Object obj = tc.ExecuteScalar("Select Count(*) From SkillLevel where Code = %s", Code); return Convert.ToInt32(obj) > 0; } } #endregion }