using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using Ease.CoreV35.DataAccess; using Ease.CoreV35.Model; using Payroll.BO; namespace Payroll.Service { [Serializable] internal static class BudgetIndivisualChangeDA { public static IDataReader Get(TransactionContext tc, ID nID) { return tc.ExecuteReader("Select * from BudgetIndivisualChange where BudgetIndivisualChangeID=%n", nID.Integer); } public static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("Select * from BudgetIndivisualChange"); } public static IDataReader Get(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.Integer, item.BudgetID.Integer, (int)item.ButGetIndvChangeType, item.EffectDate, item.EmployeeID.Integer,DataReader.GetNullValue(item.Value,IDType.Integer), 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.Integer, item.ButGetIndvChangeType, item.EffectDate, item.EmployeeID.Integer, item.Value.Integer, item.ChangedBasic, item.ValueType, item.ID.Integer); } public static void Delete(TransactionContext tc, ID nID) { tc.ExecuteNonQuery("Delete from BudgetIndivisualChange where BudgetIndivisualChangeID=%n", nID.Integer); } } }