示例#1
0
        public static void choncahai(int sl, int sl2, ref int sovethuong2, ref int sovevip2)
        {
            Vethuong      vethuong2 = new Vethuong();
            List <string> xx        = vethuong2.layslvethuong2();
            Vevip         vevip2    = new Vevip();
            List <string> yy        = vevip2.layslvevip2();

            Ve[] ch = new Ve[sl + sl2];
            int  i, j = 0;

            for (i = 0; i < sl + sl2; i++)
            {
                ch[i]       = new Vethuong();
                ch[i].Mave  = xx.ElementAt(i);
                ch[i].Giave = ch[i].gangiave();
                ch[i].Daban = true;
            }
            for (i = sl; i < sl + sl2; i++)
            {
                ch[i]       = new Vevip();
                ch[i].Mave  = yy.ElementAt(j);
                ch[i].Giave = ch[j].gangiave();
                ch[i].Daban = true;
                j++;
            }
            sovevip2    = j;
            sovethuong2 = ch.Length - sovevip2;
        }
示例#2
0
        public static void Hienthiveconlai(ref int sovethuong, ref int sovevip)
        {
            Vethuong vethuong = new Vethuong();
            Vevip    vevip    = new Vevip();
            int      a        = vethuong.slveconlai(sovethuong) + vevip.slconlai(sovevip);

            Console.WriteLine("So luong ve con lai la : {0}", a);
            Console.WriteLine("So luong ve da ban la : {0}", sovethuong + sovevip);
        }
示例#3
0
        public void layDsve()
        {
            Console.WriteLine("Gia ve vip: 200$");
            Vevip vip = new Vevip();

            Console.WriteLine("so luong ve vip: {0}", vip.layslvevip2().Count);
            Console.WriteLine("Gia ve thuong: 100$");
            Vethuong thuong = new Vethuong();

            Console.WriteLine("So luong ve thuong: {0}", thuong.layslvethuong2().Count);
            Console.WriteLine();
        }
示例#4
0
        public static void chonvethuong(int sl, ref int sovethuong2)
        {
            Vethuong[]    vt        = new Vethuong[sl];
            Vethuong      vethuong2 = new Vethuong();
            List <string> xx        = vethuong2.layslvethuong2();

            for (int i = 0; i < sl; i++)
            {
                vt[i]       = new Vethuong();
                vt[i].Mave  = xx.ElementAt(i);
                vt[i].Giave = vt[i].gangiave();
                vt[i].Daban = true;
            }
            sovethuong2 = vt.Length;
        }
示例#5
0
        public static string invedaban(int sovethuong, int sovevip)
        {
            if (sovethuong != 0 && sovevip == 0)
            {
                Vethuong      vethuong = new Vethuong();
                List <string> mave     = vethuong.layslvethuong2();
                string        inve     = "";

                for (int i = 0; i < sovethuong; i++)
                {
                    inve = inve + mave.ElementAt(i) + "    ";
                }
                return(inve);
            }

            else if (sovethuong == 0 && sovevip != 0)
            {
                Vevip         vevip = new Vevip();
                List <string> mave  = vevip.layslvevip2();
                string        inve  = "";
                for (int i = 0; i < sovevip; i++)
                {
                    inve = inve + mave.ElementAt(i) + "    ";
                }
                return(inve);
            }
            else
            {
                Vethuong      vethuong = new Vethuong();
                List <string> mave1 = vethuong.layslvethuong2();
                Vevip         vevip = new Vevip();
                List <string> mave2 = vevip.layslvevip2(); string inve = "";
                int           i, j = 0;
                for (i = 0; i < sovethuong; i++)
                {
                    inve = inve + mave1.ElementAt(i) + "    ";
                }
                for (i = sovethuong; i < sovethuong + sovevip; i++)
                {
                    inve = inve + mave2.ElementAt(j) + "   "; j++;
                }
                return(inve);
            }
        }