// GET: Guarantor/Delete/5 public ActionResult DeleteExceptionalAmount(Nullable <int> id, int ProductId) { ViewBag.ModuleName = moduleName; ViewBag.Title = delete; ViewBag.Delete = delete; ViewBag.Yes = yes; ViewBag.No = no; ViewBag.ConfirmDelete = confirmDelete; ViewBag.Action = delete; if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Db db = new Db(DbServices.ConnectionString); ExceptionalAmount expAmount = ExceptionalAmountServices.Get(id.Value, db); if (expAmount == null) { return(HttpNotFound()); } ViewBag.ProductId = ProductId; return(PartialView(expAmount)); }
public ActionResult editExceptionalAmount(ExceptionalAmount model) { Db db = new Db(DbServices.ConnectionString); if (ModelState.IsValid) { try { ExceptionalAmountServices.Update(CurrentUser.Id, model, db); TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "UpdateConfirmed"); return(RedirectToAction("Details", new { id = model.LoanRequest })); } 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", model.ExceptionalAmountType); ViewBag.ModuleName = moduleName; ViewBag.Action = update; ViewBag.Update = update; 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)); }
// GET: ExceptionalAmount/Delete/5 public ActionResult Delete(Nullable <int> id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Db db = new Db(DbServices.ConnectionString); ExceptionalAmount exceptionalAmount = ExceptionalAmountServices.Get(id.Value, db); if (exceptionalAmount == null) { return(HttpNotFound()); } return(View(exceptionalAmount)); }
// 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)); }
public ActionResult editExceptionalAmount(int?id) { ViewBag.ModuleName = moduleName; ViewBag.Action = update; ViewBag.Update = update; ViewBag.Save = save; ViewBag.Back = back; 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); return(PartialView(exceptionalAmount)); }