public clsDocument(string name, int propertyID, clsDocument.Type type) { this.iDocumentID = _NewDocumentID(); this.strName = name; this.iPropertyID = propertyID; this.tType = type; }
public static int DocumentID(int propertyID, clsDocument.Type type) { int id = -1; foreach (clsDocument doc in clsDocument.Documents(propertyID)) { if (doc.tType == type) id = doc.iDocumentID; } return id; }
private bool _Load(int id, clsCSVTable tbl) { if (id < tbl.Length()) { this.iDocumentID = id; this.strName = tbl.Value(id, clsDocument.NameColumn); this.iPropertyID = Int32.Parse(tbl.Value(id, clsDocument.PropertyColumn)); this.tType = (clsDocument.Type)Int32.Parse(tbl.Value(id, clsDocument.TypeColumn)); return true; } else { return false; } }
private bool _Load(int id) { clsCSVTable tbl = new clsCSVTable(clsDocument.strDocumentPath); if (id < tbl.Length()) { this.iDocumentID = id; this.strName = tbl.Value(id, clsDocument.NameColumn); this.iPropertyID = Int32.Parse(tbl.Value(id, clsDocument.PropertyColumn)); this.tType = (clsDocument.Type)Int32.Parse(tbl.Value(id, clsDocument.TypeColumn)); return(true); } else { return(false); } }
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 = ""; }
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); }
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); }