using HRM.BO; using Ease.Core.DataAccess; using System; using System.Data; namespace HRM.DA { class AssesmentValueDetailsDA { internal static IDataReader GetByAssesmentValueID(TransactionContext tc, int ValueID) { return tc.ExecuteReader("SELECT * FROM AssesmentValueDetails avd WHERE AVD.AssesmentValueID= = %n", ValueID); } internal static IDataReader Get(TransactionContext tc, int id) { return tc.ExecuteReader("Select * From AssesmentValueDetails Where AssesmentValueDetailsID = %n", id); } internal static void Insert(TransactionContext tc, AssesmentValueDetails item) { string sql = SQLParser.MakeSQL( "Insert Into AssesmentValueDetails(AssesmentValueDetailsID,AssesmentValueID,Description,CreatedBy,CreatedDate,Status) Values(%n,%n,%s,%n,%d,%n)", item.ID, item.ValueID, item.Description, item.CreatedBy, item.CreatedDate, item.Status); tc.ExecuteNonQuery(sql); } internal static void Update(TransactionContext tc, AssesmentValueDetails item) { tc.ExecuteNonQuery( "Update AssesmentValueDetails Set AssesmentValueID = %n,Description = %s , ModifiedBy = %n, ModifiedDate = %d, Status = %n Where AssesmentValueDetailsID = %n", item.ValueID, item.Description, item.ModifiedBy, item.ModifiedDate, (int)item.Status, item.ID); } internal static void Delete(TransactionContext tc, int id) { tc.ExecuteNonQuery("Delete From AssesmentValueDetails Where AssesmentValueDetailsID = %n", id); } internal static IDataReader Get(TransactionContext tc, EnumStatus status) { if (status == EnumStatus.Regardless) return tc.ExecuteReader("Select * From AssesmentValueDetails"); else { return tc.ExecuteReader("Select * From AssesmentValueDetails Where Status = %n", status); } } } }