Пример #1
0
 public clsDocumentRecord(int docID, DateTime recordDate, DateTime actionDate, int senderID, int receiverID,
                          clsDocumentRecord.Status status, clsDocumentRecord.Transmission transmission)
 {
     this.iDocumentRecordID = this._NewDocumentRecordID();
     this.iDocumentID       = docID;
     this.dtAction          = actionDate;
     this.dtRecord          = recordDate;
     this.iSenderEntityID   = senderID;
     this.iReceiverEntityID = receiverID;
     this.eStatus           = status;
     this.eTransmission     = transmission;
 }
Пример #2
0
 private bool _Load(int id, clsCSVTable tbl)
 {
     if (id < tbl.Length())
     {
         this.iDocumentRecordID = id;
         this.dtAction          = DateTime.Parse(tbl.Value(id, clsDocumentRecord.ActionDateColumn));
         this.dtRecord          = DateTime.Parse(tbl.Value(id, clsDocumentRecord.RecordDateColumn));
         this.eStatus           = (clsDocumentRecord.Status)Int32.Parse(tbl.Value(id, clsDocumentRecord.StatusColumn));
         this.eTransmission     = (clsDocumentRecord.Transmission)Int32.Parse(tbl.Value(id, clsDocumentRecord.TransmissionColumn));
         this.iDocumentID       = Int32.Parse(tbl.Value(id, clsDocumentRecord.DocumentColumn));
         this.iSenderEntityID   = Int32.Parse(tbl.Value(id, clsDocumentRecord.SenderColumn));
         this.iReceiverEntityID = Int32.Parse(tbl.Value(id, clsDocumentRecord.ReceiverColumn));
         return(true);
     }
     else
     {
         return(false);
     }
 }
Пример #3
0
        private bool DocListContains(List <clsDocumentRecord> list, List <clsDocument.Type> docTypesByRecord, clsDocument.Type docType,
                                     clsDocumentRecord.Transmission transmission = clsDocumentRecord.Transmission.Unknown,
                                     clsDocumentRecord.Status status             = clsDocumentRecord.Status.Unkown,
                                     int senderID   = -1,
                                     int receiverID = -1)
        {
            bool found = false;

            for (int i = 0; i < list.Count; i++)
            {
                if (!found)
                {
                    if ((docType == docTypesByRecord[i]) &&
                        ((transmission == clsDocumentRecord.Transmission.Unknown) || (transmission == list[i].TransmissionType())) &&
                        ((status == clsDocumentRecord.Status.Unkown) || (status == list[i].StatusType())) &&
                        ((senderID == -1) || (senderID == list[i].SenderID())) &&
                        ((receiverID == -1) || (receiverID == list[i].ReceiverID())))
                    {
                        found = true;
                    }
                }
            }
            return(found);
        }
