/// <summary> /// 删除攻略 /// </summary> /// <param name="ids"></param> /// <returns></returns> public int deletestrategy(string ids) { bool isOK = new JiaJiBLL.statrgybll().DelStrategy(ids); if (isOK) { return(0); } return(1); }
public JsonResult getstrategy(int page, int rows, string StrategyTitle = "", int?CountryID = null) { var list = new JiaJiBLL.statrgybll().ShowStrategy(); var result = new { total = list. Where(e => e.StrategyTitle.Contains(StrategyTitle) && (CountryID == null ? true : e.CountryID == CountryID) ).Count(), rows = list. Where(e => e.StrategyTitle.Contains(StrategyTitle) && (CountryID == null ? true : e.CountryID == CountryID) ).Skip((page - 1) * rows).Take(rows) }; return(Json(result)); }
public JsonResult editstrategy(JiaJiModels.strategy model) { try { int id = model.StrategyID; var i = new JiaJiBLL.statrgybll().Updatestrategy(model); if (i > 0) { return(Json(new { Success = true, Message = "修改成功" })); } else { return(Json(new { Success = false, Message = "修改失败" })); } } catch { return(Json(new { Success = false, Message = "修改失败" })); } }
public JsonResult addstrategy(JiaJiModels.strategy model) { try { model.Img = "/image/" + model.Img; var i = new JiaJiBLL.statrgybll().addstat(model); if (i > 0) { return(Json(new { Success = true, Message = "添加成功" })); } else { return(Json(new { Success = false, Message = "添加失败" })); } } catch { return(Json(new { Success = false, Message = "添加失败" })); } }