Esempio n. 1
0
        public void DeleteMessage(int id)
        {
            var userId = User.Identity.GetUserId();
            var com    = new SingleCommunication();

            com.SetMessageStatus(MessageStatus.Deleted, userId, id);

            foreach (
                var message in
                from @group in AllMessages from message in @group where message.MessageId == id select message)
            {
                message.Status = MessageStatus.Deleted;
            }
        }
Esempio n. 2
0
        public PartialViewResult _Read(int id)
        {
            var userId  = User.Identity.GetUserId();
            var com     = new SingleCommunication();
            var message = com.GetMessage(id);

            com.SetMessageStatus(MessageStatus.Read, userId, id);
            var model = new MessageViewModel();

            if (message != null)
            {
                foreach (var mes in from @group in AllMessages from mes in @group where mes.MessageId == id select mes)
                {
                    mes.Status = MessageStatus.Read;
                }
                model.Id          = id;
                model.Subject     = message.Subject;
                model.Text        = message.Text;
                model.TimeCreated = message.TimeCreated;
            }
            return(PartialView(model));
        }