using Ease.Core.DataAccess; using Ease.Core.Model; using Ease.Core.Utility; using System; using System.Collections.Generic; using System.Data; using System.Linq; namespace HRM.BO { public class MailSenderErrorList : BasicBaseObject { #region Private Variable private int _toEmpID; private int _batchNo; private DateTime _receiveTime; private DateTime _sendTime; private bool _isSuccessfull; private string _reason; private string _from; private string _to; private string _cc; private string _subject; private string _body; private string _attachments; private Employee _toEmployee; public Employee ToEmployee { get { return _toEmployee; } set { _toEmployee = value; } } #endregion #region Constractor public MailSenderErrorList() { _from = ""; _receiveTime = DateTime.Today; _sendTime = DateTime.Today; _isSuccessfull = false; _reason = ""; _to = ""; _cc = ""; _subject = ""; _body = ""; _attachments = ""; _batchNo = 0; _toEmpID = 0; } #endregion #region Properties public int ToEmpID { get { return _toEmpID; } set { _toEmpID = value; } } public int BatchNo { get { return _batchNo; } set { _batchNo = value; } } public string From { get { return _from; } set { _from = value; } } public DateTime ReceiveTime { get { return _receiveTime; } set { _receiveTime = value; } } public DateTime SendTime { get { return _sendTime; } set { _sendTime = value; } } public bool IsSuccessfull { get { return _isSuccessfull; } set { _isSuccessfull = value; } } public string Reason { get { return _reason; } set { _reason = value; } } public string To { get { return _to; } set { _to = value; } } public string CC { get { return _cc; } set { _cc = value; } } public string Subject { get { return _subject; } set { _subject = value; } } public string Body { get { return _body; } set { _body = value; } } public string Attachments { get { return _attachments; } set { _attachments = value; } } #endregion //#region Service Factory IMailSenderErrorListService : IMailSenderErrorListService //internal static IMailSenderErrorListService Service //{ // get { return Services.Factory.CreateService(typeof(IMailSenderErrorListService)); } //} //#endregion //#region Functions //public static MailSenderErrorList Get(int nID) //{ // MailSenderErrorList oMailSenderErrorList = null; // #region Cache Header // oMailSenderErrorList = (MailSenderErrorList)_cache["Get", nID]; // if (oMailSenderErrorList != null) // return oMailSenderErrorList; // #endregion // oMailSenderErrorList = MailSenderErrorList.Service.Get(nID); // #region Cache Footer // _cache.Add(oMailSenderErrorList, "Get", nID); // #endregion // return oMailSenderErrorList; //} //public static List Get() //{ // #region Cache Header // List MailSenderErrorLists = _cache["Get"] as List; // if (MailSenderErrorLists != null) // return MailSenderErrorLists; // #endregion // try // { // MailSenderErrorLists = Service.Get(); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region Cache Footer // _cache.Add(MailSenderErrorLists, "Get"); // #endregion // return MailSenderErrorLists; //} //public int Save() //{ // this.SetAuditTrailProperties(); // return MailSenderErrorList.Service.Save(this); //} //public void Save(List mailSenderErrorLists) //{ // MailSenderErrorList.Service.Save(mailSenderErrorLists); //} //public void Delete(int id) //{ // MailSenderErrorList.Service.Delete(id); //} //public void DeleteByBatchNo(int batchNo) //{ // MailSenderErrorList.Service.DeleteByBatchNo(batchNo); //} //public static int GetNewBatchNo() //{ // int id = ID.FromInteger(0); // try // { // id = MailSenderErrorList.Service.GetNewBatchNo(); // } // catch (Exception exception) // { // throw exception; // } // return id; //} //public static DataTable GetBatchNoWiseErrorList() //{ // DataTable dataTable = new DataTable(); // try // { // dataTable = MailSenderErrorList.Service.GetBatchNoWiseErrorList(); // } // catch (Exception exception) // { // throw exception; // } // return dataTable; //} //public static List GetErrorListByBatchNo(int batchNo) //{ // #region Cache Header // List MailSenderErrorLists = _cache["Get", Ease.Core.Model.ID.FromInteger(batchNo)] as List; // if (MailSenderErrorLists != null) // return MailSenderErrorLists; // #endregion // try // { // MailSenderErrorLists = MailSenderErrorList.Service.GetErrorListByBatchNo(batchNo); // } // catch (Exception exception) // { // throw exception; // } // #region Cache Footer // _cache.Add(MailSenderErrorLists, "Get", ID.FromInteger(batchNo)); // #endregion // return MailSenderErrorLists; //} //public static void UpdateSendStatus(int nID, bool bStatus) //{ // Service.UpdateSendStatus(nID, bStatus); //} //#endregion } #region IMailSenderErrorList Service public interface IMailSenderErrorListService { MailSenderErrorList Get(int id); List Get(); int Save(MailSenderErrorList item); void Save(List mailSenderErrorLists); void Delete(int id); void DeleteByBatchNo(int batchNo); int GetNewBatchNo(); DataTable GetBatchNoWiseErrorList(); DataTable GetMailHistory(bool status, EnumSchedularType Type, DateTime fromDate, DateTime toDate); List GetErrorListByBatchNo(int batchNo); void UpdateSendStatus(int nID, bool bStatus); } #endregion }