Exemple #1
0
        public Purchase()
        {
            InitializeComponent();
            DataContext = this;
            List <String> supplierNameList = handleDatabase.getNameListforPurchases("supplier");
            List <String> itemNameList     = handleDatabase.getNameListforPurchases("item");

            SupplierName.ItemsSource = supplierNameList;
            ItemName.ItemsSource     = itemNameList;

            dt = new DataTable();
            dt.Columns.Add("purchaseID", typeof(String));
            dt.Columns.Add("itemName", typeof(String));
            dt.Columns.Add("quantity", typeof(String));
            dt.Columns.Add("purchasePrice", typeof(String));
            dt.Columns.Add("salePrice", typeof(String));
        }
        private void CatogoryName_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int selectedindex = CatogoryName.SelectedIndex;

            if (selectedindex.Equals(4) || selectedindex.Equals(5) || selectedindex.Equals(6) || selectedindex.Equals(6) || selectedindex.Equals(1))
            {
                options.Visibility = Visibility.Hidden;
            }
            else if (selectedindex.Equals(2))
            {
                options.Visibility = Visibility.Visible;
                MessageBox.Show("Select a Supplier Name from Option menu");
                List <String> supplierNameList = handleDatabase.getNameListforPurchases("purchaseMaster");
                options.ItemsSource = supplierNameList;
            }
            else if (selectedindex.Equals(3))
            {
                options.Visibility = Visibility.Visible;
                MessageBox.Show("Select a customer Name from Option menu");
                List <String> customerNameList = handleDatabase.getListDetailsforSales("customer");
                options.ItemsSource = customerNameList;
            }
        }