public override Category CreateCategory(string name, string displayName) { using (var transaction = new TransactionScope(Configuration)) { var dataStore = new CategoryDataStore(transaction); var category = new Category(name, displayName); dataStore.Insert(category); transaction.Commit(); return category; } }
public static IList<Topic> GetTopics(Category category, PagingInfo paging) { return Provider.GetTopics(category, paging); }
public static IList<Topic> GetTopics(Category category, DateTime fromDate, DateTime toDate) { return Provider.GetTopics(category, fromDate, toDate); }
public static void DeleteCategory(Category category) { Provider.DeleteCategory(category); }
/// <summary> /// Create the topic and the relative root message. /// </summary> /// <param name="category"></param> /// <param name="owner"></param> /// <param name="title"></param> /// <param name="body"></param> /// <param name="attachment">Use null if you don't have any attachment</param> /// <param name="topic">Returns the topic created</param> /// <param name="rootMessage">Returns the message created</param> public static void CreateTopic(Category category, string owner, string title, string body, Attachment.FileInfo attachment, out Topic topic, out Message rootMessage) { Provider.CreateTopic(category, owner, title, body, attachment, out topic, out rootMessage); }
public abstract void UpdateCategory(Category category);
public abstract IList<Topic> GetTopics(Category category, PagingInfo paging);
/// <summary> /// Create the topic and the relative root message. /// </summary> /// <param name="category"></param> /// <param name="owner"></param> /// <param name="title"></param> /// <param name="body"></param> /// <param name="attachment">Use null if you don't have any attachment</param> /// <param name="topic">Returns the topic created</param> /// <param name="rootMessage">Returns the message created</param> public override void CreateTopic(Category category, string owner, string title, string body, Attachment.FileInfo attachment, out Topic topic, out Message rootMessage) { //Check attachment if (attachment != null) Attachment.FileHelper.CheckFile(attachment, category.AttachExtensions, category.AttachMaxSize); using (TransactionScope transaction = new TransactionScope(Configuration)) { CategoryDataStore forumStore = new CategoryDataStore(transaction); forumStore.Attach(category); //Insert topic TopicDataStore topicStore = new TopicDataStore(transaction); topic = new Topic(category, owner, title); topicStore.Insert(topic); //Insert root message MessageDataStore messageStore = new MessageDataStore(transaction); rootMessage = new Message(topic, null, owner, title, body, attachment); messageStore.Insert(rootMessage); transaction.Commit(); } }
public abstract void DeleteCategory(Category category);
/// <summary> /// Create the topic and the relative root message. /// </summary> /// <param name="category"></param> /// <param name="owner"></param> /// <param name="title"></param> /// <param name="body"></param> /// <param name="attachment">Use null if you don't have any attachment</param> /// <param name="topic">Returns the topic created</param> /// <param name="rootMessage">Returns the message created</param> public abstract void CreateTopic(Category category, string owner, string title, string body, Attachment.FileInfo attachment, out Topic topic, out Message rootMessage);
public override void UpdateCategory(Category category) { using (TransactionScope transaction = new TransactionScope(Configuration)) { CategoryDataStore dataStore = new CategoryDataStore(transaction); dataStore.Update(category); transaction.Commit(); } }
public override IList<Topic> GetTopics(Category category, PagingInfo paging) { using (TransactionScope transaction = new TransactionScope(Configuration)) { TopicDataStore dataStore = new TopicDataStore(transaction); return dataStore.Find(category, paging); } }
public override IList<Topic> GetTopics(Category category, DateTime fromDate, DateTime toDate) { using (TransactionScope transaction = new TransactionScope(Configuration)) { TopicDataStore dataStore = new TopicDataStore(transaction); return dataStore.Find(category, fromDate, toDate); } }
public static void UpdateCategory(Category category) { Provider.UpdateCategory(category); }
public abstract IList<Topic> GetTopics(Category category, DateTime fromDate, DateTime toDate);
/// <summary> /// Create the topic and the relative root message. /// </summary> /// <param name="category"></param> /// <param name="owner"></param> /// <param name="title"></param> /// <param name="body"></param> /// <param name="attachment">Use null if you don't have any attachment</param> /// <param name="topic">Returns the topic created</param> /// <param name="rootMessage">Returns the message created</param> public static void CreateTopic(Category category, string owner, string title, string body, Attachment.FileInfo attachment) { Topic tp; Message msg; CreateTopic(category, owner, title, body, attachment, out tp, out msg); }
public Topic(Category pCategory, string pOwner, string pTitle) { Category = pCategory; Owner = pOwner; Title = pTitle; }