EchoTex_Payroll/HRM.BO/Survey/SurveyAnswerCount.cs
2024-10-14 10:01:49 +06:00

197 lines
5.4 KiB
C#

using Ease.Core.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Reflection;
namespace HRM.BO
{
public class SurveyAnswerCount : AuditTrailBase
{
#region Constructor
public SurveyAnswerCount()
{
_surveyID = 0;
_questionID = 0;
_answerID = 0;
_hitCount = 0;
}
#endregion
#region Properties
#region SurveyID : ID
private int _surveyID;
public int SurveyID
{
get { return _surveyID; }
set
{
_surveyID = value;
}
}
#endregion
#region QuestionID : int
private int _questionID;
public int QuestionID
{
get { return _questionID; }
set
{
_questionID = value;
}
}
#endregion
#region AnswerID : int
private int _answerID;
public int AnswerID
{
get { return _answerID; }
set
{
_answerID = value;
}
}
#endregion
#region HitCount : int
private int _hitCount;
public int HitCount
{
get { return _hitCount; }
set
{
_hitCount = value;
}
}
#endregion
#region Service Factory IPFTransactionService : IPFTransactionService
internal static ISurveyAnswerCountService Service
{
get { return Services.Factory.CreateService<ISurveyAnswerCountService>(typeof(ISurveyAnswerCountService)); }
}
#endregion
#endregion
//#region Functions
//public SurveyAnswerCount GetSurveyAnswerCount(int surveyId, int nQuestionId, int nAnswerId)
//{
// SurveyAnswerCount oSurveyAnswerCount = null;
// #region Cache Header
// oSurveyAnswerCount = (SurveyAnswerCount)_cache["GetSurveyAnswerCount", surveyId, nQuestionId, nAnswerId];
// if (oSurveyAnswerCount != null)
// return oSurveyAnswerCount;
// #endregion
// oSurveyAnswerCount = SurveyAnswerCount.Service.GetSurveyAnswerCount(surveyId, nQuestionId, nAnswerId);
// #region Cache Footer
// _cache.Add(oSurveyAnswerCount, "GetSurveyAnswerCount", surveyId, nQuestionId, nAnswerId);
// #endregion
// return oSurveyAnswerCount;
//}
//public static List<SurveyAnswerCount> GetSurveyAnswerCount()
//{
// #region cache header
// List<SurveyAnswerCount> SurveyAnswerCounts = _cache["GetSurveyAnswerCount"] as List<SurveyAnswerCount>;
// if (SurveyAnswerCounts != null)
// return SurveyAnswerCounts;
// #endregion
// try
// {
// SurveyAnswerCounts = Service.GetSurveyAnswerCount();
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region cache footer
// _cache.Add(SurveyAnswerCounts, "GetSurveyAnswerCount");
// #endregion
// return SurveyAnswerCounts;
//}
//public static List<SurveyAnswerCount> GetSurveyAnswerCount(int surveyId)
//{
// #region Cache Header
// List<SurveyAnswerCount> SurveyAnswerCounts = _cache["GetSurveyAnswerCount", surveyId] as List<SurveyAnswerCount>;
// if (SurveyAnswerCounts != null)
// return SurveyAnswerCounts;
// #endregion
// try
// {
// SurveyAnswerCounts = Service.GetSurveyAnswerCount(surveyId);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(SurveyAnswerCounts, "GetSurveyAnswerCount", surveyId);
// #endregion
// return SurveyAnswerCounts;
//}
//public int Save()
//{
// base.SetAuditTrailProperties();
// return SurveyAnswerCount.Service.Save(this);
//}
//public void Delete(int id)
//{
// SurveyAnswerCount.Service.Delete(id);
//}
//#endregion
}
#region ISurveyAnswerCount Service
public interface ISurveyAnswerCountService
{
List<SurveyAnswerCount> GetSurveyAnswerCount(int surveyId);
SurveyAnswerCount GetSurveyAnswerCount(int surveyId, int nQuestionId, int nAnswerId);
List<SurveyAnswerCount> GetSurveyAnswerCount();
int Save(SurveyAnswerCount item);
void Delete(int id);
}
#endregion
}