示例#1
0
        public void PostMessage(Message message, int? parentId)
        {
            if (!_data.IsEnrolledInGroup(message.User.UserId, message.GroupId))
                throw new InvalidOperationException(string.Format("User {0} is not enrolled in group {1}", message.User.UserId, message.GroupId));

            _data.InsertMessage(message, parentId);
        }
示例#2
0
        public ActionResult PostMessage(string text, int groupId, int? parentId = null)
        {
            var session = GetSession();
            var message = new Message
            {
                GroupId = groupId,
                PostDate = DateTime.Now,
                User = new User { UserId = session.UserId },
                Value = text
            };

            Client.PostMessage(session, message, parentId);

            return new JsonResult
            {
                Data = "Ok",
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            };
        }
示例#3
0
 public void PostMessage(Authentication auth, Message message, int? parentId)
 {
     using(var business = new SocialServiceBusiness())
     {
         business.Authentication.AuthenticateUser(auth);
         business.Groups.PostMessage(message, parentId);
     }
 }
示例#4
0
 public void InsertMessage(Message message, int? parentId)
 {
     throw new NotImplementedException();
 }