using HRM.BO; using Ease.Core.DataAccess; using System.Data; namespace HRM.DA { 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, item.Code, item.Name, item.Address, item.CreatedBy, 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, item.ModifiedDate, item.Status, item.Sequence, item.ID); } #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, int ID) { return tc.ExecuteReader("SELECT * FROM MarketSurveyCompany WHERE MarketSurveyCompanyID=%n", ID); } #endregion #region Delete function internal static void Delete(TransactionContext tc, int ID) { tc.ExecuteNonQuery("DELETE FROM MarketSurveyCompany WHERE MarketSurveyCompanyID=%n", ID); } #endregion } }