Beispiel #1
0
        public AddItemUI(Shop aShop)
        {
            InitializeComponent();
            shop=aShop;
            aDatabase = new Database();
           

        }
Beispiel #2
0
        private void sellItemButton_Click(object sender, EventArgs e)
        {
            aDatabase = new Database();

            string id = sellProductIdTextBox.Text;
            int quantity = Convert.ToInt16(sellQuantityTextBox.Text);
            aProduct = new Product(id, quantity);
            
            if (aDatabase.HasThisId(id))
            {
                MessageBox.Show(aDatabase.SellProductInDatabase(id, quantity));
            }
            else
            {
                MessageBox.Show("Product not fornd");
            }

            sellItemdataGridView.DataSource = null;
            sellItemdataGridView.DataSource = aDatabase.fillDataTable("Product"); // table name
        }
Beispiel #3
0
 public ShopUI()
 {
     InitializeComponent();
     aDatabase = new Database();
 }