Esempio n. 1
0
        private void switchToSelectedAccount(ListCollectionView view)
        {
            this.currentAccount  = (AccountDRM)view.CurrentItem;
            this.currentEnvelope = null;

            if (this.currentAccount != null)
            {
                RegistryLineModel.CurrentAccountID = this.currentAccount.ID;

                this.currentLineItems = new ObservableCollection <RegistryLineModel>(this.currentAccount.getTransactionLines());
                //this.currentLineItems.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(currentLineItems_CollectionChanged);

                this.RegistryLinesView            = new ListCollectionView(this.currentLineItems);
                this.RegistryLinesView.Filter     = new Predicate <Object>(RegistryFilter);
                this.RegistryLinesView.CustomSort = new RegistryLinesComparer();
            }
            else
            {
            }



            this.updateBalanceValues();
            this.reportSummaryPropertiesChanged();
            this.reportPropertyChangedWithName("RegistryLinesView");
        }
Esempio n. 2
0
        ///////////////////////////////////////////////////////////
        // Public functions
        ///////////////////////////////////////////////////////////
        public RegistryVM()
        {
            this.setupViews();

            this.currentAccount  = (AccountDRM)this.AccountsView.CurrentItem;
            this.currentEnvelope = null;
        }
        private static int compareByID(EnvelopeDRM xEnv, EnvelopeDRM yEnv)
        {
            int result;

            result = xEnv.ID.CompareTo(yEnv.ID);
            return(result);
        }
        private int sortBySpecialCase(EnvelopeDRM xEnv, EnvelopeDRM yEnv)
        {
            int result;

            if (xEnv.IsSpecial() && yEnv.IsSpecial())
            {
                result = compareByID(xEnv, yEnv);
            }

            else if (xEnv.IsSpecial())
            {
                result = -1;
            }

            else if (yEnv.IsSpecial())
            {
                result = 1;
            }

            else
            {
                result = compareByName(xEnv, yEnv);
            }

            return(result);
        }
Esempio n. 5
0
        public void switchToSelectedEnvelope()
        {
            this.currentEnvelope = (EnvelopeDRM)this.EnvelopesView.CurrentItem;
            this.currentAccount  = null;

            //this.updateBalanceValues();
            //this.reportSummaryPropertiesChanged();
        }
        public int Compare(object x, object y)
        {
            EnvelopeDRM xEnv = (EnvelopeDRM)x;
            EnvelopeDRM yEnv = (EnvelopeDRM)y;

            int result;

            result = sortBySpecialCase(xEnv, yEnv);

            return(result);
        }
        private bool EnvelopesFilter(object item)
        {
            EnvelopeDRM account  = (EnvelopeDRM)item;
            bool        keepItem = true;

            if (account.ID == EnvelopeCON.SPLIT.ID)
            {
                keepItem = false;
            }

            return(keepItem);
        }
Esempio n. 8
0
        private bool EnvelopesFilter(object item)
        {
            EnvelopeDRM row = (EnvelopeDRM)item;

            if (row.ID == EnvelopeCON.NULL.ID || row.ID == EnvelopeCON.SPLIT.ID)
            {
                return(false);
            }

            if (row.Closed == true && row.EndingBalance == 0)
            {
                return(false);
            }

            return(true);
        }
Esempio n. 9
0
        private void appendDestinationWithNewEnvelope(OldFFDBDataSet.EnvelopeRow sourceEnvelope)
        {
            if (sourceEnvelope.id <= 0)
            {
                handleSpecialEnvelope(sourceEnvelope);
            }

            else
            {
                EnvelopeDRM newEnvelope = new EnvelopeDRM();

                newEnvelope.Name    = sourceEnvelope.name;
                newEnvelope.GroupID = envelopeGroupMerger.getDestinationIdFromSourceId(sourceEnvelope.groupID);
                newEnvelope.Closed  = sourceEnvelope.closed;

                sourceToDestinationID.Add(sourceEnvelope.id, newEnvelope.ID);
            }
        }
        ///////////////////////////////////////////////////////////
        // Private functions
        private bool EditableEnvelopesFilter(object item)
        {
            EnvelopeDRM envRow   = (EnvelopeDRM)item;
            bool        keepItem = true; // Assume the item will be shown in the list

            if (EnvelopeCON.isSpecial(envRow.ID))
            {
                keepItem = false;
            }

            // Remove the item if we don't want to see closed envelopes or it's not in the search.
            else if (!this._ShowClosed && envRow.Closed)
            {
                keepItem = false;
            }

            else if (!String.IsNullOrEmpty(this._SearchText) && !envRow.Name.ToLower().Contains(this.SearchText.ToLower()))
            {
                keepItem = false;
            }

            return(keepItem);
        }
 private static int compareByName(EnvelopeDRM xEnv, EnvelopeDRM yEnv)
 {
     return(xEnv.Name.CompareTo(yEnv.Name));
 }