public ActionResult Dele(GonhuoShang d, int id) { d.Gid = id; var a = new GonhuoService(); var s = a.Dele(d); return(RedirectToAction("Query")); }
public ActionResult Add(GonhuoShang d) { d.TTime = DateTime.Now; d.XTime = DateTime.Now; d.ZhuangTai = 1; var a = new GonhuoService(); var s = a.Add(d); return(RedirectToAction("Query")); }
public ActionResult DeleAjax(GonhuoShang d) { var a = new GonhuoService(); var s = a.Dele(d); var result = new { ActionResult = s, Msg = s ? "删除成功" : "删除失败" }; return(Json(result, JsonRequestBehavior.AllowGet)); }
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 AddAjax(GonhuoShang d) { d.TTime = DateTime.Now; d.XTime = DateTime.Now; d.ZhuangTai = 1; var a = new GonhuoService(); var s = a.Add(d); var result = new { ActionResult = s, Msg = s ? "添加成功" : "添加失败" }; return(Json(result, JsonRequestBehavior.AllowGet)); }
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)); }