예제 #1
0
 public MinerTradeHistoryRecordControl()
 {
     InitializeComponent();
     this.datagrid.ItemsSource        = App.TradeHistoryVMObject.ListMinerBuyRecords;
     this.dpStartCreateTime.ValueTime = MyDateTime.FromDateTime(DateTime.Now.AddDays(-7));
     this.dpEndCreateTime.ValueTime   = MyDateTime.FromDateTime(DateTime.Now);
 }
 public AlipayHistoryRecordControl()
 {
     InitializeComponent();
     this.datagrid.ItemsSource     = App.TradeHistoryVMObject.ListAllAlipayRecords;
     this.dpStartPayTime.ValueTime = MyDateTime.FromDateTime(DateTime.Now.AddDays(-7));
     this.dpEndPayTime.ValueTime   = MyDateTime.FromDateTime(DateTime.Now);
 }
 public void SetRecordPay()
 {
     this.ParentObject.IsPay   = true;
     this.ParentObject.PayTime = MyDateTime.FromDateTime(DateTime.Now);
     NotifyPropertyChange("IsPay");
     NotifyPropertyChange("PayTime");
 }
 public GoldCoinRechargeHistoryRecordControl()
 {
     InitializeComponent();
     this.dgRecords.ItemsSource       = App.TradeHistoryVMObject.ListGoldCoinRechargeRecords;
     this.dpStartCreateTime.ValueTime = MyDateTime.FromDateTime(DateTime.Now.AddDays(-7));
     this.dpEndCreateTime.ValueTime   = MyDateTime.FromDateTime(DateTime.Now);
 }
        public HandleExceptionAlipayRecordWindow(AlipayRechargeRecordUIModel alipayRecord)
        {
            InitializeComponent();
            _alipayRecord = alipayRecord;

            try
            {
                this.txtAlipayOrderNumber.Text   = alipayRecord.alipay_trade_no;
                this.txtBuyerEmail.Text          = alipayRecord.buyer_email;
                this.txtBuyerEmail.IsReadOnly    = true;
                this.txtBuyerUserName.Text       = alipayRecord.user_name;
                this.txtBuyerUserName.IsReadOnly = true;
                this.txtOrderNumber.Text         = alipayRecord.out_trade_no;
                this.txtOrderNumber.IsReadOnly   = true;
                this.txtOrderType.Text           = alipayRecord.TradeTypeText;
                this.numTotalFee.Value           = (double)alipayRecord.total_fee;
                this.numTotalFee.IsReadOnly      = true;
                //this.numValueRMB.Value = (double)alipayRecord.value_rmb;
                this.mydpPayTime.ValueTime = MyDateTime.FromDateTime(alipayRecord.pay_time);
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
예제 #6
0
        public int PayAward(string adminUserName, string playerUserName, int recordID)
        {
            RouletteWinnerRecord record = _finishedRouletteWinnerRecord.FirstOrDefault(r => r.RecordID == recordID);

            if (record == null)
            {
                return(OperResult.RESULTCODE_GAME_WINAWARDRECORD_NOT_EXIST);
            }
            if (record.UserName != playerUserName)
            {
                return(OperResult.RESULTCODE_GAME_WINAWARDRECORD_NOT_EXIST);
            }

            record.IsPay   = true;
            record.PayTime = MyDateTime.FromDateTime(DateTime.Now);

            //save To DB
            DBProvider.GameRouletteDBProvider.SetWinnerRecordPay(record);
            //notify player
            LogHelper.Instance.AddInfoLog("管理员[" + adminUserName + "],确认支付了玩家[" + playerUserName + "]的幸运转盘大奖," + record.AwardItem.AwardName);

            string playerToken = ClientManager.GetToken(playerUserName);

            if (!string.IsNullOrEmpty(playerToken))
            {
                if (RouletteWinRealAwardPaySucceedNotify != null)
                {
                    RouletteWinRealAwardPaySucceedNotify(playerToken, record);
                }
            }

            _finishedRouletteWinnerRecord.Remove(record);

            return(OperResult.RESULTCODE_TRUE);
        }
예제 #7
0
        /// <summary>
        /// 领取奖励
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="recordID"></param>
        /// <param name="info1"></param>
        /// <param name="info2"></param>
        public int TakeAward(string userName, int recordID, string info1, string info2)
        {
            RouletteWinnerRecord record = _finishedRouletteWinnerRecord.FirstOrDefault(r => r.RecordID == recordID);

            if (record == null)
            {
                return(OperResult.RESULTCODE_GAME_WINAWARDRECORD_NOT_EXIST);
            }
            if (record.UserName != userName)
            {
                return(OperResult.RESULTCODE_GAME_WINAWARDRECORD_NOT_EXIST);
            }
            record.IsGot    = true;
            record.GotTime  = MyDateTime.FromDateTime(DateTime.Now);
            record.GotInfo1 = info1;
            record.GotInfo2 = info2;
            //Save to DB
            DBProvider.GameRouletteDBProvider.SetWinnerRecordGot(record);

            //Notify Administrator
            LogHelper.Instance.AddInfoLog("玩家[" + userName + "],领取了幸运转盘大奖," + record.AwardItem.AwardName);


            return(OperResult.RESULTCODE_TRUE);
        }
예제 #8
0
        public DelegateBuyStoneHistoryRecordControl()
        {
            InitializeComponent();

            this.dgRecords.ItemsSource       = App.StackStoneVMObject.AllFinishedBuyOrders;
            this.dpStartCreateTime.ValueTime = MyDateTime.FromDateTime(DateTime.Now.AddDays(-7));
            this.dpEndCreateTime.ValueTime   = MyDateTime.FromDateTime(DateTime.Now);
        }
        public StoneSellTradeHistoryRecordControl()
        {
            InitializeComponent();
            this.dgRecords.ItemsSource = App.StoneOrderVMObject.ListMySellStoneHistoryOrders;

            this.dpStartCreateTime.ValueTime = MyDateTime.FromDateTime(DateTime.Now.AddDays(-7));
            this.dpEndCreateTime.ValueTime   = MyDateTime.FromDateTime(DateTime.Now);
        }
예제 #10
0
        public EditPlayerLastGatherStoneTimeWindow(string userName, DateTime?lastGatherStoneTime)
        {
            InitializeComponent();

            this.txtUserName.Text = userName;
            if (lastGatherStoneTime == null)
            {
                this.numChangedTime.ValueTime = new MyDateTime();
            }
            else
            {
                this.numChangedTime.ValueTime = MyDateTime.FromDateTime(lastGatherStoneTime.Value);
            }
        }
        public int Join(int userID, string userName, int roundID, int stonesCount)
        {
            lock (_lockJoin)
            {
                if (roundID != this._currentRoundInfo.ID)
                {
                    return(OperResult.RESULTCODE_FALSE);
                }
                if (this._currentRoundInfo.State == RaiderRoundState.Finished)
                {
                    return(OperResult.RESULTCODE_GAME_RAIDER_ROUNDFINISHED);
                }

                if (!this.listPlayerUserName.Contains(userName))
                {
                    this.listPlayerUserName.Add(userName);
                    this._currentRoundInfo.JoinedPlayerCount++;
                }

                this._currentRoundInfo.AwardPoolSumStones += stonesCount;

                if (this._currentRoundInfo.State == RaiderRoundState.Waiting && this._currentRoundInfo.JoinedPlayerCount >= 2)
                {
                    StartRound();
                }
            }

            var betInfo = new RaiderPlayerBetInfo()
            {
                UserID        = userID,
                UserName      = userName,
                RaiderRoundID = _currentRoundInfo.ID,
                BetStones     = stonesCount,
                Time          = MyDateTime.FromDateTime(DateTime.Now)
            };

            //如果保存数据库不成功,将异常抛到外层
            DBProvider.GameRaiderofLostArkDBProvider.SavePlayerBetInfo(betInfo);
            listPlayerBetInfos.Add(betInfo);

            if (this._currentRoundInfo.JoinedPlayerCount >= 2)
            {
                return(OperResult.RESULTCODE_TRUE);
            }
            else
            {
                return(OperResult.RESULTCODE_GAME_RAIDER_WAITINGSECONDPLAYERJOIN_TOSTART);
            }
        }
예제 #12
0
        public bool PlayerRechargeRMB(PlayerInfo player, AgentAwardType awardType, decimal playerInchargeRMB, CustomerMySqlTransaction trans)
        {
            if (player.SimpleInfo.IsAgentReferred || player.FortuneInfo.Exp < 50 ||
                player.SimpleInfo.AgentUserID == 0 ||
                player.SimpleInfo.AgentReferredLevel == 0 || player.SimpleInfo.AgentReferredLevel > 2)
            {
                return(false);
            }

            var agent = GetReferredAgent(player);

            if (agent == null)
            {
                return(false);
            }

            AgentAwardRecord record = new AgentAwardRecord();

            record.AgentID        = agent.ID;
            record.AgentUserName  = agent.Player.SimpleInfo.UserName;
            record.PlayerID       = player.SimpleInfo.UserID;
            record.PlayerUserName = player.SimpleInfo.UserName;
            record.Time           = MyDateTime.FromDateTime(DateTime.Now);
            switch (awardType)
            {
            case AgentAwardType.PlayerAgentExp:
                record.PlayerInchargeRMB     = 0;
                record.AgentAwardRMB         = 30 * GlobalConfig.GameConfig.Yuan_RMB;
                record.PlayerInchargeContent = "玩家贡献值达到50奖励";
                break;

            case AgentAwardType.PlayerInchargeGoldCoin:
                record.PlayerInchargeRMB = playerInchargeRMB;
                if (player.SimpleInfo.AgentReferredLevel == 1)
                {
                    record.AgentAwardRMB = 0.1m * playerInchargeRMB;
                }
                else if (player.SimpleInfo.AgentReferredLevel == 2)
                {
                    record.AgentAwardRMB = 0.05m * playerInchargeRMB;
                }
                record.PlayerInchargeContent = "玩家用充值金币奖励";
                break;

            case AgentAwardType.PlayerInchargeMine:
                record.PlayerInchargeRMB = playerInchargeRMB;
                if (player.SimpleInfo.AgentReferredLevel == 1)
                {
                    record.AgentAwardRMB = 0.1m * playerInchargeRMB;
                }
                else if (player.SimpleInfo.AgentReferredLevel == 2)
                {
                    record.AgentAwardRMB = 0.05m * playerInchargeRMB;
                }
                record.PlayerInchargeContent = "玩家购买矿山奖励";
                break;

            default:
                break;
            }

            if (record.AgentAwardRMB > 1)
            {
                DBProvider.AgentAwardRecordDBProvider.AddAgentAwardRecord(record, trans);
            }

            return(true);
        }
예제 #13
0
        public RouletteWinnerRecord Finish(int userID, string userName, int winAwardID)
        {
            int serverWinAwardID = -1;

            if (!this._tempRouletteWinnerRecord.TryGetValue(userName, out serverWinAwardID))
            {
                return(null);
            }

            if (serverWinAwardID != winAwardID && winAwardID != this._noneAwardID)
            {
                return(null);
            }
            this._tempRouletteWinnerRecord.Remove(userName);

            RouletteWinnerRecord record = new RouletteWinnerRecord()
            {
                RouletteAwardItemID = winAwardID,
                AwardItem           = this._dicCurrentRouletteAwardItems[winAwardID],
                UserID   = userID,
                UserName = userName,
                //UserNickName = userNickName,
                WinTime = MyDateTime.FromDateTime(DateTime.Now),
                IsGot   = false,
                IsPay   = false
            };

            var awardItem = this._dicCurrentRouletteAwardItems[winAwardID];

            if (awardItem.RouletteAwardType != RouletteAwardType.None)
            {
                if (awardItem.RouletteAwardType != RouletteAwardType.RealAward)
                {
                    var isOK = PlayerController.Instance.RouletteWinVirtualAwardPayUpdatePlayer(userName, awardItem);
                    if (isOK)
                    {
                        record.IsGot   = true;
                        record.GotTime = MyDateTime.FromDateTime(DateTime.Now);
                        record.IsPay   = true;
                        record.PayTime = MyDateTime.FromDateTime(DateTime.Now);
                    }
                }

                //通知
                LogHelper.Instance.AddInfoLog("玩家[" + userName + "],完成了幸运大转盘抽奖。并抽中" + record.AwardItem.AwardName);

                if (record.AwardItem.RouletteAwardType == RouletteAwardType.RealAward)
                {
                    this._finishedRouletteWinnerRecord.Add(record);
                }
            }
            else
            {
                record.IsGot   = true;
                record.GotTime = MyDateTime.FromDateTime(DateTime.Now);
                record.IsPay   = true;
                record.PayTime = MyDateTime.FromDateTime(DateTime.Now);
            }

            //Save Record
            DBProvider.GameRouletteDBProvider.AddRouletteWinnerRecord(record);
            var dbRecord = DBProvider.GameRouletteDBProvider.GetPayWinAwardRecord(record.UserID, winAwardID, record.WinTime.ToDateTime());

            if (dbRecord != null)
            {
                record.RecordID = dbRecord.RecordID;
            }

            return(record);
        }