public ActionResult Create([Bind(Include = "Id, LoanType, ClosingLoanType")] LoanTypeClosure loanTypeClosure) { Db db = new Db(DbServices.ConnectionString); if (ModelState.IsValid) { try { LoanTypeClosureServices.Insert(CurrentUser.Id, loanTypeClosure, db); TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed"); return(RedirectToAction("Index")); } catch (CfException cfex) { TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage; } catch (Exception ex) { TempData["Failure"] = ex.Message; } } ViewBag.ClosingLoanTypeList = new SelectList(LoanTypeServices.List(db), "ProductType", "Name"); ViewBag.LoanTypeList = new SelectList(LoanTypeServices.List(db), "ProductType", "Name"); return(View(loanTypeClosure)); }
public ActionResult Create([Bind(Include = "Id, Employee, Date, LoanType, Amount, Notes")] SpecialCaseLoan specialCaseLoan) { Db db = new Db(DbServices.ConnectionString); if (ModelState.IsValid) { try { SpecialCaseLoanServices.Insert(CurrentUser.Id, specialCaseLoan, db); TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed"); return(RedirectToAction("Index")); } catch (CfException cfex) { TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage; } catch (Exception ex) { TempData["Failure"] = ex.Message; } } ViewBag.EmployeeList = new SelectList(EmployeeServices.List(db), "Id", "FirstName"); ViewBag.LoanTypeList = new SelectList(LoanTypeServices.List(db), "ProductType", "Name"); return(View(specialCaseLoan)); }
public ActionResult Edit([Bind(Include = "Product, LoanDecision, LoanType, LoanGenerationStatus, LoanStatus")] Loan loan) { Db db = new Db(DbServices.ConnectionString); if (ModelState.IsValid) { try { LoanServices.Update(CurrentUser.Id, loan, db); TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "UpdateConfirmed"); return(RedirectToAction("Index")); } catch (CfException cfex) { TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage; } catch (Exception ex) { TempData["Failure"] = ex.Message; } } ViewBag.LoanDecisionList = new SelectList(LoanDecisionServices.List(db), "Id", "CersNumber", loan.LoanDecision); ViewBag.LoanGenerationStatusList = new SelectList(LoanGenerationStatusServices.List(db), "Id", "Name", loan.LoanGenerationStatus); ViewBag.LoanStatusList = new SelectList(LoanStatusServices.List(db), "Id", "Name", loan.LoanStatus); ViewBag.LoanTypeList = new SelectList(LoanTypeServices.List(db), "ProductType", "Name", loan.LoanType); ViewBag.ProductList = new SelectList(ProductServices.List(db), "Id", "Notes", loan.Product); return(View(loan)); }
public ActionResult Create() { Db db = new Db(DbServices.ConnectionString); ViewBag.ClosingLoanTypeList = new SelectList(LoanTypeServices.List(db), "ProductType", "Name"); ViewBag.LoanTypeList = new SelectList(LoanTypeServices.List(db), "ProductType", "Name"); return(View()); }
public ActionResult Create() { Db db = new Db(DbServices.ConnectionString); ViewBag.LoanDecisionList = new SelectList(LoanDecisionServices.List(db), "Id", "CersNumber"); ViewBag.LoanGenerationStatusList = new SelectList(LoanGenerationStatusServices.List(db), "Id", "Name"); ViewBag.LoanStatusList = new SelectList(LoanStatusServices.List(db), "Id", "Name"); ViewBag.LoanTypeList = new SelectList(LoanTypeServices.List(db), "ProductType", "Name"); ViewBag.ProductList = new SelectList(ProductServices.List(db), "Id", "Notes"); return(View()); }
public ActionResult EmployeeCalculator() { Db db = new Db(DbServices.ConnectionString); // For Product ViewBag.EmployeeList = new SelectList(EmployeeServices.List(db), "Id", "Id_Name"); //ToDo: Just Show Loan Type List <LoanType> l = LoanTypeServices.List(db); List <ProductType> f = ProductTypeServices.List(db); ViewBag.ProductTypeList = new SelectList(ProductTypeServices.List(db), "Id", "Name"); return(View()); }
// GET: LoanTypeClosure/Edit/5 public ActionResult Edit(Nullable <int> id) { Db db = new Db(DbServices.ConnectionString); if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LoanTypeClosure loanTypeClosure = LoanTypeClosureServices.Get(id.Value, db); if (loanTypeClosure == null) { return(HttpNotFound()); } ViewBag.ClosingLoanTypeList = new SelectList(LoanTypeServices.List(db), "ProductType", "Name", loanTypeClosure.ClosingLoanType); ViewBag.LoanTypeList = new SelectList(LoanTypeServices.List(db), "ProductType", "Name", loanTypeClosure.LoanType); return(View(loanTypeClosure)); }
// GET: SpecialCaseLoan/Edit/5 public ActionResult Edit(Nullable <int> id) { Db db = new Db(DbServices.ConnectionString); if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SpecialCaseLoan specialCaseLoan = SpecialCaseLoanServices.Get(id.Value, db); if (specialCaseLoan == null) { return(HttpNotFound()); } ViewBag.EmployeeList = new SelectList(EmployeeServices.List(db), "Id", "FirstName", specialCaseLoan.Employee); ViewBag.LoanTypeList = new SelectList(LoanTypeServices.List(db), "ProductType", "Name", specialCaseLoan.LoanType); return(View(specialCaseLoan)); }
// GET: Loan/Edit/5 public ActionResult Edit(Nullable <int> product) { Db db = new Db(DbServices.ConnectionString); if (product == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Loan loan = LoanServices.Get(product.Value, db); if (loan == null) { return(HttpNotFound()); } ViewBag.LoanDecisionList = new SelectList(LoanDecisionServices.List(db), "Id", "CersNumber", loan.LoanDecision); ViewBag.LoanGenerationStatusList = new SelectList(LoanGenerationStatusServices.List(db), "Id", "Name", loan.LoanGenerationStatus); ViewBag.LoanStatusList = new SelectList(LoanStatusServices.List(db), "Id", "Name", loan.LoanStatus); ViewBag.LoanTypeList = new SelectList(LoanTypeServices.List(db), "ProductType", "Name", loan.LoanType); ViewBag.ProductList = new SelectList(ProductServices.List(db), "Id", "Notes", loan.Product); return(View(loan)); }