Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ProductsTbl productsTbl = db.ProductsTbls.Find(id);

            db.ProductsTbls.Remove(productsTbl);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "Id,Prod_Name,Prod_Rate,Model_Id")] ProductsTbl productsTbl)
 {
     if (ModelState.IsValid)
     {
         db.Entry(productsTbl).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Model_Id = new SelectList(db.DetailsTbls, "Model_Id", "Model_Name", productsTbl.Model_Id);
     return(View(productsTbl));
 }
Exemple #3
0
        // GET: ProductsTbls/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ProductsTbl productsTbl = db.ProductsTbls.Find(id);

            if (productsTbl == null)
            {
                return(HttpNotFound());
            }
            return(View(productsTbl));
        }
Exemple #4
0
        // GET: ProductsTbls/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ProductsTbl productsTbl = db.ProductsTbls.Find(id);

            if (productsTbl == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Model_Id = new SelectList(db.DetailsTbls, "Model_Id", "Model_Name", productsTbl.Model_Id);
            return(View(productsTbl));
        }