コード例 #1
0
        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);
        }
コード例 #2
0
 public ConversationModel()
 {
     InterlocutorUsername = "";
     NewMessage = new MessageModel();
 }
コード例 #3
0
 public ConversationModel()
 {
     InterlocutorUsername = "";
     NewMessage           = new MessageModel();
 }