Пример #1
0
 public ActionResult Edit([Bind(Include = "Id,BigSlogan,SmallSlogan,LanguageId")] Slogans slogans)
 {
     if (ModelState.IsValid)
     {
         db.Entry(slogans).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.LanguageId = new SelectList(db.Language, "Id", "Name", slogans.LanguageId);
     return(View(slogans));
 }
Пример #2
0
        // GET: Control/Slogans/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Slogans slogans = db.Slogans.Find(id);

            if (slogans == null)
            {
                return(HttpNotFound());
            }
            ViewBag.LanguageId = new SelectList(db.Language, "Id", "Name", slogans.LanguageId);
            return(View(slogans));
        }