CEL_Payroll/Payroll.Service/Budget/DA/AppraisalPointRatingDA.cs
2024-09-17 14:30:13 +06:00

46 lines
2.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Ease.CoreV35.DataAccess;
using Ease.CoreV35.Model;
using Payroll.BO;
namespace Payroll.Service.Budget.DA
{
public class AppraisalPointRatingDA
{
internal static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("Select * From AppraisalPointRating ");
}
internal static IDataReader Get(TransactionContext tc, DateTime appYear)
{
return tc.ExecuteReader("Select * From AppraisalPointRating where AppraisalYear=%d", Ease.CoreV35.Utility.Global.DateFunctions.LastDateOfYear(appYear));
}
internal static void Insert(TransactionContext tc, AppraisalPointRating item)
{
tc.ExecuteNonQuery("Insert into AppraisalPointRating(AppraisalPointRatingID,AppraisalPointID,MaxParcent,MinParcent,Parcent,AppraisalYear,CreatedBy,CreatedDate,status) Values(%n,%n,%n,%n,%n,%d,%n,%d,%n)", item.ID.Integer, item.AppraisalPointID.Integer, item.MaxParcent, item.MinParcent, item.Parcent, item.AppraisalYear, item.CreatedBy.Integer, item.CreatedDate, Convert.ToInt32(item.Status));
}
internal static void Update(TransactionContext tc, AppraisalPointRating item)
{
tc.ExecuteNonQuery("Update AppraisalPointRating Set AppraisalPointID = %n, MaxParcent = %n, MinParcent = %n, Parcent = %n, AppraisalYear = %d, ModifiedBy = %n,ModifiedDate = %d,status = %n Where AppraisalPointRatingID = %n", item.AppraisalPointID.Integer, item.MaxParcent, item.MinParcent, item.Parcent, item.AppraisalYear, item.ModifiedBy.Integer, item.ModifiedDate, Convert.ToInt32(item.Status), item.ID.Integer);
}
internal static void Delete(TransactionContext tc, ID id)
{
tc.ExecuteNonQuery("Delete From AppraisalPointRating Where AppraisalPointRatingID = %n", id.Integer);
}
internal static DataSet CheckAppraisalPointRating(TransactionContext tc, ID id, DateTime year)
{
return tc.ExecuteDataSet("Select * From AppraisalPointRating Where AppraisalPointID = %n And AppraisalYear = %d", id.Integer, year);
}
}
}