Пример #1
0
        //public JsonResult GetNotificationContacts()
        //{
        //    var notificationRegisterTime = Session["LastUpdated"] != null ? Convert.ToDateTime(Session["LastUpdated"]) : DateTime.Now;
        //    NotificationComponents NC = new NotificationComponents();
        //    var list = NC.GetContacts(notificationRegisterTime);
        //    //update session here for get only new added contacts (notification)
        //    Session["LastUpdate"] = DateTime.Now;
        //    return new JsonResult { Data = list, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
        //}

        public JsonResult GetNotifications()
        {
            var notificationRegisterTime = Session["LastUpdated"] != null?Convert.ToDateTime(Session["LastUpdated"]) : DateTime.Now;

            NotificationComponents NC = new NotificationComponents();
            var list = NC.GetContacts(notificationRegisterTime);

            //update session here for get only new added contacts (notification)
            Session["LastUpdated"] = DateTime.Now;
            return(Json(list, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public JsonResult GetNotificationContacts()
        {
            var notificationRegiterTime =
                Session["LastUpdated"] != null?Convert.ToDateTime(Session["LastUpdated"]) : DateTime.Now;

            NotificationComponents nc = new NotificationComponents();
            var list = nc.GetContacts(notificationRegiterTime);

            Session["LastUpdate"] = DateTime.Now;
            return(new JsonResult {
                Data = list, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }