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 { class PremiumProcessDetailDA { internal static System.Data.IDataReader Get(TransactionContext tc, ID id) { return tc.ExecuteReader("SELECT * FROM PremiumProcessDetail WHERE PremiumProcessDetailID=%n", id.Integer); } internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM PremiumProcessDetail"); } internal static void Insert(TransactionContext tc, PremiumProcessDetail oItem) { tc.ExecuteNonQuery("INSERT INTO PremiumProcessDetail (PremiumProcessDetailID, PremiumProcessID, EmployeeID, Gross, Basic, AssuredAmount, PremiumAmount)" + " VALUES(%n, %n, %n, %n, %n, %n, %n)", oItem.ID.Integer, oItem.PremiumProcessID.Integer, oItem.EmployeeID.Integer, oItem.Gross, oItem.Basic, oItem.AssuredAmount, oItem.PremiumAmount); } internal static void Update(Ease.CoreV35.DataAccess.TransactionContext tc, BO.PremiumProcessDetail oItem) { tc.ExecuteNonQuery("UPDATE PremiumProcessDetail SET EmployeeID=%n, PremiumProcessID=%n, Gross=%n, Basic=%n, AssuredAmount=%n, PremiumAmount=%n" + " WHERE PremiumProcessDetailID=%n", oItem.EmployeeID.Integer, oItem.PremiumProcessID.Integer, oItem.Gross, oItem.Basic, oItem.AssuredAmount, oItem.PremiumAmount, oItem.ID.Integer); } internal static void Delete(Ease.CoreV35.DataAccess.TransactionContext tc, Ease.CoreV35.Model.ID id) { tc.ExecuteNonQuery("DELETE FROM PremiumProcessDetail WHERE PremiumProcessDetailID=%n", id.Integer); } internal static IDataReader GetDetails(TransactionContext tc, ID id) { return tc.ExecuteReader("SELECT * FROM PremiumProcessDetail where PremiumProcessID=%n", id.Integer); } } }