public ActionResult UpdateResult(int id) { var a = new GonhuoService(); var s = a.GetByWhere(i => i.Gid == id).SingleOrDefault(); var aniType = new TypeService(); var type = aniType.GetAll(); ViewBag.GType = new SelectList(type, "Tid", "TName", s.GType); return(View(s)); }
public ActionResult Updt(GonhuoShang d, int id) { var a = new GonhuoService(); var s = a.GetByWhere(i => i.Gid == id).SingleOrDefault(); d.TTime = s.TTime; d.XTime = DateTime.Now; d.Gid = id; d.ZhuangTai = s.ZhuangTai; var aa = new GonhuoService(); var ss = aa.Updt(d); return(RedirectToAction("Query")); }
public ActionResult UpdateAjax(GonhuoShang d) { var a = new GonhuoService(); var s = a.GetByWhere(i => i.Gid == d.Gid).SingleOrDefault(); d.TTime = s.TTime; d.XTime = DateTime.Now; d.ZhuangTai = s.ZhuangTai; var aa = new GonhuoService(); var ss = aa.Updt(d); var result = new { ActionResult = ss, Msg = ss ? "修改成功" : "修改失败" }; return(Json(result, JsonRequestBehavior.AllowGet)); }