partial void RecordButtonPushed(NSButton sender) { if ((docID >= 0) && (senderID >= 0) && (receiverID >= 0) && (dtAction > dtMinDate) && (dtRecord > dtMinDate)) { clsDocumentRecord newRecord = new clsDocumentRecord(docID, dtRecord, dtAction, senderID, receiverID, status, transmittal); if (newRecord.Save()) { SaveMessage.StringValue = "Saved New Document Record " + newRecord.ID().ToString(); SaveMessage.TextColor = NSColor.Gray; } else { SaveMessage.StringValue = "Save Failed"; SaveMessage.TextColor = NSColor.Red; } // check for recording information if ((this.docType == (int)clsDocument.Type.Mortgage) && (this.status == clsDocumentRecord.Status.Notarized)) { int iBook = 0; int iPage = 0; int iInstrument = 0; int iParcel = 0; if (this.loan.Property().State() == "PA") { iParcel = this.PageTextField.IntValue; iInstrument = this.BookInstrumentTextField.IntValue; } else { iBook = this.BookInstrumentTextField.IntValue; iPage = this.PageTextField.IntValue; } clsLoanRecording lr = new clsLoanRecording(this.loan.ID(), iBook, iPage, iInstrument, iParcel, this.dtAction); if (lr.Save()) { SaveMessage.StringValue += ". Recording Saved."; } else { SaveMessage.StringValue += ". Failed to Save Recording."; } } } else { SaveMessage.StringValue = "Unable to Create New Record"; SaveMessage.TextColor = NSColor.Red; } }
private void _TestDocumentRecord() { for (int i = 0; i < 25; i++) { clsDocumentRecord docRec = new clsDocumentRecord(i); Console.WriteLine(docRec.StatusType().ToString() + "," + docRec.TransmissionType().ToString() + "," + docRec.DocumentID().ToString() + "," + docRec.ReceiverID().ToString()); } clsCSVTable testTable = new clsCSVTable(clsDocumentRecord.strDocumentRecordPath); testTable.SaveAs("/Users/" + Environment.UserName + "/Documents/Professional/Resilience/tblDocumentRecordTest.csv"); clsDocumentRecord newRec = new clsDocumentRecord(1, System.DateTime.Now, System.DateTime.Today, 1, 2, clsDocumentRecord.Status.Notarized, clsDocumentRecord.Transmission.Electronic); Console.WriteLine(newRec.Save("/Users/" + Environment.UserName + "/Documents/Professional/Resilience/tblDocumentRecordTest.csv")); }
partial void RecordButtonPushed(NSButton sender) { if ((docID >= 0) && (senderID >= 0) && (receiverID >= 0) && (dtAction > dtMinDate) && (dtRecord > dtMinDate)) { clsDocumentRecord newRecord = new clsDocumentRecord(docID, dtRecord, dtAction, senderID, receiverID, status, transmittal); if (newRecord.Save()) { SaveMessage.StringValue = "Saved New Document Record " + newRecord.ID().ToString(); SaveMessage.TextColor = NSColor.Black; } else { SaveMessage.StringValue = "Save Failed"; SaveMessage.TextColor = NSColor.Red; } } else { SaveMessage.StringValue = "Unable to Create New Record"; SaveMessage.TextColor = NSColor.Red; } }
private void ScheduleNewSale() { DateTime scheduledSale = (DateTime)this.SaleDatePicker.DateValue; if (scheduledSale <= System.DateTime.Today.Date) { this.StatusMessageTextField.StringValue = "Can't schedule a new sale in the past."; } else { // check to make sure scheduled date is after all rehabs if (scheduledSale < this.loan.FindDate(clsCashflow.Type.RehabDraw, false, true)) { scheduledSale = this.loan.FindDate(clsCashflow.Type.RehabDraw, false, true).AddDays(1); this.StatusMessageTextField.StringValue = "Proposed Sale Date is before last Rehab Date. \nChanging Sale Date to " + scheduledSale.ToString("MM/dd/yyyy"); } double dImpliedAdditional = this.loan.ImpliedAdditionalInterest(); // expire Projected Disposition foreach (clsCashflow cf in this.loan.Cashflows()) { if ((cf.TypeID() == clsCashflow.Type.NetDispositionProj) && (cf.DeleteDate() > System.DateTime.Today.AddYears(50))) { this.StatusMessageTextField.StringValue += "\nProjected Disposition Deleted as of Today."; cf.Delete(System.DateTime.Today); } } // schedule principal repay double dPrincipalRepay = this.loan.LoanAsOf(scheduledSale).Balance(scheduledSale); this.loan.AddCashflow(new clsCashflow(scheduledSale, System.DateTime.Today, System.DateTime.MaxValue, this.loan.ID(), dPrincipalRepay, false, clsCashflow.Type.Principal)); this.StatusMessageTextField.StringValue += "\nPrincipal Added: " + dPrincipalRepay.ToString("000,000.00"); this.StatusMessageTextField.StringValue += "," + scheduledSale.ToString("MM/dd/yyyy"); // schedule hard interest double dHardInterest = this.loan.LoanAsOf(scheduledSale).AccruedInterest(scheduledSale); double perdiem = dHardInterest - this.loan.LoanAsOf(scheduledSale.AddDays(-1)).AccruedInterest(scheduledSale.AddDays(-1)); this.loan.AddCashflow(new clsCashflow(scheduledSale, System.DateTime.Today, System.DateTime.MaxValue, this.loan.ID(), dHardInterest, false, clsCashflow.Type.InterestHard)); this.StatusMessageTextField.StringValue += "\nInterest Added: " + dHardInterest.ToString("000,000.00"); this.StatusMessageTextField.StringValue += "," + scheduledSale.ToString("MM/dd/yyyy"); // schedule additional interest double dAdditionalInterest = this.ExpectedAdditionalInterestTextField.DoubleValue; this.loan.AddCashflow(new clsCashflow(scheduledSale.AddDays(7), System.DateTime.Today, System.DateTime.MaxValue, this.loan.ID(), dAdditionalInterest, false, clsCashflow.Type.InterestAdditional)); this.StatusMessageTextField.StringValue += "\nAddlInt Added: " + dAdditionalInterest.ToString("000,000.00"); this.StatusMessageTextField.StringValue += "," + scheduledSale.AddDays(7).ToString("MM/dd/yyyy"); this.StatusMessageTextField.StringValue += "\nPrev AddlInt: " + dImpliedAdditional.ToString("000,000.00"); this.StatusMessageTextField.StringValue += "\nSave = " + this.loan.Save().ToString(); this.ShowLoanPayoffLetterInfo(dPrincipalRepay, dHardInterest, perdiem); // Record Sale Contract if (this.bRecordSaleContract) { clsDocument saleContract = new clsDocument(clsDocument.DocumentID(this.loan.PropertyID(), clsDocument.Type.SaleContract)); clsDocumentRecord saleContractRecord = new clsDocumentRecord(saleContract.ID(), System.DateTime.Now, (DateTime)this.RecordDatePicker.DateValue, this.loan.CoBorrowerID(), this.loan.LenderID(), clsDocumentRecord.Status.Preliminary, clsDocumentRecord.Transmission.Electronic); if (saleContractRecord.Save()) { this.StatusMessageTextField.StringValue += "\nSale Contract Recorded"; } else { this.StatusMessageTextField.StringValue += "\nSale Contract FAILED TO RECORD"; } } else { this.StatusMessageTextField.StringValue += "\nSale Contract NOT RECORDED"; } } }