Esempio n. 1
0
        public Cart(ShoppingCartController cartController, NormalUserController controller, IBuyable buyable, string s, string amount, string statID)
        {
            // My Online MSQL DataBase
            String connectionStr = "Data Source=SQL5047.site4now.net;Initial Catalog=DB_A5071D_OnlineStore;User Id=DB_A5071D_OnlineStore_admin;Password=01152160972Ah;";
            // Local MSQL DataBase
            //String connectionStr = "Data Source=DESKTOP-JEM2R23\\;Initial Catalog=OnlineStore;Integrated Security=True";

            IConnectionString connectionString = new DataBaseConnection();

            connectionString.SetConnectionString(connectionStr);
            this.buyable = buyable;
            InitializeComponent();
            this.cartController = cartController;
            this.controller     = controller;
            ListItem            = cartController.viewCart();
            this.StoreID        = s;
            this.Actualamount   = amount;
            this.statID         = statID;
            this.querie         = new ShoppingCartControllerQueries(connectionString);
        }
Esempio n. 2
0
        public NUserPage(NormalUserController user, ShoppingCartController cartController, IBuyable buyable)
        {
            // My Online MSQL DataBase
            String connectionStr = "Data Source=SQL5047.site4now.net;Initial Catalog=DB_A5071D_OnlineStore;User Id=DB_A5071D_OnlineStore_admin;Password=01152160972Ah;";
            // Local MSQL DataBase
            //String connectionStr = "Data Source=DESKTOP-JEM2R23\\;Initial Catalog=OnlineStore;Integrated Security=True";

            IConnectionString connectionString = new DataBaseConnection();

            connectionString.SetConnectionString(connectionStr);
            queries         = new ShoppingCartControllerQueries(connectionString);
            this.controller = user;
            InitializeComponent();
            TuserName.Text         = controller.normalUser.Data.userName;
            Temail.Text            = controller.normalUser.Data.email;
            Tname.Text             = controller.normalUser.Data.name;
            Trole.Text             = controller.normalUser.Data.role;
            this.cartController    = cartController;
            this.buyable           = buyable;
            cartObject             = new CartItem();
            controllerStoreProduct = new StoreProductController();
        }