using HRM.BO; using Ease.Core.DataAccess; using System; using System.Data; namespace HRM.DA { internal static class BudgetGradeDA { public static IDataReader Get(TransactionContext tc, int nID) { return tc.ExecuteReader("Select * from BudgetGrade where BudgetGradeID=%n", nID); } public static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("Select * from BudgetGrade"); } public static IDataReader GetByBudgetId(TransactionContext tc, int nID) { return tc.ExecuteReader("Select * from BudgetGrade where BudgetID=%n", nID); } public static void Insert(TransactionContext tc, BudgetGrade item) { tc.ExecuteNonQuery( "Insert into BudgetGrade(BudgetGradeID,BudgetID,ChangedPercentage,FixedAmount,GradeID) Values" + "(%n,%n,%n,%n,%n)", item.ID, item.BudgetID, item.ChangedPercentage, item.FixedAmount, item.GradeID); } public static void Update(TransactionContext tc, BudgetGrade item) { tc.ExecuteNonQuery("Update BudgetGrade SET BudgetID=%n,ChangedPercentage=%n,FixedAmount=%n,GradeID=%n" + "Where BudgetGradeID=%n", item.BudgetID, item.ChangedPercentage, item.FixedAmount, item.GradeID, item.ID); } public static void Delete(TransactionContext tc, int nID) { tc.ExecuteNonQuery("Delete from BudgetGrade where BudgetGradeID=%n", nID); } } }