public ActionResult Create([Bind(Include = "Id, Number, Year, GrantTypeGroup, Date, CersNumber, CersDate, PaymentNumber, PaymentDate, Notes, TableNumber, TableDate, BaseNumber, BaseDate, AdditionalClause, AdditionalIntroduction")] GrantDecision grantDecision) { Db db = new Db(DbServices.ConnectionString); if (ModelState.IsValid) { try { GrantDecisionServices.Insert(CurrentUser.Id, grantDecision, 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.GrantTypeGroupList = new SelectList(GrantTypeGroupServices.List(db), "Id", "Name"); return(View(grantDecision)); }
// GET: GrantDecision/Delete/5 public ActionResult Delete(Nullable <int> id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Db db = new Db(DbServices.ConnectionString); GrantDecision grantDecision = GrantDecisionServices.Get(id.Value, db); if (grantDecision == null) { return(HttpNotFound()); } return(View(grantDecision)); }
// GET: GrantDecision/Edit/5 public ActionResult Edit(Nullable <int> id) { Db db = new Db(DbServices.ConnectionString); if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GrantDecision grantDecision = GrantDecisionServices.Get(id.Value, db); if (grantDecision == null) { return(HttpNotFound()); } ViewBag.GrantTypeGroupList = new SelectList(GrantTypeGroupServices.List(db), "Id", "Name", grantDecision.GrantTypeGroup); return(View(grantDecision)); }