private void dgTransactionItems_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (dgTransactionItems.SelectedIndex > -1)
            {
                InventoryTransactionItemBinding obj = (InventoryTransactionItemBinding)dgTransactionItems.SelectedCells[0].Item;
                mTransactionItem = (InventoryTransactionItem)mTransactionItems[obj.itemID];
                if (mTransactionItem.GetInventoryItem() == null)
                {
                    try
                    {
                        DataSet data = db.Select("*", InventoryItem.Table, InventoryItem.Fields.itemID.ToString() + " = '" + mTransactionItem.GetItemID() + "'");
                        data.Read();
                        mTransactionItem.SetInventoryItem(new InventoryItem(data.GetRecordDataSet()));

                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Loading Item Data - " + msgCodes.GetString("M2102") + ex.Message, "Error - 2102", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                }
                ClearFields();
                SelectedItem();
                lockItemFields();
                txtQuantity.Text = "" + mTransactionItem.GetQuantity();
                cmdSaveEditItem.IsEnabled = true;
                cmdRemoveItem.IsEnabled = true;
                cmdCancelItem.IsEnabled = false;
                cmdSaveEditItem.Content = unlockBtnTxt;
                if (isFormHidden)
                {
                    displayOrHideForm();
                }
            }
        }
 private void LoadDateGrid()
 {
     mTransactionItems.Clear();
     try
     {
         DataSet data = db.Select("inventory_item_transactions.*,inventory_items.ItemName", "inventory_items LEFT JOIN inventory_item_transactions ON inventory_items.itemID = inventory_item_transactions.itemID", InventoryTransactionItem.Fields.transactionID.ToString() + " = '" + mTransaction.GetTransactionID() + "'");
         Collection<InventoryTransactionItemBinding> gridData = data.getBindableCollection<InventoryTransactionItemBinding>();
         dgTransactionItems.ItemsSource = gridData;
         while (data.Read())
         {
             InventoryTransactionItem itemObj = new InventoryTransactionItem(data.GetRecordDataSet());
             if (!mTransactionItems.ContainsKey(itemObj.GetItemID()))
             {
                 mTransactionItems.Add(itemObj.GetItemID(), itemObj);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Failed loading Transaction Items - " + msgCodes.GetString("M2102") + " " + ex.Message, "Error - 2102", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }