コード例 #1
0
        public IActionResult Update([FromBody] MovementApplicationDTO movementApplicationDTO)
        {
            if (movementApplicationDTO == null)
            {
                return(NotFound());
            }

            MovementApplication customer = movementApplicationDTO.ConvertMovementApplicationDTOToMovementApplication();

            return(Execute(() => _baseMovementApplicationService.Update(customer)));
        }
コード例 #2
0
        public IActionResult Create([FromBody] MovementApplicationDTO movementApplicationDTO)
        {
            if (movementApplicationDTO is null)
            {
                throw new ArgumentNullException(nameof(movementApplicationDTO));
            }

            if (movementApplicationDTO == null)
            {
                return(NotFound());
            }

            MovementApplication movementApplication = movementApplicationDTO.ConvertMovementApplicationDTOToMovementApplication();

            return(Execute(() => _baseMovementApplicationService.Add <Customer>(movementApplication).Id));
        }
コード例 #3
0
        public static MovementApplication ConvertMovementApplicationDTOToMovementApplication(this MovementApplicationDTO movementApplicationDTO)
        {
            MovementApplication movementApplication = new MovementApplication();

            movementApplication.MakeApplication(movementApplicationDTO.QtLot, movementApplicationDTO.Value, Convert.ToDateTime(movementApplicationDTO.DtRegister));


            // caso seja preciso, pode ser passado o database por parâmetro e preeencher
            // os outros dados, no momento, não foi preciso

            return(movementApplication);
        }