using Ease.Core.Model;


using System;
using System.Collections.Generic;
using System.Data;

namespace HRM.BO
{
   // #region Notification
   //public class Notification : BasicBaseObject
   // {
   //     #region Constructor
        
   //     public Notification()
   //     {
   //         _sSubject = string.Empty;
   //         _sFooter = string.Empty;
   //         _sAttachment = string.Empty;
   //         _nTagOutputID = 0;
   //         _nObjectID = 0;
   //         _nOptionalObjectID = 0;
   //         _sBody = string.Empty;
   //         NotificationParticipants = null;
   //         NotificationRules = null;
   //         _bIsMailNf = false;
   //         _bIsSMSNf = false;
   //         _bIsWebNf = false;
   //         _eStatus = EnumNotificationStatus.Closed;
   //         _eType = EnumNotificationType.Notification;
   //         _nObjectID = (0);
   //         _nOptionalObjectID = (0);
   //     }

   //     #endregion
        
   //     #region Properties

   //     #region Subject : string
   //     private string _sSubject;
   //     public string Subject
   //     {
   //         get { return _sSubject; }
   //         set { _sSubject = value; }
   //     }    
   //     #endregion

   //     #region Body : string
   //     private string _sBody;
   //     public string Body
   //     {
   //         get { return _sBody; }
   //         set { _sBody = value; }
   //     }
   //     #endregion

   //     #region TagOutputID : ID
   //     private int _nTagOutputID;
   //     public int TagOutputID
   //     {
   //         get { return _nTagOutputID; }
   //         set { _nTagOutputID = value; }
   //     }
   //     #endregion

   //     #region ObjectID : ID
   //     private int _nObjectID;
   //     public int ObjectID
   //     {
   //         get { return _nObjectID; }
   //         set { _nObjectID = value; }
   //     }
   //     #endregion

   //     #region OptionalObjectID : ID
   //     private int _nOptionalObjectID;
   //     public int OptionalObjectID
   //     {
   //         get { return _nOptionalObjectID; }
   //         set { _nOptionalObjectID = value; }
   //     }
   //     #endregion

   //     #region Attachment : string
   //     private string _sAttachment;
   //     public string Attachment
   //     {
   //         get { return _sAttachment; }
   //         set { _sAttachment = value; }
   //     }
   //     #endregion

   //     #region Footer : string
   //     private string _sFooter;
   //     public string Footer
   //     {
   //         get { return _sFooter; }
   //         set { _sFooter = value; }
   //     }
   //     #endregion

   //     #region Type :EnumNotificationType
   //     private EnumNotificationType _eType;
   //     public EnumNotificationType Type
   //     {
   //         get { return _eType; }
   //         set { _eType = value; }
   //     }
   //     #endregion

   //     #region IsWebNf : bool

   //     private bool _bIsWebNf;
   //     public bool IsWebNf
   //     {
   //         get { return _bIsWebNf; }
   //         set {_bIsWebNf=value; }
   //     }
   //     #endregion

   //     #region IsMailNf : bool

   //     private bool _bIsMailNf;
   //     public bool IsMailNf
   //     {
   //         get { return _bIsMailNf; }
   //         set { _bIsMailNf = value; }
   //     }
   //     #endregion

   //     #region IsSMSNf : bool

   //     private bool _bIsSMSNf;
   //     public bool IsSMSNf
   //     {
   //         get { return _bIsSMSNf; }
   //         set { _bIsSMSNf = value; }
   //     }
   //     #endregion

   //     #region Status : EnumNotificationStatus
   //     private EnumNotificationStatus _eStatus;
   //     public EnumNotificationStatus Status
   //     {
   //         get { return _eStatus; }
   //         set { _eStatus = value; }
   //     }
   //     #endregion

   //     public List<NotificationParticipant> NotificationParticipants { get; set; }
   //     public List<NotificationRule> NotificationRules { get; set; }

   //     //#region  NotificationParticipants : List<NotificationPerticipant>

   //     //private List<NotificationParticipant> _oNotificationParticipants;
   //     //public List<NotificationParticipant> NotificationParticipants
   //     //{
   //     //    get
   //     //    {
   //     //        if (this.int != null && _oNotificationParticipants==null)
   //     //        {
   //     //            _oNotificationParticipants = Notification.Service.GetNotificationParticipants(this.ID);
   //     //        }
   //     //        return _oNotificationParticipants;
   //     //    }
   //     //    set { _oNotificationParticipants = value; }
   //     //}
   //     //#endregion

   //     //#region  NotificationRules : List<NotificationRule>

   //     //private List<NotificationRule> _oNotificationRules;
   //     //public List<NotificationRule> NotificationRules
   //     //{
   //     //    get
   //     //    {
   //     //        if (this.int != null && _oNotificationRules == null)
   //     //        {
   //     //            _oNotificationRules = Notification.Service.GetNotificationRules(this.ID);
   //     //        }
   //     //        return _oNotificationRules;
   //     //    }
   //     //    set { _oNotificationRules = value; }
   //     //}
   //     //#endregion
  
