private InvestorDS.PropertyRow AddPermPropertyFromInvAppRow(InvestorDS ds, InvestorDS.InvestorApplicationsRow currentInvAppRow, InvestorDS.InvestorRow invRow) { InvestorDS.PropertyDataTable prptyDT = ds.Property; InvestorDS.PropertyRow prptyNewR = prptyDT.NewPropertyRow(); prptyNewR.InvestorRow = invRow; prptyNewR.InvestorApplicationsRow = currentInvAppRow; prptyNewR.Street1 = currentInvAppRow.Property_Street1; prptyNewR.Street2 = currentInvAppRow.Property_Street2; prptyNewR.Suburb = currentInvAppRow.Property_Suburb; if (currentInvAppRow.IsProperty_PostCodeNull()) { prptyNewR.Postcode = -1; } else { prptyNewR.Postcode = currentInvAppRow.Property_PostCode; } prptyNewR.State = currentInvAppRow.Property_State; prptyNewR.Country = currentInvAppRow.Property_Country; //prptyNewR.PrimaryInvestorId = invRow.Id; // prptyNewR.InvestorApplicationId = currentInvAppRow.Id; prptyDT.AddPropertyRow(prptyNewR); return(prptyNewR); }
/// <summary> /// Copy a temporary investor application to permanent Investor /// </summary> public int InvestorApplication_to_newInvestor(int InvestorApplicationId) { InvestorDS.InvestorApplicationsDataTable invAppDT = null; // new InvestorDS.InvestorApplicationsDataTable(); InvestorDSTableAdapters.InvestorApplicationsTableAdapter invAppTA = new InvestorDSTableAdapters.InvestorApplicationsTableAdapter(); InvestorDS.InvestorApplicationsRow invAppRow = null; StringBuilder invAppErrorMsgSB = new StringBuilder(); //invAppTA invAppDT = invAppTA.GetDataById(InvestorApplicationId); if (1 != invAppDT.Rows.Count) { return(-1); } else { invAppRow = invAppDT.Rows[0] as InvestorDS.InvestorApplicationsRow; if (invAppRow.IsPrimary_LastNameNull()) { invAppErrorMsgSB.AppendLine("Primary Investor's Last Name cannot be null."); } if (invAppRow.IsPrimary_DOBNull()) { invAppErrorMsgSB.AppendLine("Primary Investor's DOB cannot be null."); } if (invAppErrorMsgSB.Length > 0) { string invAppErrorMsg = invAppErrorMsgSB.ToString(); throw new ApplicationException(invAppErrorMsg); } } InvestorDS.InvestorDataTable invDT = new InvestorDS.InvestorDataTable(); InvestorDS.InvestorRow invRow = invDT.NewRow() as InvestorDS.InvestorRow; invRow.InvestorApplicationId = invAppRow.Id; invRow.FirstName = invAppRow.Primary_FirstName.Trim(); invRow.LastName = invAppRow.Primary_LastName.Trim(); invRow.DOB = invAppRow.Primary_DOB; return(1); //invRow = invAppRow.Id }