コード例 #1
0
ファイル: View.cs プロジェクト: mind0n/hive
		public void AddCategory(Category c)
		{
			if (!Categories.Contains(c))
			{
				Categories.Add(c);
			}
		}
コード例 #2
0
        public void Can_Get_Cat()
        {
            EFUnitOfWork ef = new EFUnitOfWork();

            var sample = new Category() { Name = "yura skaki" };

            ef.Categories.Create(sample);

            Assert.NotNull(ef.Categories.GetAll());
        }
        public void UpdateCategoryPicture(Category category)
        {
            if (category == null)
            {
                return;
            }

            using (var connection = this.GetConnection())
            {
                var categoryQueryObject = new CategoryQueryObject();
                connection.Execute(categoryQueryObject.UpdateCategoryImage(category.CategoryID, category.Picture));
            }
        }
コード例 #4
0
ファイル: View.cs プロジェクト: mind0n/hive
		public void Initialize(Category c = null)
		{
			Categories.Clear();
			if (c == null)
			{
				foreach (CategoryViewMapping i in Db.Instance.CVMappings.Mappings)
				{
					if (Guid.Equals(i.ViewId.Value, this.Id))
					{
						AddCategory(i.Category);
					}
				}
			}
			else
			{
				AddCategory(c);
			}
		}