public ActionResult SendMessage(MessageModel model) { if (ModelState.IsValid) { DialogRepository dialogRepository = new DialogRepository(); dialogRepository.SendMessage(new DialogModel { SenderID = _convModel.CurrentUserID, RecepientID = _convModel.InterlocutorID, DateTime = DateTime.Now, Subject = model.Subject, MessageText = model.MessageText }); } else { ModelState.AddModelError("", "Message was not sent."); } return RedirectToAction("Index", _convModel.InterlocutorID); }
public ConversationModel() { InterlocutorUsername = ""; NewMessage = new MessageModel(); }