Пример #4
0
        partial void propertyMenuChosen(AppKit.NSPopUpButton sender)
        {
            documentRecordHistory.StringValue  = " ";
            documentRecordHistory.StringValue += "\t" + "\t" + "\t" + "Sender           " + "Reciever         " + " Action Date     " + "Record Date     " + "\n";

            clsCSVTable tbl      = new clsCSVTable(clsDocument.strDocumentPath);
            int         chosenID = clsLoan.LoanID(propertyMenu.TitleOfSelectedItem);

            Console.WriteLine(chosenID.ToString());

            System.Collections.Generic.List <clsDocument> documentList    = new System.Collections.Generic.List <clsDocument>();
            System.Collections.Generic.List <int>         documentlistIDs = new System.Collections.Generic.List <int>();
            for (int i = 0; i < tbl.Length(); i++)
            {
                if (chosenID.ToString() == tbl.Value(i, clsDocument.PropertyColumn))
                {
                    clsDocument document = new clsDocument(i);
                    documentList.Add(document);
                    Console.Write(tbl.Value(i, clsDocument.PropertyColumn));
                    documentlistIDs.Add(i);
                }
            }

            clsCSVTable documentRecordTable = new clsCSVTable(clsDocumentRecord.strDocumentRecordPath);
            clsCSVTable tblEntities         = new clsCSVTable(clsEntity.strEntityPath);

            for (int iDocIndex = 0; iDocIndex < documentlistIDs.Count; iDocIndex++)
            {
                int docID = documentlistIDs[iDocIndex];
                documentRecordHistory.StringValue += documentList[iDocIndex].Name() + "\n";
                for (int i = 0; i < documentRecordTable.Length(); i++)
                {
                    if (documentRecordTable.Value(i, clsDocumentRecord.DocumentColumn) == docID.ToString())
                    {
                        int senderID     = Int32.Parse(documentRecordTable.Value(i, clsDocumentRecord.SenderColumn));
                        int receiverID   = Int32.Parse(documentRecordTable.Value(i, clsDocumentRecord.ReceiverColumn));
                        int status       = Int32.Parse(documentRecordTable.Value(i, clsDocumentRecord.StatusColumn));
                        int transmission = Int32.Parse(documentRecordTable.Value(i, clsDocumentRecord.TransmissionColumn));
                        Console.WriteLine(documentRecordTable.Value(i, clsDocumentRecord.DocumentColumn));
                        //documentRecordHistory.StringValue += "Doc record ID: " + i + ", Action date: " + (documentRecordTable.Value(i, clsDocumentRecord.ActionDateColumn)) + ", Record date: "+ (documentRecordTable.Value(i, clsDocumentRecord.RecordDateColumn)) + ", Sender ID: " + (documentRecordTable.Value(i, clsDocumentRecord.SenderColumn)) + ", Reciever ID: " + (documentRecordTable.Value(i, clsDocumentRecord.ReceiverColumn)) + ", Status: " + (documentRecordTable.Value(i, clsDocumentRecord.StatusColumn)) + ", Transmission method: " + (documentRecordTable.Value(i, clsDocumentRecord.TransmissionColumn)) + "\n";

                        string Sender   = tblEntities.Value(senderID, clsEntity.NameColumn);
                        string Reciever = tblEntities.Value(receiverID, clsEntity.NameColumn);
                        clsDocumentRecord.Status Status = (clsDocumentRecord.Status)(status);
                        string StatusString             = Status.ToString();
                        //Titles


                        if (Sender.Length > 15)
                        {
                            Sender = Sender.Substring(0, 15);
                        }
                        else
                        {
                            while (Sender.Length < 15)
                            {
                                Sender = Sender + " ";
                            }
                        }
                        documentRecordHistory.StringValue += "\t" + "\t" + "\t" + Sender;
                        // Now it is the reciever length
                        if (Reciever.Length > 15)
                        {
                            Reciever = Reciever.Substring(0, 15);
                        }
                        else
                        {
                            while (Reciever.Length < 15)
                            {
                                Reciever = Reciever + " ";
                            }
                        }
                        documentRecordHistory.StringValue += ", " + Reciever;

                        documentRecordHistory.StringValue += ",  " + DateTime.Parse(documentRecordTable.Value(i, clsDocumentRecord.ActionDateColumn)).ToString("MM/dd/yy hh:mm");
                        documentRecordHistory.StringValue += ", " + DateTime.Parse(documentRecordTable.Value(i, clsDocumentRecord.RecordDateColumn)).ToString("MM/dd/yy hh:mm");
                        while (StatusString.Length < 12)
                        {
                            StatusString = StatusString + " ";
                        }
                        documentRecordHistory.StringValue += ", " + StatusString;
                        documentRecordHistory.StringValue += ", " + (clsDocumentRecord.Transmission)(transmission) + "\n";
                    }
                }
            }
        }
Пример #5
0
        private void Update()
        {
            // Update Stored Values
            this.addressSelected = ((ComboBoxStringListDataSource)PropertyChooser.DataSource).Value((int)PropertyChooser.SelectedIndex);
            this.docList         = clsDocument.Documents(clsProperty.IDFromAddress(this.addressSelected));
            this.docID           = -1;
            if (this.docList != null)
            {
                foreach (clsDocument doc in this.docList)
                {
                    if ((int)doc.DocumentType() == DocumentChooser.SelectedIndex)
                    {
                        this.docID   = doc.ID();
                        this.docType = doc.DocumentType();
                    }
                }
            }
            this.senderID   = (int)SenderChooser.SelectedIndex;
            this.receiverID = (int)ReceiverChooser.SelectedIndex;
            if ((int)StatusChooser.SelectedIndex >= 0)
            {
                this.status = (clsDocumentRecord.Status)((int)StatusChooser.SelectedIndex);
            }
            else
            {
                this.status = clsDocumentRecord.Status.Unkown;
            }
            if ((int)TransmitChooser.SelectedIndex >= 0)
            {
                this.transmittal = (clsDocumentRecord.Transmission)((int)TransmitChooser.SelectedIndex);
            }
            else
            {
                this.transmittal = clsDocumentRecord.Transmission.Unknown;
            }

            // Update Labels
            ChosenDocumentLabel.StringValue = "";
            if (this.addressSelected != null)
            {
                ChosenDocumentLabel.StringValue = this.addressSelected;
            }
            if (DocumentChooser.SelectedIndex >= 0)
            {
                ChosenDocumentLabel.StringValue += " | " + ((clsDocument.Type)((int)DocumentChooser.SelectedIndex)).ToString();
            }
            ChosenDocumentLabel.StringValue += " (" + docID.ToString() + ")";

            SenderReceiverLabel.StringValue = "";
            if (senderID >= 0)
            {
                SenderReceiverLabel.StringValue = entityList[senderID].Name();
            }
            SenderReceiverLabel.StringValue += " --> ";
            if (receiverID >= 0)
            {
                SenderReceiverLabel.StringValue += entityList[receiverID].Name();
            }
            SenderReceiverLabel.StringValue += "  |  " + this.status.ToString() + "," + this.transmittal.ToString();

            dtAction = (DateTime)ActionDateChooser.DateValue;
            dtRecord = (DateTime)RecordDateChooser.DateValue;

            SaveMessage.StringValue = "";
        }
