Example #1
0
        private void BaddDeposit_Click(object sender, RoutedEventArgs e)
        {
            Deposit          deposit = new Deposit();
            AddDepositWindow add     = new AddDepositWindow(deposit);

            add.Owner = this;
            var result = add.ShowDialog();

            if (result == true)
            {
                bd.Deposits.Add(deposit);
                bd.SaveChanges();
                add.Close();
            }
            else
            {
                add.Close();
            }
            LvDeposits.ItemsSource = vm.ListDep;
        }
Example #2
0
        private void MiChangeDep_Click(object sender, RoutedEventArgs e)
        {
            string  deposit    = LvDeposits.SelectedItem.ToString();
            int     k          = deposit.IndexOf('.');
            int     depositId  = Int32.Parse(deposit.Substring(0, k));
            Deposit depositSel = bd.Deposits.Find(depositId);

            AddDepositWindow add = new AddDepositWindow(depositSel);

            add.Owner = this;
            var result = add.ShowDialog();

            if (result == true)
            {
                bd.SaveChanges();
                add.Close();
                UpdatingInformationDeposit();
                LvDeposits.ItemsSource = vm.ListDep;
            }
            else
            {
                add.Close();
            }
        }