private void ProcessUserAmountByAdmin(HttpContext context) { context.Response.ContentType = "application/json"; int userId = Globals.RequestFormNum("userid"); MemberInfo member = MemberHelper.GetMember(userId); string s = "{\"success\":\"false\"}"; decimal num2 = decimal.Parse(context.Request["setAmount"]); string str2 = context.Request["remark"]; MemberAmountDetailedInfo model = new MemberAmountDetailedInfo { UserId = userId, UserName = member.UserName, PayId = Globals.GetGenerateId(), TradeAmount = num2, TradeType = TradeType.ShopAdjustment, TradeTime = DateTime.Now, State = 1, TradeWays = TradeWays.Balance, AvailableAmount = member.AvailableAmount + num2, Remark = str2 }; if (MemberAmountProcessor.SetAmountByShopAdjustment(model)) { s = "{\"success\":\"true\"}"; } context.Response.Write(s); context.Response.End(); }
public string SetUserAmount(int userID, string amount, string remark) { MemberInfo member = MemberHelper.GetMember(userID); MemberAmountDetailedInfo model = new MemberAmountDetailedInfo { UserId = userID, UserName = member.UserName, PayId = Globals.GetGenerateId(), TradeAmount = decimal.Parse(amount), TradeType = TradeType.ShopAdjustment, TradeTime = DateTime.Now, State = 1, TradeWays = TradeWays.Balance, AvailableAmount = member.AvailableAmount + decimal.Parse(amount), Remark = remark }; if (MemberAmountProcessor.SetAmountByShopAdjustment(model)) { return("success"); } return("fail"); }