protected void button5_ServerClick(object sender, EventArgs e) { //1.此奖品已兑换完毕 if (AwardCount <= 0) { /*lblMsg.Text = "抱歉,此奖品已兑换完毕!"; */ CommonManager.Web.RegJs(this, "alert('抱歉,此奖品已兑换完毕!');location.href=location.href;", true); return; } //2.您有效的总游戏时间不够兑换此奖品! //int playTimeSum = Convert.ToInt32(member.GetPlayTimeSum(UserLoginInfo.UserID)); //秒 int playTimeSum = Convert.ToInt32(member.GetAllPlayTimeByUserID(UserLoginInfo.UserID)); //秒 int usedPlayTime = member.GetUsedPlayTimeOfJP(UserLoginInfo.UserID) * 60 * 60; int awardTimes = AwardTime * 60 * 60; if ((playTimeSum - usedPlayTime) < awardTimes) { /*lblMsg.Text = "抱歉,您有效的总游戏时间不够兑换此奖品!"; */ CommonManager.Web.RegJs(this, "alert('抱歉,您有效的总游戏时间不够兑换此奖品!');location.href=location.href;", true); return; } //3.您银行的金币不够兑换此奖品! //Int64 userBankMoney = member.GetBankMoney( UserLoginInfo.UserID ); //if( userBankMoney < AwardMoney ) //{ // /*lblMsg.Text = "抱歉,您银行的金币不够兑换此奖品!"; // */ // CommonManager.Web.RegJs( this, "alert('抱歉,您的"+ UiCommon.StringConfig.GoldName +"数不够兑换此奖品!');location.href=location.href;", true ); // return; //} //4.兑换 string trueName = Common.FilterString(txtTrueName.Text); string phone = Common.FilterString(txtPhone.Text); string address = Common.FilterString(txtAddress.Text); string remark = Common.FilterString(txtUserRemark.Text); //long summMoney = member.GetAllMoney( UserLoginInfo.UserID ); //int iRows = member.DuiJiang( AwardID, UserLoginInfo.UserID, AwardMoney, AwardTime, trueName, phone, address, remark); //if( iRows > 0 ) //{ // BLL.Member.WriteMoneyExChangeLog( UserLoginInfo.UserID, summMoney, -AwardMoney, (int)Library.MoneyChangeType.兑换奖品, "" ); // CommonManager.Web.RegJs( this, "alert('" + ConfigurationManager.AppSettings["DuiJingMgs"] + "');location.href=location.href;", true ); // /*lblMsg.Text = "奖品兑换成功!" + DateTime.Now; // BindJiangPin(); // txtTrueName.Text = string.Empty; // txtPhone.Text = string.Empty; // txtAddress.Text = string.Empty;*/ //} //else //{ // //lblMsg.Text = "抱歉,奖品兑换失败,可能是服务器繁忙,请稍候再试!"; // CommonManager.Web.RegJs( this, "alert('抱歉,奖品兑换失败,可能是服务器繁忙,请稍候再试!');location.href=location.href;", true ); //} Dictionary <string, object> dic = new Dictionary <string, object>(); DbSession.Default.FromProc("Web_pAwardBuy").AddInputParameter("@UserID", DbType.Int32, UiCommon.UserLoginInfo.UserID) .AddInputParameter("@Award_ID", DbType.Int32, AwardID) .AddInputParameter("@TrueName", DbType.String, trueName) .AddInputParameter("@Phone", DbType.String, phone) .AddInputParameter("@Address", DbType.String, address) .AddInputParameter("@UserRemark", DbType.String, remark) .AddInputParameter("@Award_OnLineTime", DbType.Int32, AwardTime) .AddReturnValueParameter("@ReturnValue", DbType.Int32) .Execute(out dic); if (dic.Count <= 0) { CommonManager.Web.RegJs(this, "alert('抱歉,购买奖品失败,可能是服务器繁忙,请稍后再试!');location.href=location.href;", true); } if (dic["ReturnValue"].ToString() == "-1") { CommonManager.Web.RegJs(this, "alert('抱歉,购买奖品失败,您的" + UiCommon.StringConfig.GoldName + "数不足!');location.href=location.href;", true); } CommonManager.Web.RegJs(this, "alert('" + ConfigurationManager.AppSettings["DuiJingMgs"] + "');location.href=location.href;", true); }
protected void Page_Load(object sender, EventArgs e) { BLL.Member member = new BLL.Member(); DataRow dr = member.GetInfo(UserLoginInfo.UserID); if (dr == null) { return; } NickName = dr["NickName"].ToString(); Sex = Convert.ToInt32(dr["Sex"]); LogoID = Convert.ToInt32(dr["LogoID"]); LogoID = member.GetLogoID(Sex, LogoID); BankMoney = dr["BankMoney"].ToString(); Email = dr["Email"].ToString(); //��ȡ���Ǯ����ұ����ж�Ǯ���汾 if (UiCommon.StringConfig.BankVersion == "2") { WalletMoney = member.GetWalletMoney(UiCommon.UserLoginInfo.UserID).ToString(); } else { WalletMoney = dr["WalletMoney"].ToString(); } AllMoney = (Convert.ToInt64(BankMoney) + Convert.ToInt64(WalletMoney)).ToString(); OnLineTimeCount = member.ConverTimeToDHMS(member.GetOnLineTimeSum(UserLoginInfo.UserID)); //PlayTimeCount = member.ConverTimeToDHMS(member.GetPlayTimeSum(UserLoginInfo.UserID)); PlayTimeCount = member.ConverTimeToDHMS(member.GetAllPlayTimeByUserID(UserLoginInfo.UserID)); AllLoginCount = dr["AllLoginTime"].ToString(); // string str = dr["RegisterTM"].ToString(); RegisterTM = Convert.ToDateTime(dr["RegisterTM"].ToString()).ToString("yyyy-MM-dd HH:mm:ss"); LastLoginTM = Convert.ToDateTime(dr["LastLoginTM"]).ToString("yyyy-MM-dd HH:mm:ss"); UserFasci = dr["Fascination"].ToString(); Phone = dr["Phone"].ToString(); RealName = dr["RealName"].ToString(); Lotteries = dr["Lotteries"].ToString(); //ZhiYe = dr["OccuPation"].ToString(); //Address = dr["AdrProvince"].ToString() + dr["AdrCity"].ToString() + dr["AdrZone"].ToString(); //Paiming //VipTime-------------- VipTime = dr["VipTime2"].ToString(); DateTime dtNow = DateTime.Now; if (Convert.ToDateTime(VipTime) > dtNow) { VipTime = Convert.ToDateTime(VipTime).ToString("yyyy-MM-dd"); } else { DateTime dtInit = new DateTime(1970, 01, 01, 08, 00, 00); if (Convert.ToDateTime(VipTime) > dtInit) { VipTime = "<a href=\"/Manage/VipApply.aspx\" class=\"red\">����VIP�Ѿ����ڣ���������</a>"; } else { VipTime = "<a href=\"/Manage/VipApply.aspx\" class=\"red\">��������VIP����������</a>"; } } //UserHeadImg------------- //if (LogoID >= 1 && LogoID <= 255)//ϵͳĬ��ͷ�� 1<=LogoID<=255 if (LogoID >= BLL.Member.LogoId_Const1 && LogoID <= BLL.Member.LogoId_Const2) { if (Sex == 1) { UserHeadImg = "/Image/Users/b_" + LogoID + ".png"; } else { UserHeadImg = "/Image/Users/g_" + LogoID + ".png"; } } else if (LogoID >= BLL.Member.LogoId_Const3 && LogoID <= BLL.Member.LogoId_Const4) //�ϴ����Զ���ͷ�� 256<=LogoID<=512 { int childDirName = Convert.ToInt32(UiCommon.UserLoginInfo.UserID) / 1000; UserHeadImg = "/Upload/" + UiCommon.StringConfig.UserCustHeadFolderName + "/" + childDirName + "/" + UiCommon.UserLoginInfo.UserID + ".png"; } else if (LogoID > BLL.Member.LogoId_Const4) //�ϴ����Զ���ͷ�� LogoID>512 ����˻��й���ʱ����Զ���ͷ�� { int childDirName = Convert.ToInt32(UiCommon.UserLoginInfo.UserID) / 1000; UserHeadImg = "/Upload/" + UiCommon.StringConfig.UserCustHeadFolderName + "/" + childDirName + "/" + UiCommon.UserLoginInfo.UserID + ".png"; } GameTimeCount = member.ConverTimeToDHMS(GetPlayTimeCount(UserLoginInfo.UserID)); }
protected void Page_Load(object sender, EventArgs e) { BLL.Member member = new BLL.Member(); DataRow dr = member.GetInfo(UserLoginInfo.UserID); if (dr == null) { return; } NickName = dr["NickName"].ToString(); Sex = Convert.ToInt32(dr["Sex"]); LogoID = Convert.ToInt32(dr["LogoID"]); LogoID = member.GetLogoID(Sex, LogoID); BankMoney = dr["BankMoney"].ToString(); Email = dr["Email"].ToString(); //获取玩家钱包金币必须判断钱包版本 if (UiCommon.StringConfig.BankVersion == "2") { WalletMoney = member.GetWalletMoney(UiCommon.UserLoginInfo.UserID).ToString(); } else { WalletMoney = dr["WalletMoney"].ToString(); } AllMoney = (Convert.ToInt64(BankMoney) + Convert.ToInt64(WalletMoney)).ToString(); OnLineTimeCount = member.ConverTimeToDHMS(member.GetOnLineTimeSum(UserLoginInfo.UserID)); //PlayTimeCount = member.ConverTimeToDHMS(member.GetPlayTimeSum(UserLoginInfo.UserID)); PlayTimeCount = member.ConverTimeToDHMS(member.GetAllPlayTimeByUserID(UserLoginInfo.UserID)); AllLoginCount = dr["AllLoginTime"].ToString(); // string str = dr["RegisterTM"].ToString(); RegisterTM = Convert.ToDateTime(dr["RegisterTM"].ToString()).ToString("yyyy-MM-dd HH:mm:ss"); LastLoginTM = Convert.ToDateTime(dr["LastLoginTM"]).ToString("yyyy-MM-dd HH:mm:ss"); UserFasci = dr["Fascination"].ToString(); Phone = dr["Phone"].ToString(); RealName = dr["RealName"].ToString(); Lotteries = dr["Lotteries"].ToString(); //ZhiYe = dr["OccuPation"].ToString(); //Address = dr["AdrProvince"].ToString() + dr["AdrCity"].ToString() + dr["AdrZone"].ToString(); //Paiming //VipTime-------------- VipTime = dr["VipTime2"].ToString(); DateTime dtNow = DateTime.Now; if (Convert.ToDateTime(VipTime) > dtNow) { VipTime = Convert.ToDateTime(VipTime).ToString("yyyy-MM-dd"); } else { DateTime dtInit = new DateTime(1970, 01, 01, 08, 00, 00); if (Convert.ToDateTime(VipTime) > dtInit) { VipTime = "<a href=\"/Manage/VipApply.aspx\" class=\"red\">您的VIP已经过期,立即申请</a>"; } else { VipTime = "<a href=\"/Manage/VipApply.aspx\" class=\"red\">您还不是VIP,立即申请</a>"; } } //UserHeadImg------------- //if (LogoID >= 1 && LogoID <= 255)//系统默认头像 1<=LogoID<=255 if (LogoID >= BLL.Member.LogoId_Const1 && LogoID <= BLL.Member.LogoId_Const2) { if (Sex == 1) { UserHeadImg = "/Image/Users/b_" + LogoID + ".png"; } else { UserHeadImg = "/Image/Users/g_" + LogoID + ".png"; } } else if (LogoID >= BLL.Member.LogoId_Const3 && LogoID <= BLL.Member.LogoId_Const4) //上传的自定义头像 256<=LogoID<=512 { int childDirName = Convert.ToInt32(UiCommon.UserLoginInfo.UserID) / 1000; UserHeadImg = "/Upload/" + UiCommon.StringConfig.UserCustHeadFolderName + "/" + childDirName + "/" + UiCommon.UserLoginInfo.UserID + ".png"; } else if (LogoID > BLL.Member.LogoId_Const4) //上传的自定义头像 LogoID>512 需审核或有过期时间的自定义头像 { int childDirName = Convert.ToInt32(UiCommon.UserLoginInfo.UserID) / 1000; UserHeadImg = "/Upload/" + UiCommon.StringConfig.UserCustHeadFolderName + "/" + childDirName + "/" + UiCommon.UserLoginInfo.UserID + ".png"; } GameTimeCount = member.ConverTimeToDHMS(GetPlayTimeCount(UserLoginInfo.UserID)); }