//新增信息表 public ActionResult AddBzcmImage(BzcmText_FanChan btfc) { btfc.Addtime = MvcApplication.GetT_time(); btfc.DEL = 0; btfc.AddUser = LoginUser.ID; btfc.IsFristItemsID = Convert.ToInt32(Request["IsFristItemsID"]); string str = "ok"; if (btfc.ID > 0) { BzcmText_FanChanService.EditEntity(btfc); } else { try { BzcmText_FanChanService.AddEntity(btfc); } catch (Exception e) { if (btfc.Str_Image.Length > 0) { NewDeletFile(btfc.Str_Image); } str = e.ToString(); } } return(Json(new { ret = str }, JsonRequestBehavior.AllowGet)); }
//删除信息或撤销 public ActionResult deldata() { long id = Convert.ToInt64(Request["id"]); var fcdata = BzcmText_FanChanService.LoadEntities(x => x.ID == id).FirstOrDefault(); string ret = "ok"; if (fcdata != null) { fcdata.DEL = fcdata.DEL == 0?1:0; if (!BzcmText_FanChanService.EditEntity(fcdata)) { ret = "未修改成功!"; } } else { ret = "未找到要删除的信息!"; } return(Json(new { ret = ret }, JsonRequestBehavior.AllowGet)); }