// GET: IncomingLoan/Delete/5 public ActionResult Delete(Nullable <int> id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Db db = new Db(DbServices.ConnectionString); IncomingLoan incomingLoan = IncomingLoanServices.Get(id.Value, db); if (incomingLoan == null) { return(HttpNotFound()); } return(View(incomingLoan)); }
// GET: IncomingLoan/Edit/5 public ActionResult Edit(Nullable <int> loan) { Db db = new Db(DbServices.ConnectionString); if (loan == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } IncomingLoan incomingLoan = IncomingLoanServices.Get(loan.Value, db); if (incomingLoan == null) { return(HttpNotFound()); } ViewBag.LoanList = new SelectList(LoanServices.List(db), "Product", "Name", incomingLoan.Loan); ViewBag.MainWorkPlaceList = new SelectList(MainWorkPlaceServices.List(db), "Id", "Name", incomingLoan.MainWorkPlace); return(View(incomingLoan)); }