/// <summary> /// 观点显示 /// </summary> /// <param name="page"></param> /// <param name="rows"></param> /// <returns></returns> public JsonResult getOptionAdd(int page, int rows, string OptionTitle = "") { var list = new JiaJiBLL.OptionBLL().ShowOptions(); var result = new { total = list.Count, rows = list.Where(e => e.OptionTitle.Contains(OptionTitle)).Skip((page - 1) * rows).Take(rows) }; return(Json(result)); }
/// <summary> /// 删除观点 /// </summary> /// <param name="ids"></param> /// <returns></returns> public int deleteOptionAdd(string ids) { bool isOK = new JiaJiBLL.OptionBLL().DelOptions(ids); if (isOK) { return(0); } else { return(1); } }
public JsonResult addOptionAdd(JiaJiModels.OptionModel model) { try { model.OptionUrl = "/image/" + model.OptionUrl; var i = new JiaJiBLL.OptionBLL().AddOption(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 editOptionAdd(JiaJiModels.OptionModel model) { try { int id = model.OptionID; var i = new JiaJiBLL.OptionBLL().UpdOptions(model); if (i > 0) { return(Json(new { Success = true, Message = "修改成功" })); } else { return(Json(new { Success = false, Message = "修改失败" })); } } catch { return(Json(new { Success = false, Message = "修改失败" })); } }