Example #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            BacDaoTao bacDaoTao = await db.BacDaoTaos.FindAsync(id);

            db.BacDaoTaos.Remove(bacDaoTao);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Example #2
0
        public async Task <ActionResult> Edit([Bind(Include = "MaBacDT,TenBacDT")] BacDaoTao bacDaoTao)
        {
            if (ModelState.IsValid)
            {
                db.Entry(bacDaoTao).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(bacDaoTao));
        }
Example #3
0
        public async Task <ActionResult> Create([Bind(Include = "MaBacDT,TenBacDT")] BacDaoTao bacDaoTao)
        {
            if (ModelState.IsValid)
            {
                db.BacDaoTaos.Add(bacDaoTao);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(bacDaoTao));
        }
Example #4
0
        // GET: AdminBacDaoTao/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BacDaoTao bacDaoTao = await db.BacDaoTaos.FindAsync(id);

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