Beispiel #1
0
        //----điều hướng
        static void DieuHuong(int select, ref ArrayList ArrayHH, ref ArrayList ArrayLH)
        {
            switch (select)
            {
            case 0:
                Add.ThemHangHoa(ref ArrayHH, ref ArrayLH);
                return;

            case 1:
                Console.CursorVisible = false;
                Edit.SuaHangHoa(ref ArrayHH, ref ArrayLH);
                return;

            case 2:
                Console.CursorVisible = false;
                Delete.XoaHangHoa(ref ArrayHH, ref ArrayLH);
                return;

            case 3:
                Find.TimKiemHangHoa(ArrayHH, ArrayLH);
                return;

            case 4:
                AddLH.ThemLoaiHang(ref ArrayLH, ref ArrayHH);
                return;

            case 5:
                Console.CursorVisible = false;
                EditLH.SuaLoaiHang(ref ArrayLH, ref ArrayHH, 0);
                return;

            case 6:
                Console.CursorVisible = false;
                DeleteLH.XoaLoaiHang(ref ArrayLH, ref ArrayHH, 0);
                return;

            case 7:
                FindLH.TimKiemLoaiHang(ArrayLH, ArrayHH);
                return;

            case 8:
                Console.CursorVisible = false;
                //Caculator.PageMainCacu();
                FappyBird.FontGameFB();

                return;

            case 9:
                Console.CursorVisible = false;
                MiniGame.SelectLevelGame();
                return;

            case 10:
                Console.CursorVisible = false;
                About.Information();
                return;

            case 11:
                Console.CursorVisible = false;
                Console.Clear();
                return;
            }
        }
Beispiel #2
0
        public static void ThemHangHoa(ref ArrayList ArrayHH, ref ArrayList ArrayLH)
        {
            Console.CursorVisible = false;
            Form.FormHangHoa("THÊM HÀNG HÓA");
            Console.ForegroundColor = ConsoleColor.Black;
            Console.BackgroundColor = ConsoleColor.DarkYellow;
            Console.CursorTop       = 0;
            Console.CursorLeft      = 0;
            Console.WriteLine(" THÊM HÀNG HÓA |");
            Console.BackgroundColor = ConsoleColor.Gray;
            Console.ForegroundColor = ConsoleColor.Black;
            Console.WriteLine("--------------*");
            Console.CursorTop       = 0;
            Console.CursorLeft      = 37;
            Console.BackgroundColor = ConsoleColor.Blue;
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine(" Nhập [ENTER] ");
            Console.CursorTop       = 0;
            Console.CursorLeft      = 56;
            Console.BackgroundColor = ConsoleColor.Blue;
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine(" Home [ESC] ");
            Console.BackgroundColor = ConsoleColor.Gray;
            Console.ForegroundColor = ConsoleColor.Black;
            ConsoleKeyInfo input;

            input = Console.ReadKey(true);
            if (input.Key == ConsoleKey.Escape)
            {
                Program.AppMain();
            }
            else
            {
                Console.CursorVisible = true;
                Console.CursorTop     = 0;
                Console.CursorLeft    = 37;
                Console.WriteLine("                 ");
                Console.CursorTop  = 0;
                Console.CursorLeft = 56;
                Console.WriteLine("                  ");
                Struct.HOANGHOA SP;
                InputHH(1, 2, "Mã hàng hóa:");
                SP.MaHH = Console.ReadLine();
                InputHH(2, 2, "Tên hàng hóa:");
                SP.TenHH = Console.ReadLine();
                int ngay = 0, thang = 0, nam = 0;
                NhapNgayThangNam(ref ngay, ref thang, ref nam, 3, 1);
                SP.HanDung.Ngay         = ngay;
                SP.HanDung.Nam          = nam;
                SP.HanDung.Thang        = thang;
                Console.BackgroundColor = ConsoleColor.Gray;
                Console.ForegroundColor = ConsoleColor.Black;
                InputHH(4, 2, "Công ty sản xuất:                               ");
                SP.CtySX = Console.ReadLine();
                InputHH(5, 1, "Năm xản xuât");
                int namSX = 0;
                Console.CursorLeft = 2;
                SP.NamSX           = NhapInt(namSX, "Năm Sản Xuất", 20, 2);
                Add.InputHH(6, 2, "Loại hàng hóa:      ");
                SP.LoaiHang = Console.ReadLine();
                bool flag;
                flag = Form.FormXacNhan(10, 40, 5, 40, "Save HH");
                if (flag)
                {
                    ArrayHH.Add(SP);
                    Console.Clear();
                    Console.BackgroundColor = ConsoleColor.Red;
                    Console.ForegroundColor = ConsoleColor.White;
                    Console.WriteLine("Bạn đã lưu thành công!");
                    Console.BackgroundColor = ConsoleColor.White;
                    Console.ForegroundColor = ConsoleColor.Black;
                    Tittle.TieuDe();
                    Select.LuaChonChinh(ref ArrayHH, ref ArrayLH, 0);
                }
                else
                {
                    Console.BackgroundColor = ConsoleColor.Gray;
                    Console.ForegroundColor = ConsoleColor.Black;
                    Console.Clear();
                    ThemHangHoa(ref ArrayHH, ref ArrayLH);
                }
            }
        }
