public static bool KhoiPhucPhieuNhap(int maPhieuNhap, List <CTPhieuNhapDTO> lsCTPhieuNhap) { if (PhieuNhapDAO.KhoiPhucPhieuNhap(maPhieuNhap)) { foreach (CTPhieuNhapDTO ctpn in lsCTPhieuNhap) { if (!NguyenLieuDAO.TangSoLuongTonKho(ctpn)) { return(false); } } } return(true); }
public static bool LuuPhieuNhap(PhieuNhapDTO phieuNhap, List <CTPhieuNhapDTO> lsCTPhieuNhap) { if (!PhieuNhapDAO.LuuPhieuNhap(phieuNhap)) { return(false); } foreach (CTPhieuNhapDTO ctpn in lsCTPhieuNhap) { if (!CTPhieuNhapDAO.LuuCTPhieuNhap(ctpn)) { return(false); } if (!NguyenLieuDAO.TangSoLuongTonKho(ctpn)) { return(false); } } return(true); }