Пример #1
0
        public ActionResult Create(Tender_GongGao tender_gonggao)
        {
            if (ModelState.IsValid)
            {
                db.Tender_GongGaos.Add(tender_gonggao);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(tender_gonggao);
        }
Пример #2
0
        public ActionResult EditDelete(Tender_GongGao tender_gonggao)
        {
            if (ModelState.IsValid)
            {
                Tender_GongGao tgg = db.Tender_GongGaos.Find(tender_gonggao.TaskID);

                if(tgg!=null)
                {
                    tgg.IsDelete = tender_gonggao.IsDelete;
                    db.Entry(tgg).State = EntityState.Modified;
                    db.SaveChanges();
                    return Content("修改成功!");
                }

                //return RedirectToAction("Index");
            }
            return Content("修改失败!");
            //return View(tender_gonggao);
        }
Пример #3
0
 public ActionResult Edit(Tender_GongGao tender_gonggao)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tender_gonggao).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(tender_gonggao);
 }