Beispiel #3
0
        public static void FormHangHoa(string tittle)
        {
            Console.ForegroundColor = ConsoleColor.Black;
            Console.BackgroundColor = ConsoleColor.DarkYellow;
            Console.CursorTop       = 0;
            Console.CursorLeft      = 0;
            Console.WriteLine(" {0} |", tittle);
            Console.BackgroundColor = ConsoleColor.Gray;
            Console.ForegroundColor = ConsoleColor.Black;
            Console.WriteLine("--------------*");
            Add.InputHH(1, 2, "Mã hàng hóa:");
            Add.InputHH(2, 2, "Tên hàng hóa:");
            int top = 3;

            Console.BackgroundColor = ConsoleColor.Gray;
            Console.ForegroundColor = ConsoleColor.Black;
            Add.InputHH(4, 2, "Công ty sản xuất:                               ");
            Add.InputHH(5, 1, "Năm xản xuât");
            Console.CursorLeft = 2;
            Add.InputHH(6, 2, "Loại hàng hóa:      ");
            //SP.LoaiHang = Console.ReadLine();
            Console.BackgroundColor = ConsoleColor.Gray;
            Console.CursorTop       = top * 4 - 2;
            Console.CursorLeft      = 1;
            Console.WriteLine("Hạn sử dụng:");
            Console.CursorTop  = top * 4 - 1;
            Console.CursorLeft = 2;
            Console.WriteLine("Ngày:");
            Console.BackgroundColor = ConsoleColor.White;
            Console.CursorTop       = top * 4 - 1;
            Console.CursorLeft      = 8;
            Console.WriteLine("-------------");
            Console.CursorLeft = 8;
            Console.WriteLine("             ");
            Console.CursorLeft = 8;
            Console.WriteLine("             ");
            Console.CursorTop  = top * 4;
            Console.CursorLeft = 9;
            // ngay
            Console.CursorTop       = top * 4 - 1;
            Console.CursorLeft      = 24;
            Console.BackgroundColor = ConsoleColor.Gray;
            Console.WriteLine("Tháng:");
            Console.BackgroundColor = ConsoleColor.White;
            Console.CursorTop       = top * 4 - 1;
            Console.CursorLeft      = 31;
            Console.WriteLine("--------------");
            Console.CursorLeft = 31;
            Console.WriteLine("              ");
            Console.CursorLeft = 31;
            Console.WriteLine("              ");
            Console.CursorTop  = top * 4;
            Console.CursorLeft = 32;
            // thang
            Console.CursorTop       = top * 4 - 1;
            Console.CursorLeft      = 49;
            Console.BackgroundColor = ConsoleColor.Gray;
            Console.WriteLine("Năm:");
            Console.BackgroundColor = ConsoleColor.White;
            Console.CursorTop       = top * 4 - 1;
            Console.CursorLeft      = 54;
            Console.WriteLine("--------------");
            Console.CursorLeft = 54;
            Console.WriteLine("              ");
            Console.CursorLeft = 54;
            Console.WriteLine("              ");
            Console.CursorTop  = top * 4;
            Console.CursorLeft = 55;
            // nam
        }