public LoanApply ApplyForLoan(LoanApply loanApply) { loanApply.ApplicationStatus = "Accepted"; loanApply.FinalizationStatus = "Pending"; loanApplies.Add(loanApply); return(loanApply); }
// GET: LoanApplies/Create public ActionResult Create(LoanApply b1, HttpPostedFileBase image1) { ViewBag.EmployeeId = new SelectList(db.Employees, "Id", "FirstName"); ViewBag.LoanCategory = new SelectList(db.LoanCategories, "Id", "Type"); ViewBag.LoanApplyId = new SelectList(db.LoanDocumentVerifies, "LoanId", "IsDefaulter"); ViewBag.LoanApplyId = new SelectList(db.LoanRequestStatus, "LoanId", "RequestStatus"); return(View()); }
public ActionResult DeleteConfirmed(int id) { LoanApply loanApply = db.LoanApplies.Find(id); db.LoanApplies.Remove(loanApply); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: LoanApplies/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LoanApply loanApply = db.LoanApplies.Find(id); if (loanApply == null) { return(HttpNotFound()); } return(View(loanApply)); }
public ActionResult Edit([Bind(Include = "LoanApplyId,EmployeeId,LoanCategory,LoanMoney,NoOfInstallments,InstallmentStartDate,InstallmentEndDate,RequestDate,LoanAgreement,LoanForProperty,LoanForAutomobile")] LoanApply loanApply) { if (ModelState.IsValid) { db.Entry(loanApply).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmployeeId = new SelectList(db.Employees, "Id", "FirstName", loanApply.EmployeeId); ViewBag.LoanCategory = new SelectList(db.LoanCategories, "Id", "Type", loanApply.LoanCategory); ViewBag.LoanApplyId = new SelectList(db.LoanDocumentVerifies, "LoanId", "IsDefaulter", loanApply.LoanApplyId); ViewBag.LoanApplyId = new SelectList(db.LoanRequestStatus, "LoanId", "RequestStatus", loanApply.LoanApplyId); return(View(loanApply)); }
// GET: LoanApplies/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LoanApply loanApply = db.LoanApplies.Find(id); if (loanApply == null) { return(HttpNotFound()); } ViewBag.EmployeeId = new SelectList(db.Employees, "Id", "FirstName", loanApply.EmployeeId); ViewBag.LoanCategory = new SelectList(db.LoanCategories, "Id", "Type", loanApply.LoanCategory); ViewBag.LoanApplyId = new SelectList(db.LoanDocumentVerifies, "LoanId", "IsDefaulter", loanApply.LoanApplyId); ViewBag.LoanApplyId = new SelectList(db.LoanRequestStatus, "LoanId", "RequestStatus", loanApply.LoanApplyId); return(View(loanApply)); }
public LoanApply FinalizeLoan(LoanApply loanApply) { if (loanApplies.Count == 0) { loanApply.FinalizationStatus = "Rejected"; return(loanApply); } List <LoanApply> loansInRange = loanApplies.Where(l => l.FinalizationDate > loanApply.ApplyDate && l.Number == loanApply.Number && l.FinalizationStatus == "Accepted").ToList(); if (loansInRange.Count == 0) { loanApply.FinalizationStatus = "Accepted"; loanApplies.Add(loanApply); return(loanApply); } loanApply.FinalizationStatus = "Rejected"; return(loanApply); }
// GET: loan/Edit/5 public ActionResult Edit(int?ide) { // int ide = int.Parse(collection["loanid"]); DataTable dt = new DataTable(); if (conn.State == ConnectionState.Closed) { conn.Open(); } string q = "select LoanAgreement from LoanApply where LoanApplyId = '" + ide + "'"; SqlCommand cmd = new SqlCommand(q, conn); SqlDataReader reader = cmd.ExecuteReader(); string value = "0"; while (reader.Read()) { value = ((reader[0].ToString())); } LoanApply la = new LoanApply() { LoanAgreement = value }; ViewBag.message = la; string query = "SELECT LoanCategory,LoanForProperty,LoanForAutomobile,LoanMoney,NoOfInstallments,InstallmentStartDate,InstallmentEndDate,[Installment Money],LoanAgreement From LoanApply JOIN Employee on Employee.Id = LoanApply.EmployeeId where LoanApplyId='" + ide + "' "; //va // string query1 = "SELECT LoanApplyId,LoanMoney,RequestDate,RequestStatus,Reason from LoanApply JOIN LoanCategory on LoanCategory.Id=LoanApply.LoanCategory where LoanCategory='" + cat + "' "; SqlDataAdapter da = new SqlDataAdapter(query, conn); da.Fill(dt); // r data = db.LoanApplies.SqlQuery(query).ToList(); return(View(dt)); // return View(); }
public ActionResult <LoanApply> Post([FromBody] LoanApply loanApply) { loanApply.FinalizationDate = DateTime.Now; return(loanEngine.FinalizeLoan(loanApply)); }
public ActionResult <LoanApply> Post([FromBody] LoanApply loanApply) { loanApply.ApplyDate = DateTime.Now; return(loanEngine.ApplyForLoan(loanApply)); }