示例#1
0
        public PartialViewResult AjaxAnswer(int id, AnswerMessageForm collection)
        {
            MessageService repoMessage = new MessageService();

            CD.Message answer = repoMessage.Answer(new CD.Message()
            {
                Title      = collection.Title,
                Text       = collection.Message,
                EmployeeId = UserSession.CurrentUser.Id
            }, collection.MessageId);
            Subject subject = new Subject(repoMessage.GetConversation(id).Select(m => new MessageListItem(new M.Message(m))));

            return(PartialView("_Subject", subject));
        }
示例#2
0
        public PartialViewResult AjaxAnswer(int id, AnswerMessageForm collection)
        {
            MessageService  repoMessage = new MessageService();
            EmployeeService repoEmp     = new EmployeeService();

            CD.Message answer = repoMessage.Answer(new CD.Message()
            {
                Title      = collection.Title,
                Text       = collection.Message,
                EmployeeId = UserSession.CurrentUser.Id
            }, collection.MessageId);
            IEnumerable <MessageListItem> messages     = repoMessage.GetConversation(id).Select(m => new MessageListItem(new M.Message(m)));
            IEnumerable <M.CurrentOn>     participants = repoEmp.GetByMessageId(id).Select(e => new M.CurrentOn(e));
            Messaging messaging = new Messaging(messages, participants);

            return(PartialView("_Messaging", messaging));
        }
示例#3
0
 public ActionResult Answer(int id, AnswerMessageForm collection)
 {
     try
     {
         if (ModelState.IsValid)
         {
             MessageService repoMessage = new MessageService();
             CD.Message     m           = repoMessage.Answer(new CD.Message()
             {
                 Title      = collection.Title,
                 Text       = collection.Message,
                 EmployeeId = UserSession.CurrentUser.Id
             }, id);
             return(RedirectToAction("Details", new { id = m.Id }));
         }
         return(View(collection));
     }
     catch
     {
         return(View(collection));
     }
 }