本文整理汇总了C#中Bussiness.PlayerBussiness.AddChargeMoney方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerBussiness.AddChargeMoney方法的具体用法?C# PlayerBussiness.AddChargeMoney怎么用?C# PlayerBussiness.AddChargeMoney使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bussiness.PlayerBussiness
的用法示例。
在下文中一共展示了PlayerBussiness.AddChargeMoney方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
int result = 1;
try
{
string IP = Context.Request.UserHostAddress;
if (ValidLoginIP(IP))
{
string content = HttpUtility.UrlDecode(Request["content"]);
string site = Request["site"] == null ? "" : HttpUtility.UrlDecode(Request["site"]).ToLower();
string nickname = Request["nickname"] == null ? "" : HttpUtility.UrlDecode(Request["nickname"]);
BaseInterface inter = BaseInterface.CreateInterface();
string[] str = inter.UnEncryptCharge(content, ref result, site);
if (str.Length > 5)
{
string chargeID = str[0];
string userName = str[1].Trim();
int money = int.Parse(str[2]);
string payWay = str[3];
decimal needMoney = decimal.Parse(str[4]);
if (!string.IsNullOrEmpty(userName))
{
userName= BaseInterface.GetNameBySite(userName, site);
if (money > 0)
{
using (PlayerBussiness db = new PlayerBussiness())
{
int userID;
DateTime date = DateTime.Now;
if (db.AddChargeMoney(chargeID, userName, money, payWay, needMoney, out userID, ref result, date, IP, nickname))
{
result = 0;
using (CenterServiceClient temp = new CenterServiceClient())
{
temp.ChargeMoney(userID, chargeID);
using (PlayerBussiness pb = new PlayerBussiness())
{
PlayerInfo player = pb.GetUserSingleByUserID(userID);
if (player != null)
StaticsMgr.Log(date, userName, player.Sex, money, payWay,needMoney);
else
{
StaticsMgr.Log(date, userName, true, money, payWay, needMoney);
log.Error("ChargeMoney_StaticsMgr:Player is null!");
}
}
}
}
}
}
else
{
result = 3;
}
}
else
{
result = 2;
}
}
}
else
{
result = 5;
}
}
catch (Exception ex)
{
log.Error("ChargeMoney:", ex);
}
Response.Write(result);
}