public JsonResult GetNotifications()
        {
            MongodbFunctions mongo = new MongodbFunctions();

            Databases.DomainModel.User user = mongo.GetUser(User.Identity.Name);

            TimescaledbFunctions tdb           = new TimescaledbFunctions();
            List <string>        notifications = tdb.GetNotifications(user.Id.ToString());

            List <Databases.DomainModel.NotificationShow> nots = new List <Databases.DomainModel.NotificationShow>();

            int count = 0;

            if (notifications.Count != 0)
            {
                foreach (string notId in notifications)
                {
                    Databases.DomainModel.Notification not = mongo.GetNotification(new ObjectId(notId));
                    if (!not.Read)
                    {
                        count++;
                    }
                    Databases.DomainModel.NotificationShow nshow = new Databases.DomainModel.NotificationShow
                    {
                        Id    = not.Id.ToString(),
                        Title = not.Title,
                        Date  = not.Date.Date.ToString("dd/MM/yyyy"),
                        Read  = not.Read
                    };
                    nots.Add(nshow);
                }
            }
            tdb.CloseConnection();

            return(Json(new { number = count, alerts = nots, total = notifications.Count }, JsonRequestBehavior.AllowGet));
        }