示例#1
0
 public static Item CreateItem(Category category, string owner,
                                 string title, string description,
                                 string url, string urlName,
                                 DateTime newsDate)
 {
     return Provider.CreateItem(category, owner, title, description, url, urlName, newsDate);
 }
        public override void DeleteCategory(Category category)
        {
            using (TransactionScope transaction = new TransactionScope(mConfiguration))
            {
                CategoryDataStore dataStore = new CategoryDataStore(transaction);

                dataStore.Delete(category.Id);

                transaction.Commit();
            }
        }
示例#3
0
 public Item(Category pCategory, string pOwner, 
                 string pTitle, string pDescription,
                 string pURL, string pURLName, DateTime pNewsDate)
 {
     Owner = pOwner;
     Title = pTitle;
     Author = pOwner;
     Category = pCategory;
     Description = pDescription;
     URL = pURL;
     URLName = pURLName;
     NewsDate = pNewsDate;
 }
        public override Category CreateCategory(string name, string displayName)
        {
            using (TransactionScope transaction = new TransactionScope(mConfiguration))
            {
                CategoryDataStore dataStore = new CategoryDataStore(transaction);

                Category category = new Category(name, displayName);

                dataStore.Insert(category);

                transaction.Commit();

                return category;
            }
        }
        public override Item CreateItem(Category category, string owner,
                                        string title, string description,
                                        string url, string urlName, 
                                        DateTime newsDate)
        {
            using (TransactionScope transaction = new TransactionScope(mConfiguration))
            {
                ItemDataStore dataStore = new ItemDataStore(transaction);

                Item item = new Item(category, owner, title, description, url, urlName, newsDate);

                dataStore.Insert(item);

                transaction.Commit();

                return item;
            }
        }
示例#6
0
 public static void DeleteCategory(Category category)
 {
     Provider.DeleteCategory(category);
 }
示例#7
0
 public static void UpdateCategory(Category category)
 {
     Provider.UpdateCategory(category);
 }
示例#8
0
 public static IList<Item> GetItems(Category category, PagingInfo paging)
 {
     return Provider.GetItems(category, paging);
 }
        public override IList<Item> GetItems(Category category, PagingInfo paging)
        {
            using (TransactionScope transaction = new TransactionScope(mConfiguration))
            {
                ItemDataStore dataStore = new ItemDataStore(transaction);

                return dataStore.FindByCategory(category, paging);
            }
        }
示例#10
0
 public abstract void UpdateCategory(Category category);
示例#11
0
 public abstract IList<Item> GetItems(Category category,
                                     PagingInfo paging);
示例#12
0
 public abstract void DeleteCategory(Category category);
示例#13
0
 public abstract Item CreateItem(Category category, string owner,
                                 string title, string description,
                                 string url, string urlName,
                                 DateTime newsDate);