public void CongSoLuong(MayTinh mt, int sl) { MayTinhDAL mt_DAL = new MayTinhDAL(); if (KT_MaMayTinh(mt.maMT) == true) { mt_DAL.Update_Add(mt, sl); } else { throw new Exception("Không tồn tại mã này."); } }
public void SL_Het(int x, int y, ConsoleColor background_color, ConsoleColor text_color) { Console.BackgroundColor = background_color; Console.ForegroundColor = text_color; MayTinhDAL mtDAL = new MayTinhDAL(); List <MayTinh> ds = mtDAL.GetData(); List <MayTinh> kq = new List <MayTinh>(); Console.Clear(); IO.Box(0, 0, 28, 114, ConsoleColor.Black, ConsoleColor.White); for (int i = 0; i < ds.Count; i++) { if (ds[i].sLCon == 0) { kq.Add(ds[i]); } } IO.Writexy(" DANH SÁCH MÁY TÍNH HẾT", x, y + 1); Hien(x + 11, y + 2, kq, 5, 1); }