Пример #6
0
        private string DocStatus(clsLoan.State loanStatus, List <clsDocumentRecord> documentRecords, List <clsDocument.Type> docTypes)
        {
            clsDocumentRecord.Transmission TAny = clsDocumentRecord.Transmission.Unknown;
            clsDocumentRecord.Status       SAny = clsDocumentRecord.Status.Unkown;
            int  EAny   = -1;
            bool red    = false;
            bool yellow = false;
            bool green  = false;

            // if Pending Acquisition or Later
            if ((loanStatus == clsLoan.State.PendingAcquisition) ||
                (loanStatus == clsLoan.State.Listed) ||
                (loanStatus == clsLoan.State.Rehab) ||
                (loanStatus == clsLoan.State.PendingSale) ||
                (loanStatus == clsLoan.State.Sold))
            {
                if (!DocListContains(documentRecords, docTypes, clsDocument.Type.Calculator, TAny, SAny, EAny, this.lenderID))
                {
                    red = true;
                }
                else if (!DocListContains(documentRecords, docTypes, clsDocument.Type.BPO, TAny, SAny, EAny, this.lenderID))
                {
                    yellow = true;
                }
                else if (!((DocListContains(documentRecords, docTypes, clsDocument.Type.Mortgage, TAny, SAny, this.lenderID, EAny)) &&
                           (DocListContains(documentRecords, docTypes, clsDocument.Type.PurchaseStatement, TAny, SAny, EAny, this.lenderID)) &&
                           (DocListContains(documentRecords, docTypes, clsDocument.Type.EscrowInstructionLetter, TAny, SAny, EAny, this.lenderID)) &&
                           (DocListContains(documentRecords, docTypes, clsDocument.Type.EscrowInstructionLetter, TAny, clsDocumentRecord.Status.Executed, this.lenderID, EAny)) &&
                           (DocListContains(documentRecords, docTypes, clsDocument.Type.ClosingProtectionLetter, TAny, clsDocumentRecord.Status.Executed, EAny, this.lenderID)) &&
                           (DocListContains(documentRecords, docTypes, clsDocument.Type.TitleCommitment, TAny, SAny, EAny, this.lenderID)) &&
                           (DocListContains(documentRecords, docTypes, clsDocument.Type.TitleWork, TAny, SAny, EAny, this.lenderID)) &&
                           (DocListContains(documentRecords, docTypes, clsDocument.Type.ProFormaLenderPolicy, TAny, SAny, EAny, this.lenderID)) &&
                           (DocListContains(documentRecords, docTypes, clsDocument.Type.RehabBid, TAny, SAny, EAny, this.lenderID)) &&
                           (DocListContains(documentRecords, docTypes, clsDocument.Type.HomeownersInsurance, TAny, SAny, EAny, this.lenderID))))
                {
                    green = true;
                }
            }

            // if Acquired or Later
            if ((loanStatus == clsLoan.State.Listed) ||
                (loanStatus == clsLoan.State.Rehab) ||
                (loanStatus == clsLoan.State.PendingSale) ||
                (loanStatus == clsLoan.State.Sold))
            {
                if (!((DocListContains(documentRecords, docTypes, clsDocument.Type.ProFormaLenderPolicy, TAny, SAny, EAny, this.lenderID)) &&
                      (DocListContains(documentRecords, docTypes, clsDocument.Type.ClosingProtectionLetter, TAny, clsDocumentRecord.Status.Executed, EAny, this.lenderID)) &&
                      (DocListContains(documentRecords, docTypes, clsDocument.Type.EscrowInstructionLetter, TAny, clsDocumentRecord.Status.Executed, EAny, this.lenderID)) &&
                      (DocListContains(documentRecords, docTypes, clsDocument.Type.PurchaseStatement, clsDocumentRecord.Transmission.Electronic, clsDocumentRecord.Status.Executed, EAny, this.lenderID)) &&
                      (DocListContains(documentRecords, docTypes, clsDocument.Type.Mortgage, clsDocumentRecord.Transmission.Electronic, clsDocumentRecord.Status.Executed, EAny, this.lenderID)) &&
                      (DocListContains(documentRecords, docTypes, clsDocument.Type.PurchaseStatement, clsDocumentRecord.Transmission.Electronic, clsDocumentRecord.Status.Executed, this.lenderID, EAny)) &&
                      (DocListContains(documentRecords, docTypes, clsDocument.Type.Mortgage, clsDocumentRecord.Transmission.Electronic, clsDocumentRecord.Status.Executed, this.lenderID, EAny))))
                {
                    red = true;
                }
                else if (!((DocListContains(documentRecords, docTypes, clsDocument.Type.RehabBid, TAny, SAny, EAny, this.lenderID)) &&
                           (DocListContains(documentRecords, docTypes, clsDocument.Type.HomeownersInsurance, TAny, SAny, EAny, this.lenderID)) &&
                           (DocListContains(documentRecords, docTypes, clsDocument.Type.TitleCommitment, TAny, SAny, EAny, this.lenderID)) &&
                           (DocListContains(documentRecords, docTypes, clsDocument.Type.TitleWork, TAny, SAny, EAny, this.lenderID)) &&
                           (DocListContains(documentRecords, docTypes, clsDocument.Type.Mortgage, clsDocumentRecord.Transmission.Post, clsDocumentRecord.Status.Executed, EAny, this.lenderID))))
                {
                    yellow = true;
                }
            }

            // if Under Contract to Sell or Sold
            if ((loanStatus == clsLoan.State.PendingSale) ||
                (loanStatus == clsLoan.State.Sold))
            {
                if (!((DocListContains(documentRecords, docTypes, clsDocument.Type.SaleContract, TAny, clsDocumentRecord.Status.Executed, EAny, this.lenderID)) &&
                      (DocListContains(documentRecords, docTypes, clsDocument.Type.LoanPayoffLetter, TAny, SAny, this.lenderID, EAny))))
                {
                    green = true;
                }
            }

            // if Sold
            if (loanStatus == clsLoan.State.Sold)
            {
                if (!DocListContains(documentRecords, docTypes, clsDocument.Type.SaleContract, TAny, clsDocumentRecord.Status.Executed, EAny, this.lenderID))
                {
                    red = true;
                }
                else if (!((DocListContains(documentRecords, docTypes, clsDocument.Type.Discharge, clsDocumentRecord.Transmission.Post, clsDocumentRecord.Status.Notarized, this.lenderID, EAny)) &&
                           (DocListContains(documentRecords, docTypes, clsDocument.Type.SaleStatement, TAny, clsDocumentRecord.Status.Executed, EAny, this.lenderID)) &&
                           (DocListContains(documentRecords, docTypes, clsDocument.Type.SaleStatement, TAny, clsDocumentRecord.Status.Executed, this.lenderID, EAny)) &&
                           (DocListContains(documentRecords, docTypes, clsDocument.Type.ProfitStatement, TAny, SAny, EAny, this.lenderID)) &&
                           (DocListContains(documentRecords, docTypes, clsDocument.Type.ProfitStatement, TAny, SAny, this.lenderID, EAny))
                           ))
                {
                    green = true;
                }
            }

            string docstatus = "COMPLETE";

            if (red)
            {
                docstatus = "MUSTHAVE";
            }
            else if (yellow)
            {
                docstatus = "SHOULDHAVE";
            }
            else if (green)
            {
                docstatus = "TODO";
            }

            return(docstatus);
        }
