public ActionResult IssueLoan(tblLoan tblloan) { if (ModelState.IsValid) { objBs.LoanBs.Insert(tblloan); TempData["LoantypeInsertMsg"] = "Loan Issued Successfully"; return(RedirectToAction("IssueLoan")); } return(View(tblloan)); }
public void EditPayOff() { var tblLoan = new tblLoan { Id = DId, LoanPayOff = DPayOff }; using (var dbLoanEntities = new dbLoanEntities()) { dbLoanEntities.tblLoan.Attach(tblLoan); dbLoanEntities.Entry(tblLoan).Property(x => x.LoanPayOff).IsModified = true; dbLoanEntities.SaveChanges(); } }
public Task <int> Add() { var tblLoan = new tblLoan { Loan_Personnel_Id = DPersonnelId, Loan_LoanType_Id = DLoanTypeId, Loan_Account_Id = DAccountId, LoanAmount = DAmount, LoanDate = DDate, LoanInstallmentNum = DInstallmentNum, LoanInstallmentFirstPayDate = DInstallmentFirstPayDate, LoanInstallmentInterspace = DInstallmentInterspace, LoanPayOff = DPayOff, LoanDescription = DDescription }; _dbLoanEntities.tblLoan.Add(tblLoan); _dbLoanEntities.SaveChanges(); return(Task.Run(() => tblLoan.Id)); }
public LoanDetails GetLoanDetails(long loanId) { using (SandeepDBEntities db = new SandeepDBEntities()) { User user = new User(); LoanDetails details = new LoanDetails(); List <User> list = new List <User>(); tblLoan loan = db.tblLoan.First(x => x.tblLoanID == loanId); long primaryId = loan.PrimaryBorrowerID; int statusId = loan.tblLoanStatusID; tblLoanStatus status = db.tblLoanStatus.First(x => x.tblLoanStatusID == statusId); details.LoanStatusLabel = status.Label; details.LoanStatusDesc = status.Description; details.primaryBorrower = db.tblUser.First(x => x.tblUserID == primaryId).Name; foreach (var v in db.tblUserLoan) { if (loanId == v.tblLoanID) { tblUser userAccount = db.tblUser.First(x => x.tblUserID == v.tblUserID); if ("Agent" == db.tblRole.First(x => x.tblRoleID == v.tblRoleID).Name) { details.Agent = userAccount; } else { user.Email = userAccount.Email; user.Name = userAccount.Name; user.Phone = userAccount.Mobile; list.Add(user); } } } details.borrowers = list; return(details); } }
public void Update(tblLoan users) { objDb.Update(users); }
public void Insert(tblLoan users) { objDb.Insert(users); }