Exemplo n.º 1
0
        /// <summary>
        /// Retrieves the message or alert view.
        /// </summary>
        /// <param name="presenter">The presenter.</param>
        /// <param name="pagingListResult">The paging list result.</param>
        /// <param name="pagingResult">The paging result.</param>
        /// <param name="isMessage">if set to <c>true</c> [is message].</param>
        /// <returns>The Message or Alert View.</returns>
        private ActionResult RetrieveMessageOrAlertView(VisitorPresenter presenter, out ListResult<Alert> pagingListResult, List<Alert> pagingResult, bool isMessage)
        {
            pagingListResult = new ListResult<Alert>();
            pagingListResult.AssignItems(pagingResult);
            if (isMessage)
            {
                presenter.AssignMessageResult(pagingListResult);
                return this.PartialView(VisitorMessages, presenter);
            }

            presenter.AssignAlertsResult(pagingListResult);
            return this.PartialView(VisitorAlerts, presenter);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Extracts the alert paged records.
 /// </summary>
 /// <param name="presenter">The presenter.</param>
 private void ExtractAlertPagedRecords(VisitorPresenter presenter)
 {
     var maxPaging = DefaultPageSize > SessionData.Instance.AlertItems.Items.Count ? SessionData.Instance.AlertItems.Items.Count : DefaultPageSize;
     var pagingResult = SessionData.Instance.AlertItems.Items.Skip(0).Take(maxPaging - 0).ToList();
     if (pagingResult.Count > 0)
     {
         var pagingItems = new ListResult<Alert>();
         pagingItems.AssignItems(pagingResult);
         presenter.AssignAlertsResult(pagingItems);
     }
 }