Пример #7
0
        private string[] DocStatus(clsLoan.State loanStatus, List <clsDocumentRecord> documentRecords, List <clsDocument.Type> docTypes, clsDocument.Type docType)
        {
            bool orange = false;
            bool red    = false;
            bool yellow = false;
            bool green  = false;

            clsDocumentRecord.Transmission TAny = clsDocumentRecord.Transmission.Unknown;
            clsDocumentRecord.Status       SAny = clsDocumentRecord.Status.Unkown;
            int    EAny   = -1;
            string reason = " ";

            ///////////////////////////////////////////////////////////////////////////////////
            // Pending Acquisition or Later
            ///////////////////////////////////////////////////////////////////////////////////
            if ((loanStatus == clsLoan.State.PendingAcquisition) ||
                (loanStatus == clsLoan.State.Listed) ||
                (loanStatus == clsLoan.State.Rehab) ||
                (loanStatus == clsLoan.State.PendingSale) ||
                (loanStatus == clsLoan.State.Sold))
            {
                switch (docType)
                {
                //RED
                case clsDocument.Type.Calculator:
                    if (!DocListContains(documentRecords, docTypes, docType, TAny, SAny, EAny, this.lenderID))
                    {
                        red    = true;
                        reason = "!r";
                    }
                    break;

                //YELLOW
                case clsDocument.Type.BPO:
                    if (!DocListContains(documentRecords, docTypes, docType, TAny, SAny, EAny, this.lenderID))
                    {
                        reason = "!r";
                        yellow = true;
                    }
                    break;

                //GREEN
                case clsDocument.Type.TitleCommitment:
                case clsDocument.Type.TitleWork:
                case clsDocument.Type.ProFormaLenderPolicy:
                case clsDocument.Type.RehabBid:
                case clsDocument.Type.HomeownersInsurance:
                case clsDocument.Type.PurchaseStatement:
                    if (!DocListContains(documentRecords, docTypes, docType, TAny, SAny, EAny, this.lenderID))
                    {
                        reason = "!r";
                        green  = true;
                    }
                    break;

                //case clsDocument.Type.Mortgage:
                //if (!DocListContains(documentRecords, docTypes, docType, TAny, SAny, this.lenderID, EAny))
                //    green = true;
                //break;
                case clsDocument.Type.ClosingProtectionLetter:
                    if (!DocListContains(documentRecords, docTypes, docType, TAny, clsDocumentRecord.Status.Executed, EAny, this.lenderID))
                    {
                        reason = "!R";
                        green  = true;
                    }
                    break;

                case clsDocument.Type.EscrowInstructionLetter:
                    if (!DocListContains(documentRecords, docTypes, docType, TAny, SAny, this.lenderID, EAny))
                    {
                        reason = "!s";
                        green  = true;
                    }
                    else if (!DocListContains(documentRecords, docTypes, docType, TAny, clsDocumentRecord.Status.Executed, EAny, this.lenderID))
                    {
                        reason = "!R";
                        green  = true;
                    }
                    break;
                }
            }

            ///////////////////////////////////////////////////////////////////////////////////
            // Acquired or Later
            ///////////////////////////////////////////////////////////////////////////////////
            if ((loanStatus == clsLoan.State.Listed) ||
                (loanStatus == clsLoan.State.Rehab) ||
                (loanStatus == clsLoan.State.PendingSale) ||
                (loanStatus == clsLoan.State.Sold))
            {
                switch (docType)
                {
                //RED OR ORANGE
                case clsDocument.Type.ProFormaLenderPolicy:
                case clsDocument.Type.ClosingProtectionLetter:
                    if (!DocListContains(documentRecords, docTypes, docType, TAny, SAny, EAny, this.lenderID))
                    {
                        reason = "!r";
                        red    = true;
                    }
                    break;

                case clsDocument.Type.EscrowInstructionLetter:
                case clsDocument.Type.Mortgage:     // no requirement to send executed mortgage to fund admin
                    if (!DocListContains(documentRecords, docTypes, docType, TAny, clsDocumentRecord.Status.Executed, EAny, this.lenderID))
                    {
                        if (DocListContains(documentRecords, docTypes, docType, TAny, clsDocumentRecord.Status.Unkown, EAny, this.lenderID))
                        {
                            reason = "U!R";
                            orange = true;
                        }
                        else
                        {
                            reason = "!R";
                            red    = true;
                        }
                    }
                    break;

                case clsDocument.Type.PurchaseStatement:
                    if (!DocListContains(documentRecords, docTypes, docType, TAny, clsDocumentRecord.Status.Executed, EAny, this.lenderID))
                    {
                        if (DocListContains(documentRecords, docTypes, docType, TAny, clsDocumentRecord.Status.Unkown, EAny, this.lenderID))
                        {
                            reason = "U!R";
                            orange = true;
                        }
                        else
                        {
                            reason = "!R";
                            red    = true;
                        }
                    }
                    else if (!DocListContains(documentRecords, docTypes, docType, TAny, clsDocumentRecord.Status.Executed, this.lenderID, EAny))
                    {
                        if (DocListContains(documentRecords, docTypes, docType, TAny, clsDocumentRecord.Status.Unkown, this.lenderID, EAny))
                        {
                            reason = "U!S";
                            orange = true;
                        }
                        else
                        {
                            reason = "!S";
                            red    = true;
                        }
                    }
                    break;

                //YELLOW
                case clsDocument.Type.RehabBid:
                case clsDocument.Type.HomeownersInsurance:
                case clsDocument.Type.TitleWork:
                case clsDocument.Type.TitleCommitment:
                    if (!DocListContains(documentRecords, docTypes, docType, TAny, SAny, EAny, this.lenderID))
                    {
                        reason = "!r";
                        yellow = true;
                    }
                    break;
                }
                if ((!red) && (!orange) && (!yellow) && (docType == clsDocument.Type.Mortgage) &&
                    (!DocListContains(documentRecords, docTypes, docType, clsDocumentRecord.Transmission.Post, clsDocumentRecord.Status.Executed, EAny, this.lenderID)))
                {
                    reason = "!RP";
                    yellow = true;
                }
            }

            ///////////////////////////////////////////////////////////////////////////////////
            // Pending Sale or Sold
            ///////////////////////////////////////////////////////////////////////////////////
            if ((loanStatus == clsLoan.State.PendingSale) ||
                (loanStatus == clsLoan.State.Sold))
            {
                if ((!red) && (!yellow) && (!green))
                {
                    if ((docType == clsDocument.Type.SaleContract) && (!DocListContains(documentRecords, docTypes, docType, TAny, clsDocumentRecord.Status.Executed, EAny, this.lenderID)))
                    {
                        reason = "!R";
                        green  = true;
                    }
                    else if ((docType == clsDocument.Type.LoanPayoffLetter) && (!DocListContains(documentRecords, docTypes, docType, TAny, SAny, this.lenderID, EAny)))
                    {
                        reason = "!s";
                        green  = true;
                    }
                }
            }

            ///////////////////////////////////////////////////////////////////////////////////
            // Sold
            ///////////////////////////////////////////////////////////////////////////////////
            if (loanStatus == clsLoan.State.Sold)
            {
                if (!red)
                {
                    if ((docType == clsDocument.Type.SaleContract) && (!DocListContains(documentRecords, docTypes, docType, TAny, clsDocumentRecord.Status.Executed, EAny, this.lenderID)))
                    {
                        reason = "!R";
                        yellow = true;
                    }
                    else if ((!yellow) && (!green))
                    {
                        if ((docType == clsDocument.Type.Discharge) &&
                            (!DocListContains(documentRecords, docTypes, docType, clsDocumentRecord.Transmission.Post, clsDocumentRecord.Status.Notarized, this.lenderID, EAny)))
                        {
                            reason = "!SN";
                            green  = true;
                        }
                        else if (docType == clsDocument.Type.SaleStatement)
                        {
                            if (!DocListContains(documentRecords, docTypes, docType, TAny, clsDocumentRecord.Status.Executed, this.lenderID, EAny))
                            {
                                reason = "!S";
                                green  = true;
                            }
                            else if (!DocListContains(documentRecords, docTypes, docType, TAny, clsDocumentRecord.Status.Executed, EAny, this.lenderID))
                            {
                                reason = "!R";
                                green  = true;
                            }
                        }
                        else if (docType == clsDocument.Type.ProfitStatement)
                        {
                            if (!DocListContains(documentRecords, docTypes, docType, TAny, SAny, this.lenderID, EAny))
                            {
                                reason = "!s";
                                green  = true;
                            }
                            else if (!DocListContains(documentRecords, docTypes, docType, TAny, SAny, EAny, this.lenderID))
                            {
                                reason = "!r";
                                green  = true;
                            }
                        }
                    }
                }
            }

            // calculate return value
            string[] docstatus = new string[2];
            if (orange)
            {
                docstatus[0] = "MIGHTHAVE";
            }
            else if (red)
            {
                docstatus[0] = "MUSTHAVE";
            }
            else if (yellow)
            {
                docstatus[0] = "SHOULDHAVE";
            }
            else if (green)
            {
                docstatus[0] = "TODO";
            }
            else
            {
                docstatus[0] = "COMPLETE";
            }
            docstatus[1] = reason;
            return(docstatus);
        }