   //     #region Service Factory

   //     internal static INotificationService Service
   //     {
   //         get { return Services.Factory.CreateService<INotificationService>(typeof(INotificationService)); }
   //     }

   //     #endregion        
        
   //     #endregion

   //     //#region Functions

   //     //public static int GetNewID()
   //     //{
   //     //    return Notification.Service.GetNewID();
   //     //}

   //     //public static Notification Get(int notificationId)
   //     //{
   //     //    Notification oNotification = null;
   //     //    #region Cache Header
   //     //    oNotification = (Notification)_cache["Get", notificationId];
   //     //    if (oNotification != null)
   //     //        return oNotification;
   //     //    #endregion
   //     //    oNotification = Notification.Service.Get(notificationId);
   //     //    #region Cache Footer
   //     //    _cache.Add(oNotification, "Get", notificationId);
   //     //    #endregion
   //     //    return oNotification;
   //     //}

   //     //public int Save()
   //     //{
   //     //    if (User.CurrentUser!=null)
   //     //    this.SetAuditTrailProperties();
   //     //    return Notification.Service.Save(this);
   //     //}

   //     //public static void SaveReply(NotificationParticipant oParticipant)
   //     //{
   //     //    Notification.Service.SaveReply(oParticipant);
   //     //}

   //     //public void Delete()
   //     //{
   //     //    Notification.Service.Delete(this.ID);
   //     //}

   //     //public static int GetNewBatchNumber()
   //     //{
   //     //    int batchNo = 0;
   //     //    batchNo = Notification.Service.GetNewBatchNumber();
   //     //    return batchNo;
   //     //}

   //     //public DateTime GetMinSendDateByID()
   //     //{
   //     //    DateTime minDate = DateTime.MinValue;
   //     //    minDate = Notification.Service.GetMinSendDateByID(this.ID);
   //     //    return minDate;
   //     //}

   //     //public static void ChangeNotificationRuleStatus(NotificationRule notfRule, EnumSendStatus enumSendStatus, EnumNotificationMedium medium)
   //     //{
   //     //    switch (medium)
   //     //    {
   //     //        case EnumNotificationMedium.Email:
   //     //            notfRule.EmailSendStatus = enumSendStatus;
   //     //            break;
   //     //        case EnumNotificationMedium.SMS:
   //     //            notfRule.SMSSendStatus  = enumSendStatus;
   //     //            break;
   //     //        case EnumNotificationMedium.WEB:
   //     //            notfRule.WebSendStatus = enumSendStatus;
   //     //            break;
   //     //    }
   //     //    Notification.Service.UpdateNotificationRule(notfRule);
            
   //     //}

   //     //public static void ChangeNotificationRuleRemarks(NotificationRule notfRule,string Message, EnumNotificationMedium medium)
   //     //{
   //     //    switch (medium)
   //     //    {
   //     //        case EnumNotificationMedium.Email:
   //     //            notfRule.Remarks = "Email Cannot Be sent Due To:" + Message;
   //     //            break;
   //     //        case EnumNotificationMedium.SMS:
   //     //            notfRule.Remarks = "SMS Cannot Be sent Due To:" + Message ;
   //     //            break;
   //     //        case EnumNotificationMedium.WEB:
   //     //            notfRule.Remarks = "Web Notification Cannot Be sent Due To:" + Message;
   //     //            break;
   //     //    }
   //     //    Notification.Service.UpdateNotificationRule(notfRule);

   //     //}
        
   //     //#endregion
         
   //     //#region Collection Functions

   //     //public static List<Notification> Get()
   //     //{
   //     //    #region Cache Header
   //     //    List<Notification> notifications = _cache["Get"] as List<Notification>;
   //     //    if (notifications != null)
   //     //        return notifications;
   //     //    #endregion
   //     //    notifications = Notification.Service.Get();
   //     //    #region Cache Footer
   //     //    _cache.Add(notifications, "Get");
   //     //    #endregion
   //     //    return notifications;
   //     //}

   //     //public static List<Notification> Get(EnumNotificationStatus status)
   //     //{
   //     //    #region Cache Header
   //     //    List<Notification> notifications = _cache["Get"] as List<Notification>;
   //     //    if (notifications != null)
   //     //        return notifications;
   //     //    #endregion
   //     //    notifications = Notification.Service.Get(status);
   //     //    #region Cache Footer
   //     //    _cache.Add(notifications, "Get");
   //     //    #endregion
   //     //    return notifications;
   //     //}

