Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MarketSegmentModel marketSegmentModel = db.MarketSegmentModels.Find(id);

            db.MarketSegmentModels.Remove(marketSegmentModel);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "MarketSegmentID,Manufacturer")] MarketSegmentModel marketSegmentModel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(marketSegmentModel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(marketSegmentModel));
 }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "MarketSegmentID,Manufacturer")] MarketSegmentModel marketSegmentModel)
        {
            if (ModelState.IsValid)
            {
                db.MarketSegmentModels.Add(marketSegmentModel);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(marketSegmentModel));
        }
Ejemplo n.º 4
0
        // GET: MarketSegment/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MarketSegmentModel marketSegmentModel = db.MarketSegmentModels.Find(id);

            if (marketSegmentModel == null)
            {
                return(HttpNotFound());
            }
            return(View(marketSegmentModel));
        }