Ejemplo n.º 1
0
        // 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));
        }
Ejemplo n.º 2
0
        // 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));
        }