Beispiel #1
0
        private void AddItem_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                // Insert item.
                BLAccount.InsertItem(accountId, txtIname.Text);

                // Update items.
                lstItem.DataContext = BLAccount.GetItems(accountId);
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Beispiel #2
0
        private void DelItem_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                // Get selected item. Item selectedItem = (Item)spItem.DataContext;

                // Delete item.
                BLAccount.DeleteItem(Convert.ToInt32(txtId.Text));

                // Update items.
                lstItem.DataContext = BLAccount.GetItems(accountId);
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Beispiel #3
0
        public void InitializeAccountData(int accountId)
        {
            try
            {
                this.accountId = accountId;

                // 1. Get account from BL.
                spAccount.DataContext = BLAccount.GetAccount(accountId);

                // 2. Get items from BL.
                lstItem.DataContext = BLAccount.GetItems(accountId);
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }