예제 #1
0
        public Payee DeletePayee(Payee p)
        {
            Payees payees = myMoney.Payees;

            if (myMoney.GetUsedPayees().Contains(p))
            {
                p = Rename(p);
            }
            else
            {
                payees.RemovePayee(p);
            }
            return(p);
        }
예제 #2
0
        Payee Rename(Payee fromPayee, Payee renameToThisPayee)
        {
            RenamePayeeDialog dialog = RenamePayeeDialog.ShowDialogRenamePayee(this.Site, this.myMoney, fromPayee, renameToThisPayee);

            dialog.Owner = App.Current.MainWindow;
            if (dialog.ShowDialog() == true)
            {
                HashSet <Payee> used = myMoney.GetUsedPayees();
                if (!used.Contains(fromPayee))
                {
                    // remove it now so that our list UI is updated...
                    Payees payees = myMoney.Payees;
                    payees.RemovePayee(fromPayee);
                }
            }
            return(dialog.Payee);
        }