public ActionResult SearchChargeItemCategory(EasyUIGridParamModel param, ChargeItemCategory chargeItemType) { int itemCount = 0; List <dynamic> CategoryList = new ChargeItemCategoryRule().SearchChargeItemCategory(param, chargeItemType, out itemCount); var ShowList = from category in CategoryList select new { ID = category.ID, NAME = category.NAME }; return(Json(new { total = itemCount, rows = ShowList }, JsonRequestBehavior.AllowGet)); }
public ActionResult ModifyChargeItemCategory(ChargeItemCategory cType) { AjaxResult result = new AjaxResult(); try { new Ajax.BLL.ChargeItemCategoryRule().Update(cType); result.Success = true; result.Message = "收费项分类修改成功。"; } catch { result.Success = false; result.Message = "收费项分类修改失败。"; } return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult ChargeItemCategoryAdd(ChargeItemCategory cType) { AjaxResult result = new AjaxResult(); try { cType.ID = Guid.NewGuid().ToString("N"); new Ajax.BLL.ChargeItemCategoryRule().Add(cType); result.Success = true; result.Message = "收费项分类添加成功。"; } catch { result.Success = false; result.Message = "收费项分类添加失败。"; } return(Json(result, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 获取缴费项分类json /// </summary> /// <param name="param"></param> /// <param name="chargeItemType"></param> /// <param name="itemCount"></param> /// <returns></returns> public List <dynamic> SearchChargeItemCategory(EasyUIGridParamModel param, ChargeItemCategory chargeItemType, out int itemCount) { Dictionary <string, object> paramList = new Dictionary <string, object>(); StringBuilder strSql = new StringBuilder(); strSql.Append("select ID,Name from T_ChargeItemCategory where 1=1 "); if (!string.IsNullOrEmpty(chargeItemType.Name)) { strSql.Append("and Name like @Name"); paramList.Add("Name", string.Format("%{0}%", chargeItemType.Name)); } int pageIndex = Convert.ToInt32(param.page) - 1; int pageSize = Convert.ToInt32(param.rows); using (DBHelper db = DBHelper.Create()) { itemCount = db.GetCount(strSql.ToString(), paramList); return(db.GetDynaminObjectList(strSql.ToString(), paramList)); } }
/// <summary> /// 获取缴费项分类json /// </summary> /// <param name="param"></param> /// <param name="chargeItemType"></param> /// <param name="itemCount"></param> /// <returns></returns> public List <dynamic> SearchChargeItemCategory(EasyUIGridParamModel param, ChargeItemCategory chargeItemType, out int itemCount) { return(dal.SearchChargeItemCategory(param, chargeItemType, out itemCount)); }