/// <summary> /// 删除优势 /// </summary> /// <param name="ids"></param> /// <returns></returns> public int deleteDominant(string ids) { bool isOK = new JiaJiBLL.DoBLL().DelDominant(ids); if (isOK) { return(0); } else { return(1); } }
public JsonResult addDominant(JiaJiModels.DominantModel infor) { try { var i = new JiaJiBLL.DoBLL().addDominant(infor); 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 getDominant(int page, int rows, int?CountryID = null) { var list = new JiaJiBLL.DoBLL().ShowDominant(); var result = new { total = list. Where(e => (CountryID == null ? true : e.CountryID == CountryID) ).Count(), rows = list. Where(e => (CountryID == null ? true : e.CountryID == CountryID) ).Skip((page - 1) * rows).Take(rows) }; return(Json(result)); }
public JsonResult editDominant(JiaJiModels.DominantModel model) { try { int id = model.CountryDominantID; var i = new JiaJiBLL.DoBLL().UpdateDominant(model); if (i > 0) { return(Json(new { Success = true, Message = "修改成功" })); } else { return(Json(new { Success = false, Message = "修改失败" })); } } catch { return(Json(new { Success = false, Message = "修改失败" })); } }