public SearchResultViewModelBuilder(RequestModelAccessor requestModelAccessor, ProductSearchService productSearchService, ProductItemViewModelBuilder productItemBuilder,
                                     PageSearchService pageSearchService, CategorySearchService categorySearchService)
 {
     _requestModelAccessor  = requestModelAccessor;
     _productSearchService  = productSearchService;
     _productItemBuilder    = productItemBuilder;
     _pageSearchService     = pageSearchService;
     _categorySearchService = categorySearchService;
 }
Exemplo n.º 2
0
 public CategorySearchServiceDecorator(
     CategorySearchService parent,
     SearchClientService searchClientService,
     CategoryService categoryService,
     UrlService urlService,
     RequestModelAccessor requestModelAccessor,
     PersonStorage personStorage)
 {
     _parent = parent;
     _searchClientService  = searchClientService;
     _categoryService      = categoryService;
     _urlService           = urlService;
     _requestModelAccessor = requestModelAccessor;
     _personStorage        = personStorage;
 }
Exemplo n.º 3
0
        private void toolStripTextBoxSearch_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == ( char )13)
            {
                e.Handled = true;

                // find category
                var productCategoryService = new CategorySearchService();
                List <CategoryFindContract> productCategoryContracts = productCategoryService.CategoryFind(toolStripTextBoxSearch.Text);
                productCategoryService.Close();

                if (productCategoryContracts.Count == 0)
                {
                    return;
                }

                Guid productCategoryId = productCategoryContracts[0].ProductCategoryId;

                foreach (TreeNode node in treeViewHierarchy.Nodes)
                {
                    if (new Guid(node.Name) == productCategoryId)
                    {
                        node.Expand();
                        treeViewHierarchy.SelectedNode = node;
                        SelectNode(node);
                        treeViewHierarchy.Select();
                    }

                    foreach (TreeNode subNode in node.Nodes)
                    {
                        if (new Guid(subNode.Name) == productCategoryId)
                        {
                            subNode.Parent.Expand();
                            treeViewHierarchy.SelectedNode = subNode;
                            SelectNode(subNode);
                            treeViewHierarchy.Select();
                        }
                    }
                }
            }
        }
