public ActionResult Send(string id, int p = 0) { MessageSendView model = new MessageSendView { RecipientID = id }; model.FriendsDropDownList = _taService.ListFriends(p * PAGE_SIZE, PAGE_SIZE).ConvertToSelectListItemList(); return View(model); }
public ActionResult Send(MessageSendView model) { string recipientId = model.RecipientID; if (ModelState.IsValid) { model = _taService.SendMessage(model); if (model.Success) { TempData["NotificationMessage"] = "Message successfully sent!"; return RedirectToAction("Index"); } else { ModelState.AddModelError("", model.ResponseMessage); } } model.RecipientID = recipientId; return View(model); }
public MessageSendView SendMessage(MessageSendView view) { SendMessageRequest request = (SendMessageRequest)GetMappedObject(view, typeof(SendMessageRequest)); return (MessageSendView)GetMappedObject(_travelersAroundService.SendMessage(request), typeof(MessageSendView)); }