Ejemplo n.º 1
0
        public void XoaDSTheoNXB()
        {
            string Nhap;

            Console.WriteLine("Nhap ten NXB Can xoa an pham (NXBGD,NXBVN,NXBKD): ");
            Nhap = Console.ReadLine();
            for (int j = 0; j < 2; j++)
            {
                for (int i = 0; i < DSSach.Dai; i++)
                {
                    if (Nhap.CompareTo(DSSach[i].nxb) == 0)
                    {
                        DSSach.Xoa(DSSach[i]);
                    }
                }
                for (int i = 0; i < DSBao.Dai; i++)
                {
                    if (Nhap.CompareTo(DSBao[i].nxb) == 0)
                    {
                        DSBao.Xoa(DSBao[i]);
                    }
                }
                for (int i = 0; i < DSTapChi.Dai; i++)
                {
                    if (Nhap.CompareTo(DSTapChi[i].nxb) == 0)
                    {
                        DSTapChi.Xoa(DSTapChi[i]);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void TimTheoNXB()
        {
            string Nhap;

            Console.WriteLine("Nhap ten NXB can tim an pham (NXBGD,NXBVN,NXBKD): ");
            Nhap = Console.ReadLine();
            Console.WriteLine("======================");
            Console.WriteLine("Danh sach an pham cua nxb: {0}", Nhap);
            Console.WriteLine("======================");
            Console.WriteLine("Tua De".PadRight(10) + "So trang".PadRight(10) + "NXB".PadRight(10));
            Console.WriteLine("======================");
            for (int i = 0; i < DSSach.Dai; i++)
            {
                if (Nhap.CompareTo(DSSach[i].nxb) == 0)
                {
                    Console.WriteLine(DSSach[i]);
                }
            }
            Console.WriteLine("So trang".PadRight(11) + "NXB".PadRight(10));
            Console.WriteLine("======================");
            for (int i = 0; i < DSBao.Dai; i++)
            {
                if (Nhap.CompareTo(DSBao[i].nxb) == 0)
                {
                    Console.WriteLine(DSBao[i]);
                }
            }
            Console.WriteLine("Tua De".PadRight(10) + "So trang".PadRight(15) + "NXB".PadRight(10) + "So bai viet".PadRight(5));
            Console.WriteLine("======================");
            for (int i = 0; i < DSTapChi.Dai; i++)
            {
                if (Nhap.CompareTo(DSTapChi[i].nxb) == 0)
                {
                    Console.WriteLine(DSTapChi[i]);
                }
            }
        }