async public Task <ActionResult> InitMonitor([FromBody] InitMonitorRequest request) { ActionResult result = BadRequest(); POSMonitorService monitorService = (POSMonitorService)Service.FindService <Model.POSMonitor>(); try { await monitorService.InitMonitoring(new InitMonitorArgs() { branchIdLegacy = request.branchIdLegacy }); Core.Utilities.ApiResponseBase response = new Core.Utilities.ApiResponseBase() { success = true, data = null, message = null }; result = Ok(response); } catch (Exception ex) { Core.Utilities.ApiResponseBase response = new Core.Utilities.ApiResponseBase() { success = false, data = null, message = ex.Message }; result = BadRequest(response); } return(result); }
async public Task <ActionResult> ListSummary([FromBody] Core.QueryRequest request) { ActionResult result = BadRequest(); POSBranchConfigService service = (POSBranchConfigService)Service.FindService <Model.POSBranchConfig>(); List <Criteria> criterias = new List <Criteria>(); long page = request.page == null ? -1 : request.page.Value; long size = request.size == null ? -1 : request.size.Value; try { var lista = await service.ListSummary(criterias, page, size); Core.Utilities.ApiResponseBase response = new Core.Utilities.ApiResponseBase() { success = true, data = lista, message = null }; result = Ok(response); } catch (Exception ex) { Core.Utilities.ApiResponseBase response = new Core.Utilities.ApiResponseBase() { success = false, data = null, message = ex.Message }; result = BadRequest(response); } return(result); }