Пример #1
0
        public async Task <IActionResult> AddFee(StudentFeeDtoForAdd model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            string CurrentMonth = DateTime.UtcNow.ToString("MMMM") + " " + DateTime.UtcNow.Year;

            if (await _repo.PaidAlready(CurrentMonth, model.StudentId))
            {
                return(BadRequest(new { message = CustomMessage.FeeAlreadyPaid }));
            }
            _response = await _repo.AddFee(model);

            return(Ok(_response));
        }