Exemplo n.º 1
0
        public void Init()
        {
            Products   = new List <Product>();
            Categories = new List <Category>();
            Entity     = new Product();

            SearchEntity     = new ProductSearch();
            SearchCategories = new List <Category>();

            EventCommand        = string.Empty;
            EventArgument       = string.Empty;
            IsValid             = true;
            IsDetailAreaVisible = false;
            IsListAreaVisible   = true;
            IsSearchAreaVisible = true;
            PageMode            = PageConstants.LIST;
            Messages            = new ModelStateDictionary();
        }
Exemplo n.º 2
0
        public IHttpActionResult Search([FromBody] ProductSearch search)
        {
            IHttpActionResult ret;
            PTCViewModel      vm = new PTCViewModel();

            vm.SearchEntity = search;
            vm.Search();
            if (vm.LastException != null)
            {
                ret = BadRequest(vm.Message);
            }
            else
            {
                ret = Ok(vm.Products);
            }

            return(ret);
        }
Exemplo n.º 3
0
        public void ResetSearch()
        {
            SearchEntity = new ProductSearch();

            Get();
        }