示例#1
0
 //form tim kiem
 public static void FormTimKiem(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, "Nhập từ khóa tìm kiếm....");
 }
示例#2
0
 public static void FormLoaiHang(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, "Hãy nhập mã loại hàng:");
     Add.InputHH(2, 2, "Hãy nhập tên loại hóa");
     Add.InputHH(3, 2, "Mô tả về loại hàng:                              ");
 }
示例#3
0
        // sửa lại thêm laoij hang
        public static void ThemLoaiHang(ref ArrayList ArrayLH, ref ArrayList ArrayHH)
        {
            Console.CursorVisible = false;
            Form.FormLoaiHang("THÊM LOẠI HÀNG");
            Console.ForegroundColor = ConsoleColor.Black;
            Console.BackgroundColor = ConsoleColor.DarkYellow;
            Console.CursorTop       = 0;
            Console.CursorLeft      = 0;
            Console.WriteLine("THÊM LOẠI HÀNG |");
            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.LOAIHANG LH;
                Add.InputHH(1, 2, "");
                LH.MaLH = Console.ReadLine();
                Add.InputHH(2, 2, "");
                LH.TenLH = Console.ReadLine();
                Add.InputHH(3, 2, "");
                LH.MotaLH = Console.ReadLine();
                bool flag;
                flag = Form.FormXacNhan(10, 40, 5, 40, "Save LH");
                if (flag)
                {
                    ArrayLH.Add(LH);
                    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, 4);
                }
                else
                {
                    Console.BackgroundColor = ConsoleColor.Gray;
                    Console.ForegroundColor = ConsoleColor.Black;
                    Console.Clear();
                    ThemLoaiHang(ref ArrayLH, ref ArrayHH);
                }
            }
        }
示例#4
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);
                }
            }
        }
示例#5
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
        }