public CategoryInfo GetEntity()
        {
            CategoryInfo category = new CategoryInfo();

            category.ID = this.ID;
            category.CategoryName = this.CategoryName;

            ICategoryInfoDataProvider dataProvider = new CategoryInfoDataProvider();
            CategoryInfo parentCatagory = dataProvider.GetCategoryByID(this.CategorySelectedID);
            if (parentCatagory != null)
            {
                category.ParentCategoryInfo = parentCatagory;
            }

            return category;
        }
        public static CategoryModel GetViewModel(CategoryInfo category)
        {
            CategoryModel model = new CategoryModel();

            model.ID = category.ID;
            model.CategoryName = category.CategoryName;
            model.ParentCategoryName = DropDownListHelper.GetParentCategoryName(category);

            ICategoryInfoDataProvider dataProvider = new CategoryInfoDataProvider();

            if (category.BookAndCategorys.Count > 0
                ||dataProvider.GetCategoryListByParentID(category.ID).Count() > 0 )
            {
                model.IsUse = true;
            }

            return model;
        }