Exemple #1
0
        public async Task <IActionResult> Post([FromBody] Models.Income income)
        {
            //TODO: Check problems with date...
            if (income == null)
            {
                //_logger.LogInformation($"User is empty when accessing to UserController/Post(UserDto income).");
                return(BadRequest());
            }

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var isCreated = await _incomeService.AddIncome(income);

            if (isCreated)
            {
                return(Created("", null));
            }
            else
            {
                // _logger.LogError($"Add User is not valid. Error in SaveAsync(). When accessing to UserController/Post");
                return(StatusCode(500, "A problem happend while handling your request."));
            }
        }
Exemple #2
0
        public virtual ActionResult AddIncome([FromBody] Income income)
        {
            var tempIncome = income;

            tempIncome.UserId = _idLoggedUser;

            return(Json(_incomeService.AddIncome(tempIncome), JsonRequestBehavior.AllowGet));
        }
Exemple #3
0
 public void Post([FromBody] IncomeModel model)
 {
     service.AddIncome(model);
 }
Exemple #4
0
        public async Task <IActionResult> AddIncome([FromBody] RecordAddRequestModel model)
        {
            var response = await _incomeService.AddIncome(model);

            return(Ok(response));
        }
Exemple #5
0
        public async Task <IActionResult> Purchase([FromBody] IncomeRequestModel incomeRequestModel)
        {
            await _incomeService.AddIncome(incomeRequestModel);

            return(Ok());
        }
        public async Task <IActionResult> Add(IncomeRequestModel model)
        {
            var income = await _incomeService.AddIncome(model);

            return(Ok(income));
        }
Exemple #7
0
        public async Task <ActionResult> CreateIncome([FromBody] IncomeRequestModel incomeRequest)
        {
            await _incomeService.AddIncome(incomeRequest);

            return(Ok());
        }