Пример #1
0
        // GET: XAPHUONGs/Create
        public ActionResult Create()
        {
            XAPHUONG obj = new XAPHUONG();

            obj.XP_MA = CreateID.CreateID_ByteText();
            return(View(obj));
        }
Пример #2
0
        public ActionResult DeleteConfirmed(string id)
        {
            XAPHUONG xAPHUONG = db.XAPHUONGs.Find(id);

            db.XAPHUONGs.Remove(xAPHUONG);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #3
0
 public ActionResult Edit([Bind(Include = "XP_MA,XP_TEN")] XAPHUONG xAPHUONG)
 {
     if (ModelState.IsValid)
     {
         db.Entry(xAPHUONG).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(xAPHUONG));
 }
Пример #4
0
        public ActionResult Create([Bind(Include = "XP_MA,XP_TEN")] XAPHUONG xAPHUONG)
        {
            if (ModelState.IsValid)
            {
                db.XAPHUONGs.Add(xAPHUONG);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(xAPHUONG));
        }
Пример #5
0
        // GET: XAPHUONGs/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            XAPHUONG xAPHUONG = db.XAPHUONGs.Find(id);

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