Ejemplo n.º 1
0
        public DanhSachAnPham HienThiAPTuaDeMax(DanhSachAnPham a)
        {
            DanhSachAnPham kq  = new DanhSachAnPham();
            int            max = TimAPTuaDeMax(a);

            foreach (var item in a.dsap)
            {
                if (item is Sach)
                {
                    Sach s = (Sach)item;
                    if (s.TuaDe.Length == max)
                    {
                        kq.Them(item);
                    }
                }
                if (item is TapChi)
                {
                    TapChi tc = (TapChi)item;
                    if (tc.TuaDe.Length == max)
                    {
                        kq.Them(item);
                    }
                }
            }
            return(kq);
        }
Ejemplo n.º 2
0
        private DanhSachAnPham DSTC(DanhSachAnPham a)
        {
            DanhSachAnPham kq = new DanhSachAnPham();

            foreach (var item in a.dsap)
            {
                if (item is TapChi)
                {
                    kq.Them(item);
                }
            }
            return(kq);
        }
Ejemplo n.º 3
0
        public DanhSachAnPham TCSLBVMax(DanhSachAnPham a)
        {
            DanhSachAnPham ds = new DanhSachAnPham();

            ds = DSTC(a);
            int            max = ds.TimSLBVMax();
            DanhSachAnPham kq  = new DanhSachAnPham();

            foreach (var item in ds.dsap)
            {
                if (item is TapChi)
                {
                    TapChi tc = (TapChi)item;
                    if (tc.SoBaiViet == max)
                    {
                        kq.Them(item);
                    }
                }
            }
            return(kq);
        }