/// <summary>
 /// Get Header Notification List for Login User
 /// </summary>
 /// <returns></returns>
 public ActionResult GetNotificationList()
 {
     NotificationObject notifications = new NotificationObject();
     ResponseObjectForAnything responseObject = new ResponseObjectForAnything();
     NotificationEngine notificationEngine = new NotificationEngine();
     string response = notificationEngine.GetNotificationsJSON(Request.Cookies["sessionkey"].Value);
     responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response);
     notifications = (NotificationObject)Serializer.JSONStringToObject<NotificationObject>(responseObject.ResultObjectJSON);
     return PartialView("_HeaderNotificationList", notifications.Notifications);
 }
        public ActionResult GetNotificationByPaging(int pageIndex)
        {
            List<Notification> notifications = new List<Notification>();
            ResponseObjectForAnything responseObject = new ResponseObjectForAnything();
            NotificationEngine notificationEngine = new NotificationEngine();
            string response = notificationEngine.GetNotificationsJSON(Request.Cookies["sessionkey"].Value);
            responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response);
            notifications = (List<Notification>)Serializer.JSONStringToObject<List<Notification>>(responseObject.ResultObjectJSON);

            int totalRecords = notifications.Count > 0 ? notifications[0].TotalNotificationCount : 0;
            int totalPagesCount = 0;
            totalPagesCount = (int)Math.Ceiling((float)totalRecords / (float)_pageSize);
            ViewBag.PageNumber = pageIndex;
            ViewBag.PageSize = _pageSize;
            ViewBag.TotalPagesCount = totalPagesCount;
            ViewBag.TotalRecords = totalRecords;
            return PartialView("_NotificationList", notifications);
        }
        /// <summary>
        /// Get Notification Listing Page
        /// </summary>
        /// <param name="id">Optional parameter Id as a Id of notification which supposed to be mark as a read</param>
        /// <returns></returns>
        public ActionResult Index(int id = 0)
        {
            //List<SystemNotificationsViewModel> modelList = new List<SystemNotificationsViewModel>();
            List<Notification> notifications = new List<Notification>();
            ResponseObjectForAnything responseObject = new ResponseObjectForAnything();
            NotificationEngine notificationEngine = new NotificationEngine();
            string response = notificationEngine.GetNotificationsJSON(Request.Cookies["sessionkey"].Value);
            responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response);
            notifications = (List<Notification>)Serializer.JSONStringToObject<List<Notification>>(responseObject.ResultObjectJSON);
            int totalRecords = notifications.Count > 0 ? notifications[0].TotalNotificationCount : 0;
            int totalPagesCount = 0;
            totalPagesCount = (int)Math.Ceiling((float)totalRecords / (float)_pageSize);
            ViewBag.PageNumber = 1;
            ViewBag.PageSize = _pageSize;
            ViewBag.TotalPagesCount = totalPagesCount;
            ViewBag.TotalRecords = totalRecords;

            return View(notifications);
        }