Example #1
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void AddChargeItem(ChargeItem model)
 {
     using (DBHelper db = DBHelper.Create())
     {
         db.Insert<ChargeItem>(model);
     }
 }
Example #2
0
 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);
 }
Example #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(ChargeItem model)
 {
     using (DBHelper db = DBHelper.Create())
     {
         db.Update<ChargeItem>(model);
         return true;
     }
 }
Example #4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Ajax.Model.ChargeItem model)
 {
     return(dal.Update(model));
 }
Example #5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(Ajax.Model.ChargeItem model)
 {
     dal.AddChargeItem(model);
 }
Example #6
0
 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);
 }