public ActionResult Index(CmoMailboxView view, string id = null) { var mailbox = GetMailbox(view); MessageViewModel message = null; if (id != null) { message = MessagesViewModelsFactory.MessageFrom(id, mailbox);; if (message == null) { return(HttpNotFound()); } if (Request.IsAjaxRequest()) { return(PartialView("Details", message)); } } var model = MessagesViewModelsFactory.MessageCenterFrom(mailbox, message); if (Request.IsAjaxRequest()) { return(PartialView("_MailboxViewPanel", model)); } return(View(model)); }
public ActionResult Update(CmoMailboxView view, string updateAction, string[] message_ids) { int count = 0; bool error = false; foreach (var id in message_ids) { if (UpdateMessage(id, updateAction)) { count++; } else { error = true; } } SetUpdateResultMessage(updateAction, count, error); if (Request.IsAjaxRequest()) { return(PartialView(ViewName_MessagesList, MessagesViewModelsFactory.MessageCenterFrom(GetMailbox(view)).Messages)); } return(Index(view, null)); }