CEL_Payroll/Payroll.Service/Basic/DA/MarketSurveyCompanyDA.cs

77 lines
2.4 KiB
C#
Raw Normal View History

2024-09-17 14:30:13 +06:00
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
{
#region MarketSurveyCompanyDA
internal class MarketSurveyCompanyDA
{
#region Constructor
private MarketSurveyCompanyDA() { }
#endregion
#region Insert function
internal static void Insert(TransactionContext tc, MarketSurveyCompany item)
{
tc.ExecuteNonQuery("INSERT INTO MarketSurveyCompany(MarketSurveyCompanyID, Code, Name, Address, CreatedBy, CreationDate,Status,SequenceNo)" +
" VALUES(%n, %s, %s, %s, %n, %d,%n,%n)", item.ID.Integer, item.Code, item.Name, item.Address, item.CreatedBy.Integer, item.CreatedDate,item.Status,item.Sequence);
}
#endregion
#region Update function
internal static void Update(TransactionContext tc, MarketSurveyCompany item)
{
tc.ExecuteNonQuery("UPDATE MarketSurveyCompany SET Code=%s, Name=%s, Address=%s, ModifiedBy=%n, ModifiedDate=%d,Status=%n,SequenceNo=%n " +
" WHERE MarketSurveyCompanyID=%n", item.Code, item.Name, item.Address, item.ModifiedBy.Integer, item.ModifiedDate,item.Status,item.Sequence, item.ID.Integer);
}
#endregion
#region Get Function
internal static IDataReader Get(TransactionContext tc, EnumStatus status)
{
if (EnumStatus.Active == status || EnumStatus.Inactive == status)
{
return tc.ExecuteReader("SELECT * FROM MarketSurveyCompany Where Status=%n Order by MarketSurveyCompanyID",status);
}
else
{
return tc.ExecuteReader("SELECT * FROM MarketSurveyCompany Order by MarketSurveyCompanyID");
}
}
internal static IDataReader Get(TransactionContext tc, ID nID)
{
return tc.ExecuteReader("SELECT * FROM MarketSurveyCompany WHERE MarketSurveyCompanyID=%n", nID.Integer);
}
#endregion
#region Delete function
internal static void Delete(TransactionContext tc, ID nID)
{
tc.ExecuteNonQuery("DELETE FROM MarketSurveyCompany WHERE MarketSurveyCompanyID=%n", nID.Integer);
}
#endregion
}
#endregion
}