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(); }
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); }
public void ResetSearch() { SearchEntity = new ProductSearch(); Get(); }