예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            OurModel ourModel = db.OurModels.Find(id);

            db.OurModels.Remove(ourModel);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Id,Title,Details,Profession,Photo,HoverPhoto,Facebook,Twitter,Instagram,Youtube,TopModel,ModelCategoryId")] OurModel ourModel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ourModel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ModelCategoryId = new SelectList(db.ModelCategories, "Id", "Name", ourModel.ModelCategoryId);
     return(View(ourModel));
 }
예제 #3
0
        // GET: Admin/OurModel/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            OurModel ourModel = db.OurModels.Find(id);

            if (ourModel == null)
            {
                return(HttpNotFound());
            }
            return(View(ourModel));
        }
예제 #4
0
        // GET: Admin/OurModel/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            OurModel ourModel = db.OurModels.Find(id);

            if (ourModel == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ModelCategoryId = new SelectList(db.ModelCategories, "Id", "Name", ourModel.ModelCategoryId);
            return(View(ourModel));
        }