Пример #1
0
        public async Task <IActionResult> GetDivision([FromQuery] int divisionId, [FromQuery] DateTimeOffset date)
        {
            try
            {
                VerifyUser();
                var result = await _service.GetBudgetCashflowDivision(divisionId, date);

                return(Ok(new
                {
                    apiVersion = ApiVersion,
                    statusCode = General.OK_STATUS_CODE,
                    message = General.OK_MESSAGE,
                    data = result
                }));
            }
            catch (Exception e)
            {
                var result =
                    new ResultFormatter(ApiVersion, General.INTERNAL_ERROR_STATUS_CODE, e.Message)
                    .Fail();
                return(StatusCode(General.INTERNAL_ERROR_STATUS_CODE, result));
            }
        }
Пример #2
0
 public IActionResult GetBudgetCashflowByDivision([FromQuery] BudgetCashflowCategoryLayoutOrder layoutOrder, [FromQuery] int divisionId, [FromQuery] DateTimeOffset dueDate)
 {
     try
     {
         VerifyUser();
         var result = _service.GetBudgetCashflowDivision(layoutOrder, divisionId, dueDate);
         return(Ok(new
         {
             apiVersion = ApiVersion,
             statusCode = General.OK_STATUS_CODE,
             message = General.OK_MESSAGE,
             data = result
         }));
     }
     catch (Exception e)
     {
         return(StatusCode(General.INTERNAL_ERROR_STATUS_CODE, e.Message + " " + e.StackTrace));
     }
 }