Exemplo n.º 1
0
 public ActionResult Create(EnvironmentScanningViewModel.CreateViewModel viewModel)
 {
     var request = viewModel.MapTo<SaveEnvironmentScanningRequest>();
     var response = _environmentScanningService.SaveEnvironmentScanning(request);
     var data = new
     {
         id = response.Id,
         description = response.Description,
         type = viewModel.Type
     };
     return Json(data, JsonRequestBehavior.AllowGet);
 }
Exemplo n.º 2
0
        public ActionResult CreateConstraint(EnvironmentScanningViewModel.Constraint viewModel)
        {
            var request = viewModel.MapTo<SaveConstraintRequest>();
            var response = _environmentScanningService.SaveConstraint(request);
            var data = new
            {
                id = response.Id,
                type = response.Type,
                category = response.Category,
                categoryId = response.CategoryId,
                definition = response.Definition,
                relationids = response.RelationIds,
                threatIds = response.ThreatIds,
                opportunityIds = response.OpportunityIds,
                weaknessIds = response.WeaknessIds,
                strengthIds = response.StrengthIds
            };

            return Json(data, JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 3
0
 public ActionResult DeleteEnvironmental(EnvironmentScanningViewModel.DeleteViewModel viewModel)
 {
     var response = _environmentScanningService.DeleteEnvironmentalScanning(new DeleteEnvironmentScanningRequest { Id = viewModel.Id });
     return Json(new { success = response.IsSuccess });
 }