public ActionResult createExceptionalAmount(ExceptionalAmount model) { Db db = new Db(DbServices.ConnectionString); if (ModelState.IsValid) { try { ExceptionalAmountServices.Insert(CurrentUser.Id, model, db); TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed"); } catch (CfException cfex) { TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage; } catch (Exception ex) { TempData["Failure"] = ex.Message; } return(RedirectToAction("Details", new { id = model.LoanRequest })); } ViewBag.ExceptionalAmountTypeList = new SelectList(ExceptionalAmountTypeServices.List(db), "Id", "Name"); ViewBag.LoanRequestList = new SelectList(LoanRequestServices.List(db), "Request", "Name"); ViewBag.ModuleName = moduleName; ViewBag.Action = insert; ViewBag.Save = save; ViewBag.Back = back; return(View("Details", new { id = model.LoanRequest })); }
public ActionResult Create([Bind(Include = "Id, LoanRequest, SubNumber, Amount, Notes, ExceptionalAmountType")] ExceptionalAmount exceptionalAmount) { Db db = new Db(DbServices.ConnectionString); if (ModelState.IsValid) { try { ExceptionalAmountServices.Insert(CurrentUser.Id, exceptionalAmount, 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.ExceptionalAmountTypeList = new SelectList(ExceptionalAmountTypeServices.List(db), "Id", "Name"); ViewBag.LoanRequestList = new SelectList(LoanRequestServices.List(db), "Request", "Name"); return(View(exceptionalAmount)); }
public ActionResult Create() { Db db = new Db(DbServices.ConnectionString); ViewBag.ExceptionalAmountTypeList = new SelectList(ExceptionalAmountTypeServices.List(db), "Id", "Name"); ViewBag.LoanRequestList = new SelectList(LoanRequestServices.List(db), "Request", "Name"); return(View()); }
// GET: ExceptionalAmount/Edit/5 public ActionResult Edit(Nullable <int> id) { Db db = new Db(DbServices.ConnectionString); if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ExceptionalAmount exceptionalAmount = ExceptionalAmountServices.Get(id.Value, db); if (exceptionalAmount == null) { return(HttpNotFound()); } ViewBag.ExceptionalAmountTypeList = new SelectList(ExceptionalAmountTypeServices.List(db), "Id", "Name", exceptionalAmount.ExceptionalAmountType); ViewBag.LoanRequestList = new SelectList(LoanRequestServices.List(db), "Request", "Name", exceptionalAmount.LoanRequest); return(View(exceptionalAmount)); }