Exemplo n.º 1
0
 private void Category_Filter_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (Category_Filter.SelectedIndex != -1)
     {
         Subcategory_Filter.ItemsSource = DbAccessorService.getCategories()[Category_Filter.SelectedIndex].SubCategories;
     }
 }
Exemplo n.º 2
0
        private void Order_Edit_Click(object sender, RoutedEventArgs e)
        {
            Order     order = ListofItemOrder.SelectedItem as Order;
            OrderEdit edit  = new OrderEdit(order);

            edit.ShowDialog();

            DbAccessorService.updateOrder(order);
        }
Exemplo n.º 3
0
        private void AdminPageLoaded(object sender, RoutedEventArgs e)
        {
            //orders = DbAccessorService.getOrders();
            Category_Filter.ItemsSource = DbAccessorService.getCategories();

            Order_State_Filter_Combo.ItemsSource = Enum.GetValues(typeof(OrderStatus)).Cast <OrderStatus>();
            ListofItem.ItemsSource      = DbAccessorService.getProducts();
            StoreList.ItemsSource       = DbAccessorService.getProducts();
            UserList.ItemsSource        = DbAccessorService.getUsers();
            ListofItemOrder.ItemsSource = DbAccessorService.getOrders();
        }
Exemplo n.º 4
0
        private void Store_OrderProduct_CLick(object sender, RoutedEventArgs e)
        {
            var product = StoreList.SelectedItem as Product;

            int.TryParse(OrderCount.Value, out int orderCount);

            product.StanMagazynowy += orderCount;

            DbAccessorService.updateProduct(product);
            OrderCount.Value = "1";
            MessageBox.Show("Złożono zamówienie", "Zamówienie", MessageBoxButton.OK, MessageBoxImage.Information);
        }
 private void Add_Product_Click(object sender, RoutedEventArgs e)
 {
     if (newProduct.Photo?.Length != 0)
     {
         if (add)
         {
             DbAccessorService.AddProduct(newProduct);
         }
         else
         {
             DbAccessorService.updateProduct(newProduct);
         }
     }
     else
     {
         MessageBox.Show("Probowano dodac produkt bez zdjecia", "Zdjecie Error", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     this.Close();
 }
Exemplo n.º 6
0
        private void Product_Delete_Click(object sender, RoutedEventArgs e)
        {
            Product p = ListofItem.SelectedItem as Product;

            DbAccessorService.DeleteProduct(product: p);
        }
Exemplo n.º 7
0
        private void Order_Delete_Click(object sender, RoutedEventArgs e)
        {
            Order order = ListofItemOrder.SelectedItem as Order;

            DbAccessorService.DeleteOrder(order);
        }
 private void LoadSaleProducts(object sender, RoutedEventArgs e)
 {
     Category_Filter.ItemsSource = DbAccessorService.getCategories();
     SalesProduct.ItemsSource    = DbAccessorService.getProducts();
 }