Пример #1
0
        public SuKien Tim_MaSo(string prompt)
        {
            if (Rong())
            {
                return(null);
            }
            Program.XuatMauTrang(" >> " + prompt);
            string maso   = Console.ReadLine();
            SuKien suKien = DSSK.Find(sk => sk.Maso == maso);

            if (suKien != null)
            {
                if (suKien.Loai == "Cuoc hop")
                {
                    XuatHeader_CH();
                }
                else
                {
                    XuatHeader_HT();
                }
                suKien.Xuat();
                return(suKien);
            }
            XuatKhongTimThay();
            return(null);
        }
Пример #2
0
        public void Xoa()
        {
            SuKien sk = Tim_MaSo("Nhap ma so su kien can xoa: ");

            if (sk != null)
            {
                Console.WriteLine("\n    1. Co      2. Khong");
                int x = Menu.HoiYeuCau(2, "Ban muon xoa su kien nay: ");
                if (x == 1 && DSSK.Remove(sk))
                {
                    Program.XuatMauXanh("    Xoa thanh cong!\n");
                }
            }
        }
Пример #3
0
        public void Sua()
        {
            SuKien sk = Tim_MaSo("Nhap ma so su kien can sua: ");

            if (sk != null)
            {
                try
                {
                    sk.Sua();
                    Program.XuatMauXanh("    Da sua thong tin!\n");
                    if (sk.Loai == "Cuoc hop")
                    {
                        XuatHeader_CH();
                    }
                    else
                    {
                        XuatHeader_HT();
                    }
                    sk.Xuat();
                }
                catch { Program.XuatMauDo("    Loi! Khong the sua!\n"); }
            }
        }