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);
        }
Example #2
0
 public static List <CTPhieuNhapDTO> LayDanhSachCTPhieuNhap(int maPhieuNhap)
 {
     return(CTPhieuNhapDAO.LayDanhSachCTPhieuNhap(maPhieuNhap));
 }
Example #3
0
 public static bool checkTrung(string mapn, string masach)
 {
     return(CTPhieuNhapDAO.checkTrung(mapn, masach));
 }
Example #4
0
 public static void UpdateCTPhieuNhap(string mapn, string masach, int soluong, int dongia, int tongtien)
 {
     CTPhieuNhapDAO.UpdateCTPhieuNhap(mapn, masach, soluong, dongia, tongtien);
 }
Example #5
0
 public static void DeleteCTPhieuNhap(string mapn, string masach)
 {
     CTPhieuNhapDAO.DeleteCTPhieuNhap(mapn, masach);
 }
Example #6
0
 public static List <CTPhieuNhapDTO> GetCTPN(string mapn)
 {
     return(CTPhieuNhapDAO.GetCTPN(mapn));
 }