public static int GetTonKho(int maChiTietSanPham) { List <KHO_HANG> khs = KHO_HANG.select(" where MA_CHI_TIET_SAN_PHAM = " + maChiTietSanPham + " "); int tongCong = 0; for (int i = 0; i < khs.Count; i++) { tongCong += khs[i].CON_LAI; } return(tongCong); }
public static KHO_HANG LayKhoHang(int maKho) { try { return(KHO_HANG.select(" where MA_KHO = " + maKho + " ")[0]); } catch (Exception) { return(null); } }