コード例 #1
0
        private void btnListAllShopping_Click(object sender, RoutedEventArgs e)
        {
            List <Shopping> shoppings = new List <Shopping>();

            shoppings = ShoppingFactory.getAllShoppings();
            datagridShoppings.ItemsSource = shoppings;
        }
コード例 #2
0
        private void btnSearchShopping_Click(object sender, RoutedEventArgs e)
        {
            checkDate();
            List <ShoppingJoin> shoppings = new List <ShoppingJoin>();

            shoppings = ShoppingFactory.getShopping(date);
            datagridShoppings.ItemsSource = shoppings;
        }
コード例 #3
0
        private void btnShoppingAdd_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                checkDate();
                ShoppingFactory.addShopping(txtboxShoppingName.Text.Trim(),
                                            (int)datagridItems.SelectedValue, (int)comboxStoreNames.SelectedValue,
                                            Convert.ToInt32(txtboxShoppingQuantity.Text.Trim()),
                                            comboxShoppingPaymentType.SelectedItem.ToString(), date);

                txtboxShoppingQuantity.Text = "";

                MessageBox.Show("Shopping uspjesno dodan!");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Moras popuniti sve!", "Error", MessageBoxButton.OK, MessageBoxImage.Stop);
            }
            datagridItems.ItemsSource = null;
        }