Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "id_assetcountry,id_asset,id_country,active,created_at,updated_at")] AssetCountry assetCountry)
 {
     if (ModelState.IsValid)
     {
         db.Entry(assetCountry).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.id_asset   = new SelectList(db.Assets, "id_asset", "name", assetCountry.id_asset);
     ViewBag.id_country = new SelectList(db.Countries, "id_country", "name", assetCountry.id_country);
     return(View(assetCountry));
 }
Ejemplo n.º 2
0
        // GET: AssetCountry/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AssetCountry assetCountry = db.AssetCountries.Find(id);

            if (assetCountry == null)
            {
                return(HttpNotFound());
            }
            return(View(assetCountry));
        }
Ejemplo n.º 3
0
        // GET: AssetCountry/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AssetCountry assetCountry = db.AssetCountries.Find(id);

            if (assetCountry == null)
            {
                return(HttpNotFound());
            }
            ViewBag.id_asset   = new SelectList(db.Assets, "id_asset", "name", assetCountry.id_asset);
            ViewBag.id_country = new SelectList(db.Countries, "id_country", "name", assetCountry.id_country);
            return(View(assetCountry));
        }