public async Task <IActionResult> Import([FromBody] IEnumerable <ValueObject> valueObjects) { try { if (ModelState.IsValid) { HttpResponseMessageResult res = new HttpResponseMessageResult() { IsSuccess = true }; IEnumerable <long> data = await Adapter.Import(valueObjects); res.GetObjectForJson(data); return(Ok(res)); } HttpResponseMessageResult err = new HttpResponseMessageResult() { IsSuccess = false }; foreach (ModelError mdErr in ModelState.Values.SelectMany(v => v.Errors)) { err.Message += $"{mdErr?.ErrorMessage} : {mdErr?.Exception?.Message}"; } return(StatusCode(500, err)); } catch (Exception ex) { Logger.LogError(LoggingEvents.PROCESS_ERROR, ex, ex.Message); return(StatusCode(500, ex.Message)); } }
public async Task <IActionResult> Add([FromBody] ConstraintParameter constraintParameter, long constraintSequenceId) { try { HttpResponseMessageResult res = new HttpResponseMessageResult() { IsSuccess = true }; constraintParameter = await Adapter.AddConstraintParameter(constraintParameter, constraintSequenceId); res.GetObjectForJson(constraintParameter); return(Ok(res)); } catch (Exception ex) { Logger.LogError(LoggingEvents.CRITICAL_ERROR, ex, ex.Message); return(StatusCode(500, ex.Message)); } }
public async Task <IActionResult> AddDataSetDimension([FromBody] DataSetDimension dataSetDimension, long dataSetId, long dimensionId) { try { HttpResponseMessageResult res = new HttpResponseMessageResult() { IsSuccess = true }; dataSetDimension = await Adapter.AddDataSetDimension(dataSetDimension, dataSetId, dimensionId); res.GetObjectForJson(dataSetDimension); return(Ok(res)); } catch (Exception ex) { Logger.LogError(LoggingEvents.CRITICAL_ERROR, ex, ex.Message); return(StatusCode(500, ex.Message)); } }
public async Task <IActionResult> GetDimensionById(long dimensionId) { try { HttpResponseMessageResult res = new HttpResponseMessageResult() { IsSuccess = true }; Dimension dimension = await DimensionAdapter.GetById(dimensionId); res.GetObjectForJson(dimension); return(Ok(res)); } catch (Exception ex) { Logger.LogError(LoggingEvents.CRITICAL_ERROR, ex, ex.Message); return(StatusCode(500, ex.Message)); } }
public async Task <IActionResult> GetAllDimension() { try { HttpResponseMessageResult res = new HttpResponseMessageResult() { IsSuccess = true }; IEnumerable <Dimension> lst = await DimensionAdapter.GetAll(); res.GetObjectForJson(lst); return(Ok(res)); } catch (Exception ex) { Logger.LogError(LoggingEvents.CRITICAL_ERROR, ex, ex.Message); return(StatusCode(500, ex.Message)); } }
public async Task <IActionResult> AddWorkflowDimension(long workflowConfigId, [FromBody] WorkflowDimension workflowDimension) { try { HttpResponseMessageResult res = new HttpResponseMessageResult() { IsSuccess = true }; workflowDimension = await Adapter.AddWorkflowDimension(workflowConfigId, workflowDimension); res.GetObjectForJson(workflowDimension); return(Ok(res)); } catch (Exception ex) { Logger.LogError(LoggingEvents.CRITICAL_ERROR, ex.Message, ex); return(StatusCode(500, ex.Message)); } }
public async Task <IActionResult> Get() { try { HttpResponseMessageResult res = new HttpResponseMessageResult() { IsSuccess = true }; IEnumerable <TModel> dtos = await Adapter.GetAll(); res.GetObjectForJson(dtos); return(Ok(res)); } catch (Exception ex) { Logger.LogError(LoggingEvents.PROCESS_ERROR, ex, ex.Message); return(StatusCode(500, ex.Message)); } }
public async Task <IActionResult> Add([FromBody] DTO.Action action) { try { HttpResponseMessageResult res = new HttpResponseMessageResult() { IsSuccess = true }; action = await Adapter.AddAction(action); res.GetObjectForJson(action); return(Ok(res)); } catch (Exception ex) { Logger.LogError(LoggingEvents.CRITICAL_ERROR, ex, ex.Message); return(StatusCode(500, ex.Message)); } }
public async Task <IActionResult> GetUsers(long userSetId) { try { HttpResponseMessageResult res = new HttpResponseMessageResult() { IsSuccess = true }; List <User> users = await Adapter.GetUsers(userSetId); res.GetObjectForJson(users); return(Ok(res)); } catch (Exception ex) { Logger.LogError(LoggingEvents.PROCESS_ERROR, ex, ex.Message); return(StatusCode(500, ex.Message)); } }
public async Task <IActionResult> AddUserSet([FromBody] UserSet userSet) { try { HttpResponseMessageResult res = new HttpResponseMessageResult() { IsSuccess = true }; userSet = await Adapter.Add(userSet); res.GetObjectForJson(userSet); return(Ok(res)); } catch (Exception ex) { Logger.LogError(LoggingEvents.PROCESS_ERROR, ex, ex.Message); return(StatusCode(500, ex.Message)); } }
public async Task <IActionResult> ImportUsers([FromBody] IEnumerable <User> users) { try { HttpResponseMessageResult res = new HttpResponseMessageResult() { IsSuccess = true }; IEnumerable <long> data = await Adapter.Import(users); res.GetObjectForJson(data); return(Ok(res)); } catch (Exception ex) { Logger.LogError(LoggingEvents.CRITICAL_ERROR, ex, ex.Message); return(StatusCode(500, ex.Message)); } }
public async Task <IActionResult> AddGridConfig(long workflowConfigId, [FromBody] GridConfig gridConfig) { try { HttpResponseMessageResult res = new HttpResponseMessageResult() { IsSuccess = true }; gridConfig = await Adapter.Add(workflowConfigId, gridConfig); res.GetObjectForJson(gridConfig); return(Ok(res)); } catch (Exception ex) { Logger.LogError(LoggingEvents.PROCESS_ERROR, ex, ex.Message); return(StatusCode(500, ex.Message)); } }
public async Task <IActionResult> AddGridDimensionConfig([FromBody] GridDimensionConfig gridDimensionConfig, long?gcColumnId = null, long?gcRowId = null, long?gcFixedId = null) { try { HttpResponseMessageResult res = new HttpResponseMessageResult() { IsSuccess = true }; gridDimensionConfig = await Adapter.Add(gridDimensionConfig, gcColumnId, gcRowId, gcFixedId); res.GetObjectForJson(gridDimensionConfig); return(Ok(res)); } catch (Exception ex) { Logger.LogError(LoggingEvents.PROCESS_ERROR, ex, ex.Message); return(StatusCode(500, ex.Message)); } }
public async Task <IActionResult> GetSelectorInstanceByValidator(long validatorId, long workflowInstanceId) { try { HttpResponseMessageResult res = new HttpResponseMessageResult() { IsSuccess = true }; IEnumerable <SelectorInstance> lstSI = await Adapter.GetSelectorInstanceByValidator(validatorId, workflowInstanceId); if (lstSI != null) { res.GetObjectForJson(lstSI); } return(Ok(res)); } catch (Exception ex) { Logger.LogError(LoggingEvents.CRITICAL_ERROR, ex, ex.Message); return(StatusCode(500, ex.Message)); } }
public async Task <IActionResult> GetWorkflowInstance(long userId) { try { HttpResponseMessageResult res = new HttpResponseMessageResult() { IsSuccess = true }; IEnumerable <WorkflowInstance> wfIns = await Adapter.GetWorkflowInstance(userId); if (wfIns != null) { res.GetObjectForJson(wfIns); } return(Ok(res)); } catch (Exception ex) { Logger.LogError(LoggingEvents.CRITICAL_ERROR, ex, ex.Message); return(StatusCode(500, ex.Message)); } }
public async Task <IActionResult> GetByLogin(string login) { try { HttpResponseMessageResult res = new HttpResponseMessageResult() { IsSuccess = true }; User user = await Adapter.GetByLogin(login); if (user != null) { res.GetObjectForJson(user); } return(Ok(res)); } catch (Exception ex) { Logger.LogError(LoggingEvents.CRITICAL_ERROR, ex, ex.Message); return(StatusCode(500, ex.Message)); } }