public int UpdateLoanApp(LoanApplication LoanApp) { try { var original = (from a in uvDb.LoanApplications where a.LoanRefNumber == LoanApp.LoanRefNumber select a).FirstOrDefault(); if (original != null) { original.LoanComment = LoanApp.LoanComment; original.ApplicationStatus_FK = LoanApp.ApplicationStatus_FK; uvDb.SaveChanges(); } return(original.ID); } catch (Exception ex) { WebLog.Log(ex.Message.ToString()); return(ex.StackTrace.Count()); } }
public LoanApproval UpdateLoanApproval(LoanApproval LoanApp, LoanApplication LoanApplication) { try { var original = (from a in uvDb.LoanApprovals where a.ID == LoanApp.ID select a).FirstOrDefault(); if (original != null) { //original.LoanComment = LoanApp.LoanComment; original.ApplicationStatus_FK = LoanApp.ApplicationStatus_FK; uvDb.SaveChanges(); } return(original); } catch (Exception ex) { WebLog.Log(ex.Message.ToString()); return(null); } }