public void CreateHoadon(SaveHoadonDto saveHoadonDto) { var hoadon = _mapper.Map <SaveHoadonDto, Hoadon>(saveHoadonDto); _unitOfWork.Hoadons.Add(hoadon); _unitOfWork.Complete(); }
public void UpdateHoadon(SaveHoadonDto saveHoadonDto) { var hoadon = _unitOfWork.Hoadons.GetBy(saveHoadonDto.HoadonId); if (hoadon == null) { return; } _mapper.Map <SaveHoadonDto, Hoadon>(saveHoadonDto, hoadon); _unitOfWork.Complete(); }
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()); }