Exemplo n.º 1
0
 public bool Save(string path)
 {
     clsCSVTable tbl = new clsCSVTable(path);
     if (this.iDocumentID == tbl.Length())
     {
         string[] strValues = new string[tbl.Width() - 1];
         strValues[clsDocument.NameColumn - 1] = this.strName;
         strValues[clsDocument.PropertyColumn - 1] = this.iPropertyID.ToString();
         strValues[clsDocument.TypeColumn - 1] = ((int)this.tType).ToString();
         tbl.New(strValues);
         return tbl.Save();
     }
     else
     {
         if ((this.iDocumentID < tbl.Length()) && (this.iDocumentID >= 0))
         {
             if (
                 tbl.Update(this.iDocumentID, clsDocument.NameColumn, this.strName) &&
                 tbl.Update(this.iDocumentID, clsDocument.PropertyColumn, this.iPropertyID.ToString()) &&
                 tbl.Update(this.iDocumentID, clsDocument.TypeColumn, ((int)this.tType).ToString()))
             {
                 return tbl.Save();
             }
             else
             {
                 return false;
             }
         }
         else
         {
             return false;
         }
     }
 }
Exemplo n.º 2
0
        public int Save(string path)
        {
            clsCSVTable tbl = new clsCSVTable(path);

            if (this.iTransactionID == -1) // new cashflow, unassigned id
            {
                string[] strValues = new string[tbl.Width() - 1];
                this.iTransactionID = tbl.Length();
                strValues[clsCashflow.ActualColumn - 1]          = this.bActual.ToString().ToUpper();
                strValues[clsCashflow.TransactionTypeColumn - 1] = ((int)this.eTypeID).ToString();
                strValues[clsCashflow.LoanColumn - 1]            = this.iLoanID.ToString();
                strValues[clsCashflow.AmountColumn - 1]          = this.dAmount.ToString();
                strValues[clsCashflow.TransactionDateColumn - 1] = this.dtPayDate.ToString("MM/dd/yyyy");
                strValues[clsCashflow.RecordDateColumn - 1]      = this.dtRecordDate.ToString("MM/dd/yyyy");
                strValues[clsCashflow.DeleteDateColumn - 1]      = this.dtDeleteDate.ToString("MM/dd/yyyy");
                strValues[clsCashflow.CommentColumn - 1]         = this.strComment;
                tbl.New(strValues);
                if (tbl.Save())
                {
                    return(this.iTransactionID);
                }
                else
                {
                    return(clsCashflow.SaveFailedOnIO);
                }
            }
            else if (this.iTransactionID < tbl.Length()) // existing cashflow
            {
                if (
                    tbl.Update(this.iTransactionID, clsCashflow.ActualColumn, this.bActual.ToString()) &&
                    tbl.Update(this.iTransactionID, clsCashflow.TransactionTypeColumn, ((int)this.eTypeID).ToString()) &&
                    tbl.Update(this.iTransactionID, clsCashflow.LoanColumn, this.iLoanID.ToString()) &&
                    tbl.Update(this.iTransactionID, clsCashflow.AmountColumn, this.dAmount.ToString()) &&
                    tbl.Update(this.iTransactionID, clsCashflow.TransactionDateColumn, this.dtPayDate.ToString("MM/dd/yyyy")) &&
                    tbl.Update(this.iTransactionID, clsCashflow.RecordDateColumn, this.dtRecordDate.ToString("MM/dd/yyyy")) &&
                    tbl.Update(this.iTransactionID, clsCashflow.DeleteDateColumn, this.dtDeleteDate.ToString("MM/dd/yyyy")) &&
                    tbl.Update(this.iTransactionID, clsCashflow.CommentColumn, this.strComment)
                    )
                {
                    if (tbl.Save())
                    {
                        return(this.iTransactionID);
                    }
                    else
                    {
                        return(clsCashflow.SaveFailedOnIO);
                    }
                }
                else
                {
                    return(clsCashflow.SaveFailedOnDataInsertion);
                }
            }
            else // new cashflow, transactionID out of order past end of existing table
            {
                return(clsCashflow.SaveFailedOnIndexOutOfOrder);
            }
        }
