public IHttpActionResult Search(string query) { if (!string.IsNullOrEmpty(query) && query.Length > 1) { return(Ok(ControlCategoryService.Search(query))); } else { return(Ok(new List <SimpleSearchResult>())); } }
public void Init() { _transactionScope = new TransactionScope(TransactionScopeOption.Required); _userService = new UserService(); _companyService = new CompanyService(_userService); _assetService = new AssetService(_userService); _assetSubCategoryService = new AssetSubCategoryService(); _threatCategoryService = new ThreatCategoryService(); _controlCategoryService = new ControlCategoryService(); if (HttpContext.Current == null) { SimpleWorkerRequest request = new SimpleWorkerRequest("", "", "", null, new StringWriter()); HttpContext context = new HttpContext(request); HttpContext.Current = context; } ResetAdminPassword(); HttpContext.Current.User = new GenericPrincipal(RAAPAuthProvider.ToClaimsIdentity("None", _userService.GetIdentityUserByLogin("admin", "Test123")), new string[] {}); }
public IHttpActionResult Delete(int id) { ControlCategoryService.Delete(id); return(Ok()); }
public IHttpActionResult Put([FromBody] Contracts.ControlCategory.UpdateControlCategory update) { ControlCategoryService.Update(update); return(Ok()); }
public IHttpActionResult Post([FromBody] Contracts.ControlCategory.CreateControlCategory create) { ControlCategoryService.Create(create); return(Ok()); }
public IHttpActionResult Get(int id) { var result = ControlCategoryService.GetSingle(id); return(Ok(result)); }
public IHttpActionResult Get([FromUri] PagedQuery pagedQuery) { var result = ControlCategoryService.Get(pagedQuery); return(Ok(result)); }