예제 #1
0
        public void CreateHoadon(SaveHoadonDto saveHoadonDto)
        {
            var hoadon = _mapper.Map <SaveHoadonDto, Hoadon>(saveHoadonDto);

            _unitOfWork.Hoadons.Add(hoadon);

            _unitOfWork.Complete();
        }
예제 #2
0
        public void UpdateHoadon(SaveHoadonDto saveHoadonDto)
        {
            var hoadon = _unitOfWork.Hoadons.GetBy(saveHoadonDto.HoadonId);

            if (hoadon == null)
            {
                return;
            }

            _mapper.Map <SaveHoadonDto, Hoadon>(saveHoadonDto, hoadon);

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

            var hoadon = _service.GetHoadon(id ?? default(int));

            if (hoadon == null)
            {
                return(NotFound());
            }
            Hoadon = _mapper.Map <HoadonDto, SaveHoadonDto>(hoadon);
            return(Page());
        }