private PPartnerRow RetrieveDonorRow(long APartnerKey) { if (APartnerKey == 0) { return(null); } // find PPartnerRow from dataset PPartnerRow DonorRow = (PPartnerRow)FMainDS.DonorPartners.Rows.Find(new object[] { APartnerKey }); // if PPartnerRow cannot be found, load it from db if ((DonorRow == null) || (DonorRow[PPartnerTable.GetReceiptEachGiftDBName()] == DBNull.Value)) { PPartnerTable PartnerTable = TRemote.MFinance.Gift.WebConnectors.LoadPartnerData(APartnerKey); if ((PartnerTable == null) || (PartnerTable.Rows.Count == 0)) { // invalid partner return(null); } else { FMainDS.DonorPartners.Merge(PartnerTable); } DonorRow = PartnerTable[0]; } return(DonorRow); }
private PPartnerRow RetrieveDonorRow(long APartnerKey) { if (APartnerKey == 0) { return(null); } // find PPartnerRow from dataset PPartnerRow DonorRow = (PPartnerRow)FMainDS.DonorPartners.Rows.Find(new object[] { APartnerKey }); // if PPartnerRow cannot be found, load it from db if ((DonorRow == null) || (DonorRow[PPartnerTable.GetReceiptEachGiftDBName()] == DBNull.Value)) { PPartnerTable PartnerTable = TRemote.MFinance.Gift.WebConnectors.LoadPartnerData(APartnerKey); if ((PartnerTable == null) || (PartnerTable.Rows.Count == 0)) { // invalid partner return(null); } else { FMainDS.DonorPartners.Merge(PartnerTable); if (TSystemDefaults.GetBooleanDefault("GovIdEnabled", false)) { PTaxTable taxTbl = TRemote.MFinance.Gift.WebConnectors.LoadPartnerPtax(APartnerKey); if ((taxTbl != null) && (taxTbl.Rows.Count > 0)) { FMainDS.PTax.Merge(taxTbl); } } } DonorRow = PartnerTable[0]; } return(DonorRow); }