Exemple #1
0
        public static bool SuaHangHoa(HangHoaDTO hh)
        {
            if (string.IsNullOrEmpty(hh.TenHangHoa))
            {
                return(false);
            }
            bool test = HangHoaDAO.SuaHangHoa(hh);

            return(test);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
 public static bool XoaKhoHang(HangHoaDTO hh)
 {
     return(HangHoaDAO.XoaHangHoa(hh));
 }