public RegisterEntryStatus NextStatus()
        {
            RegisterEntryStatus currStatus = GetStatus();
            RegisterEntryStatus status     = RegisterEntryStatus.Outstanding;

            switch (currStatus)
            {
            case RegisterEntryStatus.Outstanding:
                status = RegisterEntryStatus.Pending;
                break;

            case RegisterEntryStatus.Pending:
                status = RegisterEntryStatus.Cleared;
                break;

            case RegisterEntryStatus.Cleared:
                status = RegisterEntryStatus.Reconciled;
                break;

            case RegisterEntryStatus.Reconciled:
                status = RegisterEntryStatus.Outstanding;
                break;

            default:
                break;
            }

            return(status);
        }
Esempio n. 2
0
        public void Balance()
        {
            InitializeRegister();
            if (RegisterEntries == null)
            {
                return;
            }

            foreach (var entry in RegisterEntries)
            {
                RegisterEntryStatus status = entry.GetStatus();
                switch (status)
                {
                case RegisterEntryStatus.Cleared:
                case RegisterEntryStatus.Reconciled:
                    ClearedNet += entry.NetTotal;
                    break;

                case RegisterEntryStatus.Pending:
                    PendingNet += entry.NetTotal;
                    break;

                default:
                    OutstandingNet += entry.NetTotal;
                    break;
                }
            }
            ClearedBalance   = StartingBalance + ClearedNet;
            AvailableBalance = ClearedBalance + PendingNet;
            EndingBalance    = AvailableBalance + OutstandingNet;
        }
Esempio n. 3
0
        public static string FormatRegisterEntryStatus(RegisterEntryStatus status)
        {
            switch (status)
            {
            case RegisterEntryStatus.Pending:
                return("p");

            case RegisterEntryStatus.Cleared:
                return("c");

            case RegisterEntryStatus.Reconciled:
                return("R");

            default:
                return("o");
            }
        }
        // Methods

        public RegisterEntryStatus GetStatus()
        {
            RegisterEntryStatus status = RegisterEntryStatus.Outstanding;

            switch (Status)
            {
            case 1:
                status = RegisterEntryStatus.Pending;
                break;

            case 2:
                status = RegisterEntryStatus.Cleared;
                break;

            case 3:
                status = RegisterEntryStatus.Reconciled;
                break;

            default:
                break;
            }

            return(status);
        }
        public override string ToString()
        {
            RegisterEntryStatus status = RegisterEntryStatus.Outstanding;

            return(status.ToString());
        }