   //     //public static List<Notification> GetByDateRange(DateTime startDate, DateTime endDate)
   //     //{
   //     //    List<Notification> oNotifications = null;
   //     //    #region Cache Header
   //     //    oNotifications = (List<Notification>)_cache["Get", startDate, endDate];
   //     //    if (oNotifications != null)
   //     //        return oNotifications;
   //     //    #endregion
   //     //    oNotifications = Notification.Service.GetByDateRange(startDate, endDate);
   //     //    #region Cache Footer
   //     //    _cache.Add(oNotifications, "Get", startDate, endDate);
   //     //    #endregion
   //     //    return oNotifications;
   //     //}

   //     //public static List<NotificationParticipant> GetNotificationParticipants(int notificationID)
   //     //{
   //     //    List<NotificationParticipant> oNotificationParticipants = null;
   //     //    #region Cache Header
   //     //    oNotificationParticipants = (List<NotificationParticipant>)_cache["Get", notificationID];
   //     //    if (oNotificationParticipants != null)
   //     //        return oNotificationParticipants;
   //     //    #endregion
   //     //    oNotificationParticipants = Notification.Service.GetNotificationParticipants(notificationID);
   //     //    #region Cache Footer
   //     //    _cache.Add(oNotificationParticipants, "Get", notificationID);
   //     //    #endregion
   //     //    return oNotificationParticipants;
   //     //}

   //     //#endregion

   //     //public static List<Notification> GetMeetingMinutesForWeb()
   //     //{
   //     //    List<Notification> notifcationList = new List<Notification>();
   //     //    #region Cache Header
   //     //    List<Notification> notifications = _cache["Get"] as List<Notification>;
   //     //    if (notifications != null)
   //     //        return notifications;
   //     //    #endregion
   //     //    notifications = Notification.Service.Get();
   //     //    notifcationList = notifications
   //     //                      .Where(obj => obj.Type == EnumNotificationType.Meeting_Minutes 
   //     //                             && obj.Status == EnumNotificationStatus.InProcess
   //     //                             )
   //     //                       .ToList();
   //     //    #region Cache Footer
   //     //    _cache.Add(notifications, "Get");
   //     //    #endregion
   //     //    return notifcationList;
   //     //}
   //     //public static List<Notification> GetMeetingMinutesForWeb(int webEmployeeID)
   //     //{
   //     //    List<Notification> notifcationList = new List<Notification>();
   //     //    #region Cache Header
   //     //    List<Notification> notifications = _cache["Get"] as List<Notification>;
   //     //    if (notifications != null)
   //     //        return notifications;
   //     //    #endregion
   //     //    notifications = Notification.Service.Get();
   //     //    notifcationList = notifications
   //     //                      .Where(obj => obj.Type == EnumNotificationType.Meeting_Minutes
   //     //                             && obj.Status == EnumNotificationStatus.InProcess
   //     //                             && obj.NotificationRules.Any(o => o.PerticipantID.Integer == webEmployeeID))
   //     //                      .ToList();
   //     //    #region Cache Footer
   //     //    _cache.Add(notifications, "Get");
   //     //    #endregion
   //     //    return notifcationList;
   //     //}

   //     //public static List<Notification> GetNotificationsForWeb(int webEmployeeID)
   //     //{
   //     //    List<Notification> notifcationList = new List<Notification>();
   //     //    #region Cache Header
   //     //    List<Notification> notifications = _cache["Get"] as List<Notification>;
   //     //    if (notifications != null)
   //     //        return notifications;
   //     //    #endregion
   //     //    notifications = Notification.Service.Get();
   //     //    notifcationList = notifications
   //     //                      .Where(obj => obj.Type == EnumNotificationType.Notification
   //     //                             && obj.Status == EnumNotificationStatus.InProcess
   //     //                             && obj.NotificationRules.Any(o => o.PerticipantID.Integer == webEmployeeID && o.WebSendStatus==EnumSendStatus.NotSent))
   //     //                      .ToList();
   //     //    #region Cache Footer
   //     //    _cache.Add(notifications, "Get");
   //     //    #endregion
   //     //    return notifcationList;
   //     //}
   // }
   // #endregion 
  
   // #region INotification Service

   // public interface INotificationService
   // {
   //     int GetNewID();
   //     Notification Get(int id);
   //     List<Notification> Get();
   //     List<Notification> Get(EnumNotificationStatus status);
   //     int Save(Notification oNotification);
   //     void SaveReply(NotificationParticipant oParticipant);
   //     void UpdateNotificationRule(NotificationRule notfRule);
   //     void Delete(int id);
   //     List<NotificationParticipant> GetNotificationParticipants(int id);
   //     List<NotificationRule> GetNotificationRules(int id);
   //     int GetNewBatchNumber();
   //     DateTime GetMinSendDateByID(int iD);
   //     List<Notification> GetByDateRange(DateTime startDate, DateTime endDate);

       
   // }

   // #endregion

}