Example #1
0
 public IHttpActionResult Search(string query)
 {
     if (!string.IsNullOrEmpty(query) && query.Length > 1)
     {
         return(Ok(AssetSubCategoryService.Search(query)));
     }
     else
     {
         return(Ok(new List <SimpleSearchResult>()));
     }
 }
Example #2
0
        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[] {});
        }
Example #3
0
 public IHttpActionResult Delete(int id)
 {
     AssetSubCategoryService.Delete(id);
     return(Ok());
 }
Example #4
0
 public IHttpActionResult Put([FromBody] Contracts.AssetSubCategory.UpdateAssetSubCategory update)
 {
     AssetSubCategoryService.Update(update);
     return(Ok());
 }
Example #5
0
 public IHttpActionResult Post([FromBody] Contracts.AssetSubCategory.CreateAssetSubCategory create)
 {
     AssetSubCategoryService.Create(create);
     return(Ok());
 }
Example #6
0
        public IHttpActionResult Get(int id)
        {
            var result = AssetSubCategoryService.GetSingle(id);

            return(Ok(result));
        }
Example #7
0
        public IHttpActionResult Get([FromUri] PagedQuery pagedQuery)
        {
            var result = AssetSubCategoryService.Get(pagedQuery);

            return(Ok(result));
        }