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 Details(string id) { var message = MessagesViewModelsFactory.MessageFrom(id, GetMailbox()); if (message == null || message.ID == null) { return(HttpNotFound()); } if (Request.IsAjaxRequest()) { return(PartialView(ActionName_Details, message)); } return(View(message)); }
public ActionResult Update(string id, string updateAction) { bool success = UpdateMessage(id, updateAction); SetUpdateResultMessage(updateAction, 1, !success); var message = MessagesViewModelsFactory.MessageFrom(id, GetMailbox()); if (message == null || message.ID == null) { return(HttpNotFound()); } if (Request.IsAjaxRequest()) { return(PartialView(ViewName_MessageHeader, MessagesViewModelsFactory.MessageFrom(id, GetMailbox()))); } return(Details(id)); }
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)); }