Example #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;
 }
Example #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);
     }
 }
Example #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);
        }
Example #4
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 = "";
        }
Example #5
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);
        }
Example #6
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);
        }