51 lines
1.8 KiB
C#
51 lines
1.8 KiB
C#
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 BudgetCostCenterDA
|
|
{
|
|
public static IDataReader Get(TransactionContext tc, ID nID)
|
|
{
|
|
return tc.ExecuteReader("Select * from BudgetCostCenter where BudgetCostCenterID=%n", nID.Integer);
|
|
|
|
}
|
|
|
|
public static IDataReader Get(TransactionContext tc)
|
|
{
|
|
return tc.ExecuteReader("Select * from BudgetCostCenter");
|
|
}
|
|
public static IDataReader Get(TransactionContext tc,int nID)
|
|
{
|
|
return tc.ExecuteReader("Select * from BudgetCostCenter where BudgetID=%n",nID);
|
|
}
|
|
|
|
public static void Insert(TransactionContext tc, BudgetCostCenter item)
|
|
{
|
|
tc.ExecuteNonQuery("Insert into BudgetCostCenter(BudgetCostCenterID,CostCenterID,EmployeeID,FromMonth,Percentage,BudgetID) Values" +
|
|
"(%n,%n,%n,%d,%n,%n)", item.ID.Integer, item.CostCenterID.Integer, item.EmployeeID.Integer,item.FromMonth,item.Percentage,item.BudgetID.Integer);
|
|
|
|
}
|
|
|
|
public static void Update(TransactionContext tc, BudgetCostCenter item)
|
|
{
|
|
tc.ExecuteNonQuery("Update BudgetCostCenter SET CostCenterID=%n,EmployeeID=%n,FromMonth=%d,Percentage=%n" +
|
|
"Where BudgetCostCenterID=%n", item.CostCenterID.Integer, item.EmployeeID.Integer, item.FromMonth, item.Percentage, item.ID.Integer);
|
|
|
|
}
|
|
|
|
public static void Delete(TransactionContext tc, ID nID)
|
|
{
|
|
tc.ExecuteNonQuery("Delete from BudgetCostCenter where BudgetCostCenterID=%n", nID.Integer);
|
|
|
|
}
|
|
}
|
|
}
|