static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            FileHandler   FH = new FileHandler();
            HandleProduct HP = new HandleProduct(FH);
            ShoppingCart  SC = new ShoppingCart(HP);

            Application.Run(new View(FH, HP, SC));
        }
        public View(FileHandler fh, HandleProduct hp, ShoppingCart sc)
        {
            FH = fh;
            HP = hp;
            SC = sc;

            InitializeComponent();
            FH.ReadFromFile();

            myPLbindingSource.DataSource = HP.GetProductList();
            dgvInventory.DataSource      = myPLbindingSource;
            dgvCheckout.DataSource       = myPLbindingSource;

            dgvShoppingCart.DataSource = SC.GetShoppingList();
        }
        string fileName = "InventoryFile.txt";  // Namn på fil dit datan sparas.

        public void setHPconnection(HandleProduct hp)
        {
            HP = hp;
        }
Exemple #4
0
        List <Product> shoppingList = new List <Product>();   /* Shoppinglistan, med de produkter som lagts i varukorgen. */

        public ShoppingCart(HandleProduct hp)
        {
            HP = hp;
        }