/// <summary> /// 增加一条数据 /// </summary> public void AddChargeItem(ChargeItem model) { using (DBHelper db = DBHelper.Create()) { db.Insert<ChargeItem>(model); } }
public ActionResult AddChargeItem(ChargeItem item) { AjaxResult result = new AjaxResult(); item.ID = Guid.NewGuid().ToString("N").ToUpper(); item.PY = Pinyin.GetPinyin(item.Name); ChargeItemRule rule = new ChargeItemRule(); item.Code = rule.GetNewCode(); try { rule.Add(item); result.Success = true; result.Message = "缴费项目添加成功。"; } catch (Exception ex) { result.Success = false; result.Message = ex.Message; } return Json(result, JsonRequestBehavior.AllowGet); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(ChargeItem model) { using (DBHelper db = DBHelper.Create()) { db.Update<ChargeItem>(model); return true; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Ajax.Model.ChargeItem model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(Ajax.Model.ChargeItem model) { dal.AddChargeItem(model); }
public ActionResult ModifyChargeItem(ChargeItem item) { AjaxResult result = new AjaxResult(); try { item.PY = Pinyin.GetPinyin(item.Name); bool flag = new ChargeItemRule().Update(item); if (flag) { result.Success = true; result.Message = "收费项修改成功"; } else { result.Success = false; result.Message = "收费项修改失败"; } } catch (Exception ex) { result.Success = false; result.Message = ex.Message; return Json(result, JsonRequestBehavior.AllowGet); } return Json(result, JsonRequestBehavior.AllowGet); }