Exemplo n.º 3
0
        public bool Save(string path)
        {
            clsCSVTable tbl = new clsCSVTable(path);

            if (this.iEntityID == tbl.Length())
            {
                string[] strValues = new string[tbl.Width() - 1];
                strValues[clsEntity.NameColumn - 1]             = this.strName;
                strValues[clsEntity.AddressColumn - 1]          = this.strAddress;
                strValues[clsEntity.TownColumn - 1]             = this.strTown;
                strValues[clsEntity.StateColumn - 1]            = this.strState;
                strValues[clsEntity.ZipCodeColumn - 1]          = this.iZipCode.ToString();
                strValues[clsEntity.PhoneNumberColumn - 1]      = this.strPhone;
                strValues[clsEntity.ContactNameColumn - 1]      = this.strContactName;
                strValues[clsEntity.ContactEmailColumn - 1]     = this.strEmail;
                strValues[clsEntity.PathAbbreviationColumn - 1] = this.strPathAbbrev;
                strValues[clsEntity.EntityTypeColumn - 1]       = ((int)this.tType).ToString();
                tbl.New(strValues);
                return(tbl.Save());
            }
            else
            {
                if ((this.iEntityID < tbl.Length()) && (this.iEntityID >= 0))
                {
                    if (
                        tbl.Update(this.iEntityID, clsEntity.NameColumn, this.strName) &&
                        tbl.Update(this.iEntityID, clsEntity.AddressColumn, this.strAddress) &&
                        tbl.Update(this.iEntityID, clsEntity.TownColumn, this.strTown) &&
                        tbl.Update(this.iEntityID, clsEntity.StateColumn, this.strState) &&
                        tbl.Update(this.iEntityID, clsEntity.ZipCodeColumn, this.iZipCode.ToString()) &&
                        tbl.Update(this.iEntityID, clsEntity.PhoneNumberColumn, this.strPhone) &&
                        tbl.Update(this.iEntityID, clsEntity.ContactNameColumn, this.strContactName) &&
                        tbl.Update(this.iEntityID, clsEntity.PathAbbreviationColumn, this.strPathAbbrev) &&
                        tbl.Update(this.iEntityID, clsEntity.ContactEmailColumn, this.strEmail) &&
                        tbl.Update(this.iEntityID, clsEntity.EntityTypeColumn, ((int)this.tType).ToString()))
                    {
                        return(tbl.Save());
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
        }
Exemplo n.º 4
0
        public bool Save(string path)
        {
            clsCSVTable tbl = new clsCSVTable(path);

            if (this.iDocumentRecordID == tbl.Length())
            {
                string[] strValues = new string[tbl.Width() - 1];
                strValues[clsDocumentRecord.DocumentColumn - 1]     = this.iDocumentID.ToString();
                strValues[clsDocumentRecord.ActionDateColumn - 1]   = this.dtAction.ToString();
                strValues[clsDocumentRecord.RecordDateColumn - 1]   = this.dtRecord.ToString();
                strValues[clsDocumentRecord.SenderColumn - 1]       = this.iSenderEntityID.ToString();
                strValues[clsDocumentRecord.ReceiverColumn - 1]     = this.iReceiverEntityID.ToString();
                strValues[clsDocumentRecord.StatusColumn - 1]       = ((int)this.eStatus).ToString();
                strValues[clsDocumentRecord.TransmissionColumn - 1] = ((int)this.eTransmission).ToString();
                tbl.New(strValues);
                return(tbl.Save());
            }
            else
            {
                if ((this.iDocumentRecordID < tbl.Length()) && (this.iDocumentRecordID >= 0))
                {
                    if (
                        tbl.Update(this.iDocumentRecordID, clsDocumentRecord.ActionDateColumn, this.dtAction.ToString()) &&
                        tbl.Update(this.iDocumentRecordID, clsDocumentRecord.DocumentColumn, this.iDocumentID.ToString()) &&
                        tbl.Update(this.iDocumentRecordID, clsDocumentRecord.ReceiverColumn, this.iReceiverEntityID.ToString()) &&
                        tbl.Update(this.iDocumentRecordID, clsDocumentRecord.RecordDateColumn, this.dtRecord.ToString()) &&
                        tbl.Update(this.iDocumentRecordID, clsDocumentRecord.SenderColumn, this.iSenderEntityID.ToString()) &&
                        tbl.Update(this.iDocumentRecordID, clsDocumentRecord.StatusColumn, ((int)this.eStatus).ToString()) &&
                        tbl.Update(this.iDocumentRecordID, clsDocumentRecord.TransmissionColumn, ((int)this.eTransmission).ToString()))
                    {
                        return(tbl.Save());
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
        }
Exemplo n.º 5
0
        public bool Save(string path)
        {
            clsCSVTable tbl = new clsCSVTable(path);

            if (this.iRecordingID == tbl.Length())
            {
                string[] strValues = new string[tbl.Width() - 1];
                strValues[clsLoanRecording.LoanIDColumn - 1]        = this.iLoanID.ToString();
                strValues[clsLoanRecording.BookColumn - 1]          = this.iBook.ToString();
                strValues[clsLoanRecording.PageColumn - 1]          = this.iPage.ToString();
                strValues[clsLoanRecording.InstrumentColumn - 1]    = this.iInstrument.ToString();
                strValues[clsLoanRecording.ParcelColumn - 1]        = this.iParcel.ToString();
                strValues[clsLoanRecording.RecordingDateColumn - 1] = this.dtRecording.ToString();
                tbl.New(strValues);
                return(tbl.Save());
            }
            else
            {
                if ((this.iRecordingID < tbl.Length()) && (this.iRecordingID >= 0))
                {
                    if (
                        tbl.Update(this.iRecordingID, clsLoanRecording.LoanIDColumn, this.iLoanID.ToString()) &&
                        tbl.Update(this.iRecordingID, clsLoanRecording.BookColumn, this.iBook.ToString()) &&
                        tbl.Update(this.iRecordingID, clsLoanRecording.PageColumn, this.iPage.ToString()) &&
                        tbl.Update(this.iRecordingID, clsLoanRecording.InstrumentColumn, this.iInstrument.ToString()) &&
                        tbl.Update(this.iRecordingID, clsLoanRecording.ParcelColumn, this.iParcel.ToString()) &&
                        tbl.Update(this.iRecordingID, clsLoanRecording.RecordingDateColumn, this.iRecordingID.ToString()))
                    {
                        return(tbl.Save());
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
        }
Exemplo n.º 6
0
        public bool Save(string path)
        {
            clsCSVTable tbl = new clsCSVTable(path);

            if (this.iPropertyID == tbl.Length())
            {
                string[] strValues = new string[tbl.Width() - 1];
                strValues[clsProperty.AddressColumn - 1]  = this.strAddress;
                strValues[clsProperty.BPOColumn - 1]      = this.dBPO.ToString();
                strValues[clsProperty.CountyColumn - 1]   = this.strCounty;
                strValues[clsProperty.TownColumn - 1]     = this.strTown;
                strValues[clsProperty.NickNameColumn - 1] = this.strNickname;
                strValues[clsProperty.StateColumn - 1]    = this.strState;
                tbl.New(strValues);
                return(tbl.Save());
            }
            else
            {
                if ((this.iPropertyID < tbl.Length()) && (this.iPropertyID >= 0))
                {
                    if (
                        tbl.Update(this.iPropertyID, clsProperty.AddressColumn, this.strAddress) &&
                        tbl.Update(this.iPropertyID, clsProperty.BPOColumn, this.dBPO.ToString()) &&
                        tbl.Update(this.iPropertyID, clsProperty.CountyColumn, this.strCounty) &&
                        tbl.Update(this.iPropertyID, clsProperty.TownColumn, this.strTown) &&
                        tbl.Update(this.iPropertyID, clsProperty.NickNameColumn, this.strNickname) &&
                        tbl.Update(this.iPropertyID, clsProperty.StateColumn, this.strState))
                    {
                        return(tbl.Save());
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
        }
Exemplo n.º 7
0
        public bool Save(string path, bool saveCashflows, string cfPath)
        {
            clsCSVTable tbl = new clsCSVTable(path);

            if (this.iLoanID < 0)
            {
                this.iLoanID = tbl.Length();
            }
            if (this.iLoanID == tbl.Length())
            {
                string[] strValues = new string[tbl.Width() - 1];
                strValues[clsLoan.CoBorrowerColumn - 1]   = this.iCoBorrowerEntityID.ToString();
                strValues[clsLoan.MaturityDateCoumn - 1]  = this.dtMaturity.ToShortDateString();
                strValues[clsLoan.OGDateColumn - 1]       = this.dtOrigination.ToShortDateString();
                strValues[clsLoan.PenaltyRateColumn - 1]  = this.dPenaltyRate.ToString();
                strValues[clsLoan.PropertyColumn - 1]     = this.iPropertyID.ToString();
                strValues[clsLoan.RateColumn - 1]         = this.dRate.ToString();
                strValues[clsLoan.TitleCompanyColumn - 1] = this.iAcquisitionTitleCompanyEntityID.ToString();
                strValues[clsLoan.TitleHolderColumn - 1]  = this.iTitleHolderEntityID.ToString();
                strValues[clsLoan.LenderColumn - 1]       = this.iLenderEntityID.ToString();
                tbl.New(strValues);
                if (tbl.Save())
                {
                    if (saveCashflows)
                    {
                        bool bCashflowsSaved = true;
                        foreach (clsCashflow cf in this.cfCashflows)
                        {
                            if (cf.Save(cfPath) < 0)
                            {
                                bCashflowsSaved = false;
                            }
                        }
                        return(bCashflowsSaved);
                    }
                    else
                    {
                        return(true);
                    }
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                if ((this.iLoanID < tbl.Length()) && (this.iLoanID >= 0))
                {
                    if (
                        tbl.Update(this.iLoanID, clsLoan.CoBorrowerColumn, this.iCoBorrowerEntityID.ToString()) &&
                        tbl.Update(this.iLoanID, clsLoan.MaturityDateCoumn, this.dtMaturity.ToShortDateString()) &&
                        tbl.Update(this.iLoanID, clsLoan.OGDateColumn, this.dtOrigination.ToShortDateString()) &&
                        tbl.Update(this.iLoanID, clsLoan.PenaltyRateColumn, this.dPenaltyRate.ToString()) &&
                        tbl.Update(this.iLoanID, clsLoan.PropertyColumn, this.iPropertyID.ToString()) &&
                        tbl.Update(this.iLoanID, clsLoan.RateColumn, this.dRate.ToString()) &&
                        tbl.Update(this.iLoanID, clsLoan.TitleCompanyColumn, this.iAcquisitionTitleCompanyEntityID.ToString()) &&
                        tbl.Update(this.iLoanID, clsLoan.LenderColumn, this.iLenderEntityID.ToString()) &&
                        tbl.Update(this.iLoanID, clsLoan.TitleHolderColumn, this.iTitleHolderEntityID.ToString()))
                    {
                        if (tbl.Save())
                        {
                            if (saveCashflows)
                            {
                                bool bCashflowsSaved = true;
                                foreach (clsCashflow cf in this.cfCashflows)
                                {
                                    if (cf.Save(cfPath) < 0)
                                    {
                                        bCashflowsSaved = false;
                                    }
                                }
                                return(bCashflowsSaved);
                            }
                            else
                            {
                                return(true);
                            }
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
        }