using HRM.BO; using Ease.Core.DataAccess; using System; using System.Data; namespace HRM.DA { internal static class BudgetNewJoinerDA { public static IDataReader Get(TransactionContext tc, int nID) { return tc.ExecuteReader("Select * from BudgetNewJoiner where BudgetNewJoinerID=%n", nID); } public static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("Select * from BudgetNewJoiner"); } public static IDataReader GetByBudgetId(TransactionContext tc, int nID) { return tc.ExecuteReader("Select * from BudgetNewJoiner where BudgetID=%n", nID); } public static void Insert(TransactionContext tc, BudgetNewJoiner item) { tc.ExecuteNonQuery( "Insert into BudgetNewJoiner(BudgetNewJoinerID,BasicSalary,BudgetID,DepartmentID,GradeID,IncrementPercentage,LocationID,NextIncrementalMonth,NoofEmployee,FromDate,CategoryID,GrossSalary) Values" + "(%n,%n,%n,%n,%n,%n,%n,%n,%n,%d,%n,%n)", item.ID, item.BasicSalary, item.BudgetID, item.DepartmentID, item.GradeID, item.IncrementPercentage, item.LocationID, item.NextIncrementalMonth, item.NoofEmployee, item.FromDate, item.CategoryID, item.GrossSalary); } public static void Update(TransactionContext tc, BudgetNewJoiner item) { tc.ExecuteNonQuery( "Update BudgetNewJoiner SET BasicSalary=%n,BudgetID=%n,DepartmentID=%n,GradeID=%n,IncrementPercentage=%n,LocationID=%n,NextIncrementalMonth=%n,NoofEmployee=%n,FromDate=%d,CategoryID=%n,GrossSalary=%n" + "Where BudgetNewJoinerID=%n", item.BasicSalary, item.BudgetID, item.DepartmentID, item.GradeID, item.IncrementPercentage, item.LocationID, item.NextIncrementalMonth, item.NoofEmployee, item.FromDate, item.CategoryID, item.GrossSalary, item.ID); } public static void Delete(TransactionContext tc, int nID) { tc.ExecuteNonQuery("Delete from BudgetNewJoiner where BudgetNewJoinerID=%n", nID); } public static IDataReader GetBudgetNewJoinerCrGs(TransactionContext tc, int baseID) { return tc.ExecuteReader("Select * from BudgetNewJoinerCrG Where BudgetNewJoinerID=%n", baseID); } public static void Delete(TransactionContext tc, string tableName, string columnName, int id) { tc.ExecuteNonQuery("Delete from %s where %s=%n", tableName, columnName, id); } public static void Insert(TransactionContext tc, BudgetNewJoinerCrG item) { tc.ExecuteNonQuery( "Insert into BudgetNewJoinerCrG(BudgetNewJoinerCrGID,BudgetNewJoinerID,CCID,Percentage) Values" + "(%n,%n,%n,%n)", item.ID, item.BudgetNewJoinerID, item.CCID, item.Percentage); } } }