예제 #1
0
 public void UpdateForumElement(ForumModel updatedForumElement)
 {
     ForumDataProvider.ExecuteNonQuery("sp_FMUpdateForumElement",
         new SqlParameter("@forumElementId", updatedForumElement.Id),
         new SqlParameter("@title", updatedForumElement.Title),
         new SqlParameter("@message", updatedForumElement.MessageText));
 }
예제 #2
0
        /****************** Async methods ******************/

        public async Task<ForumModel> CreateTopicAsync(ForumModel newTopic)
        {
            Guid id = await ForumDataProvider.ExecuteScalarAsync<Guid>("sp_FMInsertTopic",
                new SqlParameter("@ownID", newTopic.OwnerId),
                new SqlParameter("@ownType", newTopic.OwnerType),
                new SqlParameter("@tit", newTopic.Title),
                new SqlParameter("@msgText", newTopic.MessageText));

            newTopic.Id = id;

            return newTopic;
        }
예제 #3
0
        public ForumModel CreateMessage(ForumModel newMessage)
        {
            Guid id = ForumDataProvider.ExecuteScalar<Guid>("sp_FMInsertMessage",
                new SqlParameter("@parentId", newMessage.ParentId),
                new SqlParameter("@ownID", newMessage.OwnerId),
                new SqlParameter("@ownType", newMessage.OwnerType),
                new SqlParameter("@tit", newMessage.Title),
                new SqlParameter("@msgText", newMessage.MessageText));

            newMessage.Id = id;

            return newMessage;
        }
예제 #4
0
 public async Task UpdateForumElementAsync(ForumModel updatedForumElement)
 {
     await ForumDataProvider.ExecuteNonQueryAsync("sp_FMUpdateForumElement",
         new SqlParameter("@forumElementId", updatedForumElement.Id),
         new SqlParameter("@title", updatedForumElement.Title),
         new SqlParameter("@message", updatedForumElement.MessageText));
 }