public ActionResult Create([Bind(Include = "Loan, MainWorkPlace")] IncomingLoan incomingLoan) { Db db = new Db(DbServices.ConnectionString); if (ModelState.IsValid) { try { IncomingLoanServices.Insert(CurrentUser.Id, incomingLoan, 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.LoanList = new SelectList(LoanServices.List(db), "Product", "Name"); ViewBag.MainWorkPlaceList = new SelectList(MainWorkPlaceServices.List(db), "Id", "Name"); return(View(incomingLoan)); }
public ActionResult Edit([Bind(Include = "Loan, FromLoan")] LoanChange loanChange) { Db db = new Db(DbServices.ConnectionString); if (ModelState.IsValid) { try { LoanChangeServices.Update(CurrentUser.Id, loanChange, 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.LoanList = new SelectList(LoanServices.List(db), "Product", "Name", loanChange.Loan); ViewBag.FromLoanList = new SelectList(LoanServices.List(db), "Product", "Name", loanChange.FromLoan); return(View(loanChange)); }
public ActionResult Edit([Bind(Include = "Loan, LoanDecision, MainWorkPlace, ApprovedAmount, NetAmount, ProfitAmount")] OutgoingLoan outgoingLoan) { Db db = new Db(DbServices.ConnectionString); if (ModelState.IsValid) { try { OutgoingLoanServices.Update(CurrentUser.Id, outgoingLoan, 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.LoanList = new SelectList(LoanServices.List(db), "Product", "Name", outgoingLoan.Loan); ViewBag.LoanDecisionList = new SelectList(LoanDecisionServices.List(db), "Id", "CersNumber", outgoingLoan.LoanDecision); ViewBag.MainWorkPlaceList = new SelectList(MainWorkPlaceServices.List(db), "Id", "Name", outgoingLoan.MainWorkPlace); return(View(outgoingLoan)); }
public ActionResult Create() { Db db = new Db(DbServices.ConnectionString); ViewBag.LoanList = new SelectList(LoanServices.List(db), "Product", "Name"); ViewBag.MainWorkPlaceList = new SelectList(MainWorkPlaceServices.List(db), "Id", "Name"); return(View()); }
// 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)); }
// GET: LoanChange/Edit/5 public ActionResult Edit(Nullable <int> loan) { Db db = new Db(DbServices.ConnectionString); if (loan == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LoanChange loanChange = LoanChangeServices.Get(loan.Value, db); if (loanChange == null) { return(HttpNotFound()); } ViewBag.LoanList = new SelectList(LoanServices.List(db), "Product", "Name", loanChange.Loan); ViewBag.FromLoanList = new SelectList(LoanServices.List(db), "Product", "Name", loanChange.FromLoan); return(View(loanChange)); }