Beispiel #1
0
        private void dataGridViewOrders_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            Order          order = RetrieveOrderInformation();
            OrderDBManager odbm  = new OrderDBManager();

            dataGridViewOrderDetails.DataSource = odbm.getOrderDetails(order, idUser);
        }
Beispiel #2
0
        public string addProduct(Order order, Product product, int quantity, int idUser)
        {
            string message;

            if (product.stock > quantity)
            {
                message = "Produs adaugat la comanda";
                OrderDBManager odbm = new OrderDBManager();
                odbm.AddProductToOrder(order, product, quantity, idUser);
            }
            else
            {
                message = "Stoc insuficient";
            }
            return(message);
        }
Beispiel #3
0
 public PresenterUser(int id)
 {
     this.idUser                          = id;
     odbm                                 = new OrderDBManager();
     orders                               = new Orders();
     pdbm                                 = new ProductDBManager();
     FormU                                = new FormUser(idUser);
     FormU.buttonGet.Click               += viewAllOrders;
     FormU.editBtn.Click                 += UpdateOrder;
     FormU.deleteBtn.Click               += DeleteOrder;
     FormU.buttonAddOrder.Click          += AddOrder;
     FormU.buttonViewProducts.Click      += ViewProducts;
     FormU.buttonEditProduct.Click       += EditProduct;
     FormU.buttonAddProduct.Click        += AddProduct;
     FormU.buttonDeleteProduct.Click     += DeleteProduct;
     FormU.buttonAddProductToOrder.Click += AddProductToOrder;
     FormU.Show();
 }