Ejemplo n.º 1
0
        string IElectricity.retrievePhoneNumber()
        {
            string     rePhoneNum;
            ForeignCus FgCus = new ForeignCus();

            rePhoneNum = +84 + FgCus.Phone;
            return(rePhoneNum);
        }
Ejemplo n.º 2
0
        public void InsertData()
        {
            int  choice = 0;
            bool flag   = true;
            int  count  = 1;

            while (flag)
            {
                Console.WriteLine("--------Case 1-------");
                Console.WriteLine("1.Nhap thong tin KH Viet Nam");
                Console.WriteLine("2.Nhap thong tin KH Nuoc Ngoai");
                Console.WriteLine("3.Ket thuc");
                choice = Convert.ToInt16(Console.ReadLine());
                Console.WriteLine("--------Case 1-------");
                switch (choice)
                {
                case 1:
                    VietNamCus VNcu = new VietNamCus();
                    VNcu.Id     = count;
                    VNcu.Name   = "Duc" + count;
                    VNcu.Phone  = "035235480" + count;
                    VNcu.Wallet = 100000;
                    VNcu.Type   = "VN";
                    VNcu.Kw     = count * 10;
                    VNcu.Date   = 05022019;
                    VNcu.Bill   = String.Format("{0:#.##} ", VNcu.invoice());
                    VNCuArr.Add(VNcu);
                    break;

                case 2:
                    ForeignCus FGcu = new ForeignCus();
                    FGcu.Id     = count;
                    FGcu.Name   = "My" + count;
                    FGcu.Phone  = "333333333" + count;
                    FGcu.Wallet = 100000;
                    FGcu.Type   = "FG";
                    FGcu.Kw     = count * 10;
                    FGcu.Date   = 05022019;
                    FGCuArr.Add(FGcu);
                    break;

                case 3:
                    flag = false;
                    Console.WriteLine("Bye");
                    break;

                default:
                    Console.WriteLine("Bye..");
                    break;
                }
                count++;
            }
        }
Ejemplo n.º 3
0
        public float invoice()
        {
            float      _paid = 0;
            ForeignCus FgCu  = new ForeignCus();
            QtyPrice   Price = new QtyPrice();

            if (FgCu.Kw <= Price.Quota)
            {
                _paid = (float)(FgCu.Kw * 2.5 * Price.Price);
            }
            else
            {
                _paid = (float)((FgCu.Kw - Price.Quota) * 2.5 * 1.5 * Price.Price + Price.Quota * 2.5 * 1.5 * Price.Price);
            }
            return(_paid);
        }