public static DeedDetails GetLatestDeedDetails(string propertyBBLE) { try { using (ACRISEntities acrisDBEntities = new ACRISEntities()) { LatestDeedDocument documentObj = acrisDBEntities.LatestDeedDocuments.FirstOrDefault(i => i.BBLE == propertyBBLE); if (documentObj == null) { Common.Logs.log().Error(string.Format("Error finding record for BBLE {0} in LatestDeedDocument", propertyBBLE)); return(null); } DeedDetails deedDetailsObj = new DeedDetails(); deedDetailsObj.deedDocument = documentObj; foreach (tfnGetDocumentParties_Result a in acrisDBEntities.tfnGetDocumentParties(documentObj.DeedUniqueKey, "BUYER").ToList()) { if (deedDetailsObj.owners == null) { deedDetailsObj.owners = new List <DeedParty>(); } deedDetailsObj.owners.Add(Mapper.Map <DeedParty>(a)); } return(deedDetailsObj); } } catch (Exception e) { Common.Logs.log().Error(string.Format("Error reading AreaAbstract{0}", Common.Logs.FormatException(e))); return(null); } }
public IHttpActionResult GetAllContractsOfSaleAndMemorandumsOfContract(string propertyBBLE) { if (!BAL.BBL.IsValidFormat(propertyBBLE)) { return(BadRequest("Incorrect BBLE - Borough Block Lot & Easement number")); } try { using (ACRISEntities acrisDBEntities = new ACRISEntities()) { List <vwDocumentsByBBLE> documentsObj = acrisDBEntities.vwDocumentsByBBLEs .Where(i => i.BBLE == propertyBBLE && (i.DocumentType == "CNTR" || i.DocumentType == "MCON")) .OrderByDescending(m => m.DocumentDate).ToList <vwDocumentsByBBLE>(); if (documentsObj == null || documentsObj.Count <= 0) { return(NotFound()); } return(Ok(documentsObj)); } } catch (Exception e) { Common.Logs.log().Error(string.Format("Error reading AreaAbstract DB{0}", Common.Logs.FormatException(e))); return(Common.HttpResponse.InternalError(Request, "Internal Error in processing request")); } }
public IHttpActionResult GetUnsatisfiedMortgages(string propertyBBLE) { if (!BAL.BBL.IsValidFormat(propertyBBLE)) { return(BadRequest("Incorrect BBLE - Borough Block Lot & Easement number")); } try { using (ACRISEntities acrisDBEntities = new ACRISEntities()) { List <tfnGetUnsatisfiedMortgages_Result> mortgagesList = acrisDBEntities.tfnGetUnsatisfiedMortgages(propertyBBLE).ToList(); if (mortgagesList == null || mortgagesList.Count <= 0) { return(NotFound()); } return(Ok(Mapper.Map <List <tfnGetUnsatisfiedMortgages_Result>, List <BAL.DeedDocument> >(mortgagesList))); } } catch (Exception e) { Common.Logs.log().Error(string.Format("Error reading AreaAbstract DB{0}", Common.Logs.FormatException(e))); return(Common.HttpResponse.InternalError(Request, "Internal Error in processing request")); } }
public static List <DocumentDetail> GetDocuments(string propertyBBL) { using (ACRISEntities acrisDBEntities = new ACRISEntities()) { return(Mapper.Map <List <tfnGetDocuments_Result>, List <DocumentDetail> >(acrisDBEntities.tfnGetDocuments(propertyBBL, null) .OrderByDescending(m => (m.DocumentDate != null) ? m.DocumentDate : m.DateRecorded) .ToList())); } }
public static List <MortgageDocumentDetail> GetMortgageChain(string propertyBBL) { using (ACRISEntities acrisDBEntities = new ACRISEntities()) { var resultList = acrisDBEntities.tfnGetMortgageChain(propertyBBL).OrderByDescending(m => (m.DocumentDate != null) ? m.DocumentDate : m.DateRecorded) .ThenByDescending(m => (m.RelatedDocumentDate != null) ? m.RelatedDocumentDate : m.RelatedDocumentRecordDate) .ToList(); if (resultList == null || resultList.Count == 0) { return(null); } List <MortgageDocumentDetail> mortgageChain = new List <MortgageDocumentDetail>(); string documentKey = ""; MortgageDocumentDetail mortgage = null; foreach (var rec in resultList) { if (documentKey != rec.UniqueKey) { documentKey = rec.UniqueKey; mortgage = Mapper.Map <MortgageDocumentDetail>(rec); mortgage.IsPaid = false; mortgage.Parties = Mapper.Map <List <tfnGetDocumentParties_Result>, List <DocumentParty> >(acrisDBEntities.tfnGetDocumentParties(rec.UniqueKey, null).ToList()); mortgageChain.Add(mortgage); } if (rec.RelatedDocumentUniqueKey != null) { if (mortgage.RelatedDocuments == null) { mortgage.RelatedDocuments = new List <MortgageRelatedDocumentDetail>(); } if (rec.RelatedDocumentType == "SAT") { mortgage.IsPaid = true; } MortgageRelatedDocumentDetail rDoc = new MortgageRelatedDocumentDetail(); rDoc.UniqueKey = rec.RelatedDocumentUniqueKey; rDoc.DocumentType = rec.RelatedDocumentType; rDoc.DocumentTypeDescription = rec.RelatedDocumentTypeDescription; rDoc.DocumentDate = rec.RelatedDocumentDate; rDoc.DateRecorded = rec.RelatedDocumentRecordDate; rDoc.URL = rec.RelatedDocumentURL; rDoc.Parties = Mapper.Map <List <tfnGetDocumentParties_Result>, List <DocumentParty> >(acrisDBEntities.tfnGetDocumentParties(rec.RelatedDocumentUniqueKey, null).ToList()); mortgage.RelatedDocuments.Add(rDoc); } } return(mortgageChain); } }
/// <summary> /// This function returns a list of unsatisfied mortgages and deletes any mortgage data stored for a mortgaged that is satisfied /// </summary> public static List <tfnGetUnsatisfiedMortgages_Result> GetSynchronizedData(string propertyBBL) { List <tfnGetUnsatisfiedMortgages_Result> uMortgagesList = null; //get all unsatisfied mortgage document records using (ACRISEntities acrisDBEntities = new ACRISEntities()) { uMortgagesList = acrisDBEntities.tfnGetUnsatisfiedMortgages(propertyBBL).ToList(); } //get all mortgage document records stored in webdata locally using (WebDataEntities wDBEntities = new WebDataEntities()) { if (uMortgagesList == null || uMortgagesList.Count <= 0) { wDBEntities.Mortgages.RemoveRange(wDBEntities.Mortgages.Where(x => x.BBL == propertyBBL)); } else { List <WebDataDB.Mortgage> webDataMortgageList = wDBEntities.Mortgages.Where(x => x.BBL == propertyBBL).ToList(); foreach (var wDBMortgage in webDataMortgageList) { bool found = false; foreach (var uMortgage in uMortgagesList) { if (uMortgage.URL == wDBMortgage.MortgageDocumentURI) { found = true; break; } } if (!found) { wDBEntities.Mortgages.Remove(wDBMortgage); } } } wDBEntities.SaveChanges(); } return(uMortgagesList); }
public static PropertyLotInformation GetLotInformation(string propertyBBLE) { try { using (ACRISEntities acrisDBEntities = new ACRISEntities()) { PropertyNotInAssessment propertyLotInformationObj = acrisDBEntities.PropertyNotInAssessments.FirstOrDefault(i => i.BBL == propertyBBLE); if (propertyLotInformationObj == null) { Common.Logs.log().Error(string.Format("Error finding record for BBLE {0} in ACRIS", propertyBBLE)); return(null); } return(Mapper.Map <PropertyLotInformation>(propertyLotInformationObj)); } } catch (Exception e) { Common.Logs.log().Error(string.Format("Error reading AreaAbstract{0}", Common.Logs.FormatException(e))); return(null); } }