Esempio n. 1
0
        private void btnUpdateInventory_Click(object sender, EventArgs e)
        {
            DataTable changedDT = (DataTable)inventoryGrid.DataSource;

            try {
                _dal.UpdateInventory(changedDT);
                inventoryGrid.DataSource = _dal.GetAllInventory();
            } catch (Exception ex) { MessageBox.Show(ex.Message); }
        }
Esempio n. 2
0
        private void btnUpdateInventory_Click(object sender, EventArgs e)
        {
            //Get modified data from the grid
            DataTable changedDT = (DataTable)inventoryGrid.DataSource;

            try
            {
                //COmmit our changes
                _dal.UpdateInventory(changedDT);
                inventoryGrid.DataSource = _dal.GetAllInventory();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void btnUpdateInventory_Click(object sender, EventArgs e)
        {
            // Get modified data from the grid, and assign it to changedDT.
            DataTable changedDT = (DataTable)inventoryGrid.DataSource;

            try
            {
                // Commit our changes.
                _dal.UpdateInventory(changedDT);

                //Retrieve modified data and bind to DataGridView.
                inventoryGrid.DataSource = _dal.GetAllInventory();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 /// <summary>
 /// Update the database with the in memory datatable, then fill back from the database
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ButtonUpdateInventory_Click(object sender, EventArgs e)
 {
     inventoryDAL.UpdateInventory(inventoryTable);
     inventoryTable = inventoryDAL.GetAllInventory();
 }