Esempio n. 1
0
        public async Task <ActionResult> DeleteConfirmed(string id)
        {
            MyPham myPham = await db.MyPhams.FindAsync(id);

            db.MyPhams.Remove(myPham);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        public async Task <ActionResult> Edit([Bind(Include = "MaMP,TenMP,ThuongHieu,TenCongDung")] MyPham myPham)
        {
            if (ModelState.IsValid)
            {
                db.Entry(myPham).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.TenCongDung = new SelectList(db.ConngDungs, "MaCongDung", "TenCongDung", myPham.TenCongDung);
            return(View(myPham));
        }
Esempio n. 3
0
        // GET: MyPhams/Details/5
        public async Task <ActionResult> Details(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MyPham myPham = await db.MyPhams.FindAsync(id);

            if (myPham == null)
            {
                return(HttpNotFound());
            }
            return(View(myPham));
        }
Esempio n. 4
0
        // GET: MyPhams/Edit/5
        public async Task <ActionResult> Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MyPham myPham = await db.MyPhams.FindAsync(id);

            if (myPham == null)
            {
                return(HttpNotFound());
            }
            ViewBag.TenCongDung = new SelectList(db.ConngDungs, "MaCongDung", "TenCongDung", myPham.TenCongDung);
            return(View(myPham));
        }