Exemplo n.º 4
0
        private void CategoryTreeviewRefresh()
        {
            treeViewHierarchy.Nodes.Clear();

            var productCategoryService = new CategorySearchService();
            List <CategoryTreeContract> productCategoryContracts = productCategoryService.CategoryTree();

            foreach (CategoryTreeContract productCategoryContract in productCategoryContracts)
            {
                // first level is it's own parent
                if (productCategoryContract.ProductCategoryId != productCategoryContract.ProductCategoryParentId)
                {
                    continue;
                }

                TreeNode node = treeViewHierarchy.Nodes.Add(productCategoryContract.ProductCategoryId.ToString(),
                                                            productCategoryContract.ProductCategoryName);

                AddCategory(productCategoryContracts,
                            node,
                            productCategoryContract.ProductCategoryId
                            );
            }
        }
        public IController CreateController(System.Web.Routing.RequestContext requestContext, string controllerName)
        {
            IController controller = null;

            if (string.Compare(controllerName, EnumControllerName.Account.ToString(), true) == 0)
            {
                IBaseAsyncService <IHireThingsUser> service = new UserService();
                controller = new AccountController((IUserService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.Error.ToString(), true) == 0)
            {
                IBaseAsyncService <IErrorViewModel> service = new ErrorService();
                controller = new ErrorController((IErrorService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.Country.ToString(), true) == 0)
            {
                IBaseAsyncService <ICountryModel> service = new CountryService();
                controller = new CountryController((ICountryService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.CountrySearch.ToString(), true) == 0)
            {
                IBaseAsyncService <ICountrySearchViewModel> service = new CountrySearchService();
                controller = new CountrySearchController((ICountrySearchService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.LocationSearch.ToString(), true) == 0)
            {
                IBaseAsyncService <ILocationSearchViewModel> service = new LocationSearchService();
                controller = new LocationSearchController((ILocationSearchService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.Location.ToString(), true) == 0)
            {
                IBaseAsyncService <ILocationModel> service = new LocationService();
                controller = new LocationController((ILocationService)service);
            }

            else if (string.Compare(controllerName, EnumControllerName.Theme.ToString(), true) == 0)
            {
                IBaseAsyncService <IThemeModel> service = new ThemeService();
                controller = new ThemeController((IThemeService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.ThemeSearch.ToString(), true) == 0)
            {
                IBaseAsyncService <IThemeSearchViewModel> service = new ThemeSearchService();
                controller = new ThemeSearchController((IThemeSearchService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.Category.ToString(), true) == 0)
            {
                IBaseAsyncService <ICategoryModel> service = new CategoryService();
                controller = new CategoryController((ICategoryService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.CategorySearch.ToString(), true) == 0)
            {
                IBaseAsyncService <ICategorySearchViewModel> service = new CategorySearchService();
                controller = new CategorySearchController((ICategorySearchService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.EmailServerSearch.ToString(), true) == 0)
            {
                IBaseAsyncService <IEmailServerSearchViewModel> service = new EmailServerSearchService();
                controller = new EmailServerSearchController((IEmailServerSearchService)service);
            }

            else if (string.Compare(controllerName, EnumControllerName.EmailServer.ToString(), true) == 0)
            {
                IBaseAsyncService <IEmailServerModel> service = new EmailServerService();
                controller = new EmailServerController((IEmailServerService)service);
            }

            else if (string.Compare(controllerName, EnumControllerName.UserSearch.ToString(), true) == 0)
            {
                IBaseAsyncService <IUserSearchViewModel> service = new UserSearchService();
                controller = new UserSearchController((IUserSearchService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.User.ToString(), true) == 0)
            {
                IBaseAsyncService <IHireThingsUser> service = new UserService();
                controller = new UserController((IUserService)service);
            }

            else if (string.Compare(controllerName, EnumControllerName.SecurityQuestion.ToString(), true) == 0)
            {
                IBaseAsyncService <ISecurityQuestionModel> service = new SecurityQuestionService();
                controller = new SecurityQuestionController((ISecurityQuestionService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.SecurityInfo.ToString(), true) == 0)
            {
                IBaseAsyncService <ISecurityInfoViewModel> service = new SecurityInfoService();
                controller = new SecurityInfoController((ISecurityInfoService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.RoleSearch.ToString(), true) == 0)
            {
                IBaseAsyncService <IRoleSearchViewModel> service = new RoleSearchService();
                controller = new RoleSearchController((IRoleSearchService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.Role.ToString(), true) == 0)
            {
                IBaseAsyncService <IRoleModel> service = new RoleService();
                controller = new RoleController((IRoleService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.ObjectSearch.ToString(), true) == 0)
            {
                IBaseAsyncService <IObjectSearchViewModel> service = new ObjectSearchService();
                controller = new ObjectSearchController((IObjectSearchService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.Object.ToString(), true) == 0)
            {
                IBaseAsyncService <IObjectModel> service = new ObjectService();
                controller = new ObjectController((IObjectService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.Dropdown.ToString(), true) == 0)
            {
                IBaseAsyncService <IDropdownModel> service = new DropdownService();
                controller = new DropdownController((IDropdownService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.RoleObject.ToString(), true) == 0)
            {
                IBaseAsyncService <IRoleObjectViewModel> service = new RoleObjectService();
                controller = new RoleObjectController((IRoleObjectService)service);
            }

            else if (string.Compare(controllerName, EnumControllerName.Home.ToString(), true) == 0)
            {
                IBaseAsyncService <IHomeModel> service = new HomeService();
                controller = new HomeController((HomeService)service);
            }

            else if (string.Compare(controllerName, EnumControllerName.ItemDelete.ToString(), true) == 0)
            {
                IBaseAsyncService <IItemDeleteModel> service = new ItemDeleteService();
                controller = new ItemDeleteController((ItemDeleteService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.WebApiRoleSearch.ToString(), true) == 0)
            {
                IBaseAsyncService <IWebApiRoleSearchViewModel> service = new WebApiRoleSearchService();
                controller = new WebApiRoleSearchController((IWebApiRoleSearchService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.WebApiRole.ToString(), true) == 0)
            {
                IBaseAsyncService <IWebApiRoleModel> service = new WebApiRoleService();
                controller = new WebApiRoleController((IWebApiRoleService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.WebApiObjectSearch.ToString(), true) == 0)
            {
                IBaseAsyncService <IWebApiObjectSearchViewModel> service = new WebApiObjectSearchService();
                controller = new WebApiObjectSearchController((IWebApiObjectSearchService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.WebApiObject.ToString(), true) == 0)
            {
                IBaseAsyncService <IWebApiObjectModel> service = new WebApiObjectService();
                controller = new WebApiObjectController((IWebApiObjectService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.WebApiUserSearch.ToString(), true) == 0)
            {
                IBaseAsyncService <IWebApiUserSearchViewModel> service = new WebApiUserSearchService();
                controller = new WebApiUserSearchController((IWebApiUserSearchService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.WebApiUser.ToString(), true) == 0)
            {
                IBaseAsyncService <IWebApiUser> service = new WebApiUserService();
                controller = new WebApiUserController((IWebApiUserService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.WebAPIRoleObject.ToString(), true) == 0)
            {
                IBaseAsyncService <IWebAPIRoleObjectViewModel> service = new WebAPIRoleObjectService();
                controller = new WebAPIRoleObjectController((IWebAPIRoleObjectService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.Main.ToString(), true) == 0)
            {
                IBaseAsyncService <IMainModel> service = new MainService();
                controller = new MainController((MainService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.Advertisement.ToString(), true) == 0)
            {
                IBaseAsyncService <IAdvertisementModel> service = new AdvertisementService();
                controller = new AdvertisementController((AdvertisementService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.PublicAdvertisement.ToString(), true) == 0)
            {
                IBaseAsyncService <IAdvertisementModel> service = new AdvertisementService();
                controller = new PublicAdvertisementController((AdvertisementService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.PublicAdvertisementSearch.ToString(), true) == 0)
            {
                IBaseAsyncService <IAdvertisementSearchViewModel> service = new AdvertisementSearchService();
                controller = new PublicAdvertisementSearchController((AdvertisementSearchService)service);
            }
            else if (string.Compare(controllerName, EnumControllerName.PublicAccount.ToString(), true) == 0)
            {
                IBaseAsyncService <IHireThingsUser> service = new UserService();
                controller = new PublicAccountController((UserService)service);
            }
            else
            {
                throw new HttpException(404, "Page not Found");
            }


            return(controller);
        }
Exemplo n.º 6
0
 public CategorySearcher(CategorySearchService categorySearchService, RequestModelAccessor requestModelAccessor)
 {
     _requestModelAccessor  = requestModelAccessor;
     _categorySearchService = categorySearchService;
 }