using HRM.BO; using Ease.Core.DataAccess; using System; using System.Data; namespace HRM.DA { internal static class BudgetIndivisualChangeDA { public static IDataReader Get(TransactionContext tc, int nID) { return tc.ExecuteReader("Select * from BudgetIndivisualChange where BudgetIndivisualChangeID=%n", nID); } public static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("Select * from BudgetIndivisualChange"); } public static IDataReader GetByBudgetId(TransactionContext tc, int nID) { return tc.ExecuteReader("Select * from BudgetIndivisualChange where BudgetID=%n", nID); } public static void Insert(TransactionContext tc, BudgetIndivisualChange item) { tc.ExecuteNonQuery( "Insert into BudgetIndivisualChange(BudgetIndivisualChangeID,BudgetID,ButGetIndvChangeType,EffectDate,EmployeeID,Value,ChangedBasic,ValueType) Values" + "(%n,%n,%n,%d,%n,%n,%n,%n)", item.ID, item.BudgetID, (int)item.ButGetIndvChangeType, item.EffectDate, item.EmployeeID, DataReader.GetNullValue(item.Value), item.ChangedBasic, (int)item.ValueType); } public static void Update(TransactionContext tc, BudgetIndivisualChange item) { tc.ExecuteNonQuery( "Update BudgetIndivisualChange SET BudgetID=%n,ButGetIndvChangeType=%n,EffectDate=%d,EmployeeID=%n,Value=%n,ChangedBasic=%n,ValueType=%n" + "Where BudgetIndivisualChangeID=%n", item.BudgetID, item.ButGetIndvChangeType, item.EffectDate, item.EmployeeID, item.Value, item.ChangedBasic, item.ValueType, item.ID); } public static void Delete(TransactionContext tc, int nID) { tc.ExecuteNonQuery("Delete from BudgetIndivisualChange where BudgetIndivisualChangeID=%n", nID); } } }