public static bool SuaHangHoa(HangHoaDTO hh) { if (string.IsNullOrEmpty(hh.TenHangHoa)) { return(false); } bool test = HangHoaDAO.SuaHangHoa(hh); return(test); }
public static HangHoaDTO LayChiTietHangHoa(int MaHangHoa) { HangHoaDTO hanghoa = null; List <HangHoaDTO> lst = new List <HangHoaDTO>(); lst = HangHoaDAO.LayTatCaHangHoa(); foreach (HangHoaDTO hh in lst) { if (hh.MaHangHoa == MaHangHoa) { hanghoa = hh; break; } } return(hanghoa); }
public static bool ThemHangHoa(HangHoaDTO hh) { if (string.IsNullOrEmpty(hh.TenHangHoa)) { return(false); } bool test = HangHoaDAO.ThemHangHoa(hh); if (test == true) { int MaHangHoa = 0; MaHangHoa = HangHoaDAO.LayMaHangHoaMoiNhat(); KhoHangBUS.ThemHangHoaVaoTungKho(MaHangHoa); } return(test); }
public static bool XoaKhoHang(HangHoaDTO hh) { return(HangHoaDAO.XoaHangHoa(hh)); }