CEL_Payroll/Payroll.Service/Budget/DA/MarketSalarySurveyDA.cs

55 lines
2.9 KiB
C#
Raw Normal View History

2024-09-17 14:30:13 +06:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ease.CoreV35.DataAccess;
using Payroll.BO;
using Ease.CoreV35.Model;
using System.Data;
namespace Payroll.Service
{
public class MarketSalarySurveyDA
{
internal static IDataReader Get(TransactionContext tc,ID nID)
{
throw new NotImplementedException();
}
internal static IDataReader Get(TransactionContext tc, DateTime surveyYear)
{
return tc.ExecuteReader("Select * from MarketSalarySurvey where SurveyYear between %d AND %d",Ease.CoreV35.Utility.Global.DateFunctions.FirstDateOfYear(surveyYear), Ease.CoreV35.Utility.Global.DateFunctions.LastDateOfYear(surveyYear));
}
internal static IDataReader Get(TransactionContext tc, DateTime surveyYear, int nSurveyOn, int nGradeID)
{
return tc.ExecuteReader("Select * from MarketSalarySurvey where SurveyYear between %d AND %d AND GradeID=%n AND SurveyOn=%n",Ease.CoreV35.Utility.Global.DateFunctions.FirstDateOfYear(surveyYear), Ease.CoreV35.Utility.Global.DateFunctions.LastDateOfYear(surveyYear), nGradeID, nSurveyOn);
}
internal static IDataReader Get(TransactionContext tc, DateTime surveyYear, int nSurveyOn)
{
return tc.ExecuteReader("Select * from MarketSalarySurvey where SurveyYear between %d AND %d AND SurveyOn=%n",Ease.CoreV35.Utility.Global.DateFunctions.FirstDateOfYear(surveyYear), Ease.CoreV35.Utility.Global.DateFunctions.LastDateOfYear(surveyYear), nSurveyOn);
}
internal static void Insert(TransactionContext tc,MarketSalarySurvey item)
{
tc.ExecuteNonQuery("Insert into MarketSalarySurvey(MarketSurveyID,GradeID,Amount,SurveyYear,SurveyOn,CompanyID) Values(%n,%n,%n,%d,%n,%n)", item.ID.Integer, item.GradeID.Integer, item.Amount, item.SurveyYear, Convert.ToInt32(item.SurveyOn),item.CompanyID.Integer);
}
internal static void Update(TransactionContext tc,MarketSalarySurvey item)
{
tc.ExecuteNonQuery("Update MarketSalarySurvey Set GradeID = %n, Amount = %n, SurveyYear = %d, SurveyOn = %n,CompanyID=%n Where MarketSurveyID = %n", item.GradeID.Integer, item.Amount, item.SurveyYear, Convert.ToInt32(item.SurveyOn), item.CompanyID.Integer, item.ID.Integer);
}
internal static void Delete(TransactionContext tc, ID id)
{
tc.ExecuteNonQuery("Delete From MarketSalarySurvey where MarketSurveyID = %n", id.Integer);
}
internal static DataSet CheckDesignationExistsOrNot(TransactionContext tc, ID iD,DateTime year)
{
return tc.ExecuteDataSet("Select * From MarketSalarySurvey Where GradeID = %n And SurveyYear between %d AND %d ", iD.Integer, Ease.CoreV35.Utility.Global.DateFunctions.FirstDateOfYear(year), Ease.CoreV35.Utility.Global.DateFunctions.LastDateOfYear(year));
}
}
}