using System; using Payroll.BO; using System.Data; using System.Linq; using Ease.CoreV35.Model; using System.Data.SqlClient; using Ease.CoreV35.DataAccess; using System.Collections.Generic; using Ease.CoreV35.DataAccess.SQL; namespace Payroll.Service { #region JVSetupDetailDA public class JVSetupDetailDA { #region Constructor public JVSetupDetailDA() { } #endregion #region Insert function internal static void Insert(TransactionContext tc, JVSetupDetail oItem) { tc.ExecuteNonQuery("INSERT INTO JVSetupDetail(JVSetupDetailID, ItemID, JVItemType, JVSetupID, Name, CreatedBy, CreationDate)" + " VALUES(%n, %n, %n, %n, %s, %n, %d)", oItem.ID.Integer, oItem.ItemID.Integer, oItem.JVItemType, oItem.JVSetupID.Integer, oItem.Name, DataReader.GetNullValue(oItem.CreatedBy.Integer), DataReader.GetNullValue(oItem.CreatedDate)); } #endregion #region Update function internal static void Update(TransactionContext tc, JVSetupDetail oItem) { tc.ExecuteNonQuery("UPDATE JVSetupDetail SET ItemID=%n, JVItemType=%n, JVSetupID=%n, Name=%s, ModifiedBy=%n, ModifiedDate=%d" + " WHERE JVSetupDetailID=%n", oItem.ItemID.Integer, oItem.JVItemType, oItem.JVSetupID.Integer, oItem.Name, oItem.ID.Integer, DataReader.GetNullValue(oItem.ModifiedBy.Integer), DataReader.GetNullValue(oItem.ModifiedDate)); } #endregion #region Get Function internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM JVSetupDetail"); } internal static IDataReader Get(TransactionContext tc, ID nID) { return tc.ExecuteReader("SELECT * FROM JVSetupDetail WHERE JVSetupDetailID =%n", nID.Integer); } internal static IDataReader GetByJVSetup(TransactionContext tc, ID jvSetupID) { return tc.ExecuteReader("SELECT * FROM JVSetupDetail Where JVSetupID=%n", jvSetupID.Integer); } #endregion #region Delete function internal static void Delete(TransactionContext tc, ID nID) { tc.ExecuteNonQuery("DELETE FROM JVSetupDetail WHERE JVSetupDetailID=%n", nID.Integer); } internal static void DeleteByJVSetup(TransactionContext tc, ID nJVSetupID) { tc.ExecuteNonQuery("DELETE FROM JVSetupDetail WHERE JVSetupID=%n", nJVSetupID.Integer); } #endregion } #endregion }