public ActionResult Create([Bind(Include = "Id, GrantPaymentOrder, SubNumber, Grant, Amount, Notes")] GrantPayment grantPayment) { Db db = new Db(DbServices.ConnectionString); if (ModelState.IsValid) { try { GrantPaymentServices.Insert(CurrentUser.Id, grantPayment, 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.GrantList = new SelectList(GrantServices.List(db), "Product", "Name"); ViewBag.GrantPaymentOrderList = new SelectList(GrantPaymentOrderServices.List(db), "Id", "Notes"); return(View(grantPayment)); }
public ActionResult Create() { Db db = new Db(DbServices.ConnectionString); ViewBag.GrantList = new SelectList(GrantServices.List(db), "Product", "Name"); return(View()); }
public ActionResult Edit([Bind(Include = "Grant, Amount, Description")] GrantDeduction grantDeduction) { Db db = new Db(DbServices.ConnectionString); if (ModelState.IsValid) { try { GrantDeductionServices.Update(CurrentUser.Id, grantDeduction, 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.GrantList = new SelectList(GrantServices.List(db), "Product", "Name", grantDeduction.Grant); return(View(grantDeduction)); }
// GET: Grant/Delete/5 public ActionResult Delete(Nullable <int> id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Db db = new Db(DbServices.ConnectionString); Grant grant = GrantServices.Get(id.Value, db); if (grant == null) { return(HttpNotFound()); } return(View(grant)); }
// GET: GrantDeduction/Edit/5 public ActionResult Edit(Nullable <int> grant) { Db db = new Db(DbServices.ConnectionString); if (grant == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GrantDeduction grantDeduction = GrantDeductionServices.Get(grant.Value, db); if (grantDeduction == null) { return(HttpNotFound()); } ViewBag.GrantList = new SelectList(GrantServices.List(db), "Product", "Name", grantDeduction.Grant); return(View(grantDeduction)); }
// GET: GrantPayment/Edit/5 public ActionResult Edit(Nullable <int> id) { Db db = new Db(DbServices.ConnectionString); if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GrantPayment grantPayment = GrantPaymentServices.Get(id.Value, db); if (grantPayment == null) { return(HttpNotFound()); } ViewBag.GrantList = new SelectList(GrantServices.List(db), "Product", "Name", grantPayment.Grant); ViewBag.GrantPaymentOrderList = new SelectList(GrantPaymentOrderServices.List(db), "Id", "Notes", grantPayment.GrantPaymentOrder); return(View(grantPayment)); }
// GET: Grant/Edit/5 public ActionResult Edit(Nullable <int> product) { Db db = new Db(DbServices.ConnectionString); if (product == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Grant grant = GrantServices.Get(product.Value, db); if (grant == null) { return(HttpNotFound()); } ViewBag.GrantDecisionList = new SelectList(GrantDecisionServices.List(db), "Id", "CersNumber", grant.GrantDecision); ViewBag.ProductList = new SelectList(ProductServices.List(db), "Id", "Notes", grant.Product); return(View(grant)); }
public ActionResult DeleteConfirmed(int product) { try { Db db = new Db(DbServices.ConnectionString); GrantServices.Delete(CurrentUser.Id, product, db); TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "DeleteConfirmed"); // return RedirectToAction("Index"); } catch (CfException cfex) { TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage; } catch (Exception ex) { TempData["Failure"] = ex.Message; } // return View(grant); return(RedirectToAction("Index")); }