public static Models.Loan MapFrom(this External.LoanObject loanObject, Models.Loan loan = null) { bool changed = false; var _primaryborrower = PersonExtension.MapFrom(loanObject, FieldList.PrimaryBorrower, loan?.PrimaryBorrower); changed = changed || (_primaryborrower != null); var _w2 = AttachmentExtension.MapFrom(loanObject, FieldList.W2, loan?.W2); changed = changed || (_w2 != null); changed = changed || loanObject.ContainsValues(FieldList.LoanAmount); if (changed) { if (loan == null) { loan = new Loan(); } loan.PrimaryBorrower = _primaryborrower; loan.W2 = _w2; MappingUtil.SetValue(loanObject, FieldList.LoanAmount, (val) => loan.LoanAmount = val, loan.LoanAmount); } return(loan); }
private Models.Loan PopulateLoan() { Models.Loan res = new Models.Loan(); res.Student = student; res.Resource = lstResourcesToOrder.Items.Cast <Models.Resource>().ToList <Models.Resource>(); res.CheckOutDate = DateTime.Now; return(res); }
private void Controller_ResourcePassed(object sender, EventArgs e) { LoanBL bl = new LoanBL(); Models.Loan l = bl.RetrieveLoanByResource((Resource)sender); loan = l; BindStudent(loan.Student); BindResources(l.Resource); BindDates(); SetState(2); }
public static void MapTo(this Models.Loan loan, External.LoanObject loanObject) { loanObject.MapValue(3, loan.LoanAmount); loan.PrimaryBorrower?.MapTo(loanObject, FieldList.PrimaryBorrower); loan.W2?.MapTo(loanObject, FieldList.W2); }