コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Chamcong chamcong = db.Chamcongs.Find(id);

            db.Chamcongs.Remove(chamcong);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "MaNV,Ngay,Doanhso,Nghi")] Chamcong chamcong)
 {
     if (ModelState.IsValid)
     {
         db.Entry(chamcong).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(chamcong));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "MaNV,Ngay,Doanhso,Nghi")] Chamcong chamcong)
        {
            if (ModelState.IsValid)
            {
                db.Chamcongs.Add(chamcong);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(chamcong));
        }
コード例 #4
0
        // GET: Chamcongs/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Chamcong chamcong = db.Chamcongs.Find(id);

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