Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(short id)
        {
            TRANGTHAIBH tRANGTHAIBH = db.TRANGTHAIBHs.Find(id);

            db.TRANGTHAIBHs.Remove(tRANGTHAIBH);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "TTBH_ID,TTBH_TEN,TTBH_MOTA")] TRANGTHAIBH tRANGTHAIBH)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tRANGTHAIBH).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tRANGTHAIBH));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "TTBH_ID,TTBH_TEN,TTBH_MOTA")] TRANGTHAIBH tRANGTHAIBH)
        {
            if (ModelState.IsValid)
            {
                tRANGTHAIBH.TTBH_ID = Convert.ToInt16(db.autottang("TRANGTHAIBH", "TTBH_ID", db.TRANGTHAIBHs.Count()));
                db.TRANGTHAIBHs.Add(tRANGTHAIBH);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tRANGTHAIBH));
        }
Exemplo n.º 4
0
        // GET: TRANGTHAIBHs/Delete/5
        public ActionResult Delete(short?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TRANGTHAIBH tRANGTHAIBH = db.TRANGTHAIBHs.Find(id);

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