public ActionResult Edit(long id = 0) { if (id == 0) { return(View(new RechargeScheme())); } var info = RechargeSchemeBll.GetById(id); return(View(info)); }
public ActionResult Delete(long id) { var apiResult = new APIResult(); try { RechargeSchemeBll.DeleteById(id); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; if (!(ex is OperationExceptionFacade)) { LogFactory.GetLogger().Log(LogLevel.Error, ex); } } return(Json(apiResult)); }
public JsonResult Edit(RechargeScheme model) { var apiResult = new APIResult(); try { RechargeSchemeBll.AddOrUpdate(model, UserContext.CurrentUser.HotelId); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; if (!(ex is OperationExceptionFacade)) { LogFactory.GetLogger().Log(LogLevel.Error, ex); } } return(Json(apiResult)); }
public JsonResult GetRechargeScheme(int money) { int zsMoney = 0; int zsExp = 0; //根据充值金额获取赠送积分和赠送金额 var rechargeSchemeList = RechargeSchemeBll.GetList(UserContext.CurrentUser.HotelId).OrderByDescending(m => m.Money).ToList(); if (rechargeSchemeList != null || rechargeSchemeList.Count != 0) { foreach (var item in rechargeSchemeList) { if (money >= item.Money) { zsMoney = item.ZSMoney; zsExp = item.ZSExp; break; } } } return(Json(new { zsMoney = zsMoney, zsExp = zsExp }, JsonRequestBehavior.AllowGet)); }
public string GetList() { var models = RechargeSchemeBll.GetList(UserContext.CurrentUser.HotelId); return(JsonConvert.SerializeObject(models)); }