Ejemplo n.º 1
0
        //Add Comment Notification
        public bool AddCommentNotification(NotificationModel model)
        {
            var DbModel = new Z_Consultant_Notification
            {
                PostId  = model.PostId,
                OwnerId = model.OwnerId,
                UserId  = model.UserId,
                Type    = model.Type,
                Time    = DateTime.Now,
                IsRead  = false
            };

            if (DbModel != null)
            {
                _notidficationRepository.Insert(DbModel);

                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
        //Add Post Notification
        public bool AddPostNotification(NotificationModel model, List <int> consultantId)
        {
            var DbModel = new Z_Consultant_Notification
            {
                PostId = model.PostId,

                UserId = model.UserId,
                Type   = model.Type,
                Time   = DateTime.Now,
                IsRead = false
            };

            if (DbModel != null)
            {
                foreach (var con in consultantId)
                {
                    DbModel.OwnerId = con;
                    _notidficationRepository.Insert(DbModel);
                }
                return(true);
            }
            return(false);
        }