Esempio n. 1
0
        public void CreateDetailOrder(SaveDetailOrderDto saveDetailOrderDto)
        {
            var detailorder = _mapper.Map <SaveDetailOrderDto, DetailOrder>(saveDetailOrderDto);

            _unitOfWork.DetailOrders.Add(detailorder);

            _unitOfWork.Complete();
        }
Esempio n. 2
0
        public void UpdateDetailOrder(SaveDetailOrderDto saveDetailOrderDto)
        {
            var detailorder = _unitOfWork.DetailOrders.GetBy(saveDetailOrderDto.DetailOrderId);

            if (detailorder == null)
            {
                return;
            }

            _mapper.Map <SaveDetailOrderDto, DetailOrder>(saveDetailOrderDto, detailorder);

            _unitOfWork.Complete();
        }
Esempio n. 3
0
        public IActionResult OnGet(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var detailorder = _service.GetDetailOrder(id ?? default(int));

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

            DetailOrder = _mapper.Map <DetailOrderDto, SaveDetailOrderDto>(detailorder);

            return(Page());
        }