Example #1
0
        public IHttpActionResult GetCategories()
        {
            Dictionary <int, Category> categories = CategoriesHandler.GetAllCategories(db);

            if (categories.Count == 0)
            {
                return(NotFound());
            }

            return(Ok(categories));
        }
Example #2
0
        // GET: Shop
        public ActionResult Index(string sreachProduct, int?MinimumPrice, int?MaximumPrice, int?compID, int?CataId, int?SortBy, int?pageNo)
        {
            CategoriesHandler categoriesHandler = new CategoriesHandler();
            ProductHandler    productHandler    = new ProductHandler();
            CompaniesHandler  companiesHandler  = new CompaniesHandler();
            var pageSize = 9;

            PhotoGalleryViewModel model = new PhotoGalleryViewModel();

            model.FeaturedCatagories  = categoriesHandler.GetAllCategoriesForShop();
            model.FeaturedCompanieses = companiesHandler.GetAllCompanieses();

            model.searchITem = sreachProduct;
            if (SortBy.HasValue)
            {
                model.SortBy = SortBy.Value;
            }

            if (CataId.HasValue)
            {
                model.categoryId = CataId.Value;
            }

            if (compID.HasValue)
            {
                model.companyId = compID.Value;
            }

            // model.MaximumPrice = ProductsService.Instance.GetMaximumPrice();

            pageNo            = pageNo.HasValue ? pageNo.Value > 1 ? pageNo.Value : 1 : 1;
            model.ProductList = productHandler.GetShowAllProducts(sreachProduct, MinimumPrice, MaximumPrice, CataId, SortBy, pageNo.Value, pageSize, compID);

            int TotalItemCount = productHandler.GetAllProductsCount(sreachProduct, MinimumPrice, MaximumPrice, CataId, SortBy, compID);


            model.pager = new Pager(TotalItemCount, pageNo, pageSize);

            return(View(model));
        }
Example #3
0
        public ActionResult CategoryTable(string search, int?pageNo)
        {
            //ApplicationDbContext _context= new ApplicationDbContext();
            SearchCategoryViewModel model             = new SearchCategoryViewModel();
            CategoriesHandler       categoriesHandler = new CategoriesHandler();

            model.SearchItem = search;

            pageNo = pageNo.HasValue ? pageNo.Value > 0 ? pageNo.Value : 1 : 1;

            var totalRecord = categoriesHandler.GetCategoryCount(search);

            model.Categories = categoriesHandler.GetAllCategories(search, pageNo.Value);

            //model.Categories = _context.Categories.ToList();

            if (model.Categories != null)
            {
                model.Pager = new Pager(totalRecord, pageNo, 3);
                return(PartialView("_categoryTable", model));
            }
            return(PartialView("_categoryTable", model));
        }
Example #4
0
    protected override void Start()
    {
        base.Start();

        UpdateMaterials();

        if (Scene != null && Scene.Root != null)
        {
            Scene.Root.transform.parent = this.transform;
        }

        CategoriesHandler categories = new CategoriesHandler();
        MeshCache         meshCache  = new MeshCache();

        Handlers.Register(meshCache);
        Handlers.Register(categories);

        Handlers.Register(new CameraHandler());

        Handlers.Register(new ArrowHandler());
        Handlers.Register(new BoxHandler());
        Handlers.Register(new CapsuleHandler());
        Handlers.Register(new ConeHandler());
        Handlers.Register(new CylinderHandler());
        Handlers.Register(new PlaneHandler());
        Handlers.Register(new SphereHandler());
        Handlers.Register(new StarHandler());
        Handlers.Register(new MeshHandler());
        Handlers.Register(new MeshSetHandler(meshCache));
        Handlers.Register(new PointCloudHandler(meshCache));
        Handlers.Register(new PoseHandler());
        Handlers.Register(new Text2DHandler());
        Text3DHandler text3DHandler = new Text3DHandler();

        text3DHandler.CreateTextMeshHandler = this.GenerateTextMesh;
        Handlers.Register(text3DHandler);

        // Register handlers from plugins.
        string[] loadPaths = new string[]
        {
#if UNITY_EDITOR
            Path.Combine("Assets", "plugins")
#else  // UNITY_EDITOR
            "plugins",
            Path.Combine("3rd-Eye-Scene_Data", "Managed")
#endif // UNITY_EDITOR
        };

        foreach (string loadPath in loadPaths)
        {
            string[] excludeList = new string[] {
                "3esCore.dll",
                "3esRuntime.dll",
                "host*.dll",
                "System.*.dll"
            };
            Handlers.LoadPlugins(loadPath, Plugins, excludeList, new object[] {});
        }

        InitialiseHandlers();

        HandleCommandLineStart();
    }
