public IActionResult NotDelUser(string UserId) { var all_deployments_list = new List <Deployment>(_DeploymentService.Get()); var deployments_z_userem_do_kasacji = new List <Deployment>(); foreach (var document in all_deployments_list) { if (document.SchemaCreatedByUserId == UserId) { deployments_z_userem_do_kasacji.Add(document); } } var document_list_toDisplay = new List <DeploymentToDisplay>(); foreach (var document in deployments_z_userem_do_kasacji) { var document_toDisplay = new DeploymentToDisplay(document, _ProjectService, _DatabaseService, _Userservice); document_list_toDisplay.Add(document_toDisplay); } var viewModel = new ShowAllDeploymentViewModel() { DeploymentToDisplay_List = document_list_toDisplay }; return(View(viewModel)); }
public IActionResult ShowAllDeployment() { var deployment_list = new List <Deployment>(_DeploymentService.Get()); var document_list_toDisplay = new List <DeploymentToDisplay>(); foreach (var document in deployment_list) { var document_toDisplay = new DeploymentToDisplay(document, _ProjectService, _DatabaseService, _Userservice); document_list_toDisplay.Add(document_toDisplay); } var viewModel = new ShowAllDeploymentViewModel() { DeploymentToDisplay_List = document_list_toDisplay }; return(View(viewModel)); }
public IActionResult DelDeployment(string DeploymentId) { var document = _DeploymentService.Get(DeploymentId); if (document == null) { return(NotFound()); } var document_toDisplay = new DeploymentToDisplay(document, _ProjectService, _DatabaseService, _Userservice); _DeploymentService.Remove(document.DeploymentId); var deployment_list = new List <DeploymentToDisplay>(); deployment_list.Add(document_toDisplay); var viewModel = new ShowAllDeploymentViewModel() { DeploymentToDisplay_List = deployment_list }; return(View(viewModel)); }
public IActionResult AddDeployment (string Name, string DeployMode, DateTime PlannedTimeOfDeployment, DateTime TimeOfDeployment, string Details, Boolean HasBeenDeployed, string AttachedFeatureDescription, string SchemaContent, string TargetDbId, string SchemaCreatedByUserId, string AttachedToProjectId) { var document = new Deployment(Name, DeployMode, PlannedTimeOfDeployment, TimeOfDeployment, Details, HasBeenDeployed, AttachedFeatureDescription, SchemaContent, TargetDbId, SchemaCreatedByUserId, AttachedToProjectId); var deployment_list = new List <Deployment>(); deployment_list.Add(_DeploymentService.Create(document)); var document_toDisplay = new DeploymentToDisplay(document, _ProjectService, _DatabaseService, _Userservice); var document_list_toDisplay = new List <DeploymentToDisplay>(); document_list_toDisplay.Add(document_toDisplay); var viewModel = new ShowAllDeploymentViewModel() { DeploymentToDisplay_List = document_list_toDisplay }; return(View(viewModel)); }