Example #5
0
    protected override void Start()
    {
        base.Start();

        Materials.Register(MaterialLibrary.VertexColourLit, VertexColourLitMaterial);
        Materials.Register(MaterialLibrary.VertexColourUnlit, VertexColourUnlitMaterial);
        Materials.Register(MaterialLibrary.VertexColourLitTwoSided, VertexColourLitTwoSidedMaterial);
        Materials.Register(MaterialLibrary.VertexColourUnlitTwoSided, VertexColourUnlitTwoSidedMaterial);
        Materials.Register(MaterialLibrary.WireframeTriangles, WireframeTriangles);
        Materials.Register(MaterialLibrary.VertexColourTransparent, VertexColourTransparent);
        Materials.Register(MaterialLibrary.PointsLit, PointsLitMaterial);
        Materials.Register(MaterialLibrary.PointsUnlit, PointsUnlitMaterial);
        Materials.Register(MaterialLibrary.Voxels, VoxelsMaterial);

        if (Scene != null && Scene.Root != null)
        {
            Scene.Root.transform.parent = this.transform;
        }

        CategoriesHandler categories = new CategoriesHandler();
        MeshCache         meshCache  = new MeshCache();

        Handlers.Register(meshCache);
        Handlers.Register(categories);

        Handlers.Register(new CameraHandler(categories.IsActive));

        Handlers.Register(new ArrowHandler(categories.IsActive));
        Handlers.Register(new BoxHandler(categories.IsActive));
        Handlers.Register(new CapsuleHandler(categories.IsActive));
        Handlers.Register(new ConeHandler(categories.IsActive));
        Handlers.Register(new CylinderHandler(categories.IsActive));
        Handlers.Register(new PlaneHandler(categories.IsActive));
        Handlers.Register(new SphereHandler(categories.IsActive));
        Handlers.Register(new StarHandler(categories.IsActive));
        Handlers.Register(new MeshHandler(categories.IsActive));
        Handlers.Register(new MeshSetHandler(categories.IsActive, meshCache));
        Handlers.Register(new PointCloudHandler(categories.IsActive, meshCache));
        Handlers.Register(new Text2DHandler(categories.IsActive));
        Handlers.Register(new Text3DHandler(categories.IsActive));

        // Register handlers from plugins.
        string[] loadPaths = new string[]
        {
#if UNITY_EDITOR
            Path.Combine("Assets", "plugins")
#else  // UNITY_EDITOR
            "plugins",
            Path.Combine("3rd-Eye-Scene_Data", "Managed")
#endif // UNITY_EDITOR
        };

        CategoryCheckDelegate catDelegate = categories.IsActive;
        foreach (string loadPath in loadPaths)
        {
            Handlers.LoadPlugins(loadPath, Plugins, "3esRuntime.dll", new object[] { catDelegate });
        }

        InitialiseHandlers();

        categories.OnActivationChange += (ushort categoryId, bool active) =>
        {
            foreach (MessageHandler handler in Handlers.Handlers)
            {
                handler.OnCategoryChange(categoryId, active);
            }
        };

        LoadCommandLineFile();
    }