private void btnSetPlayerAsAgent_Click(object sender, RoutedEventArgs e) { try { if (this.datagridPlayerInfos.SelectedItem is PlayerInfoUIModel) { PlayerInfoUIModel player = this.datagridPlayerInfos.SelectedItem as PlayerInfoUIModel; if (MessageBox.Show("请确认要将玩家【" + player.UserLoginName + "】设置为代理?", "请确认", MessageBoxButton.OKCancel) == MessageBoxResult.OK) { InputActionPasswordWindow win = new InputActionPasswordWindow(); if (win.ShowDialog() == true) { //string ActionPassword = win.ActionPassword; EditAgentInfoWindow winEdit = new EditAgentInfoWindow(player.UserID, player.UserLoginName); winEdit.ShowDialog(); if (winEdit.ISOK) { App.PlayerVMObject.AsyncGetListPlayers(); } } } } } catch (Exception exc) { MyMessageBox.ShowInfo("解锁玩家异常。" + exc.Message); } }
public EditPlayerWindow(PlayerInfoUIModel player) { InitializeComponent(); this._player = player; this.DataContext = _player; }
void Client_GetPlayersCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <SuperMinersServerApplication.Model.PlayerInfoLoginWrap[]> e) { App.BusyToken.CloseBusyWindow(); if (e.Cancelled) { return; } if (e.Error != null || e.Result == null) { MessageBox.Show("获取玩家信息失败。"); return; } this.ListAllPlayers.Clear(); this.ListFilteredPlayers.Clear(); foreach (var item in e.Result) { var player = new PlayerInfoUIModel(item); this.ListAllPlayers.Add(player); this.ListFilteredPlayers.Add(player); } if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs("PlayersCount")); } }
private void btnUnLockPlayer_Click(object sender, RoutedEventArgs e) { try { if (this.datagridPlayerInfos.SelectedItem is PlayerInfoUIModel) { PlayerInfoUIModel player = this.datagridPlayerInfos.SelectedItem as PlayerInfoUIModel; if (!player.IsLocked) { MyMessageBox.ShowInfo("该玩家没有被锁定"); return; } InputActionPasswordWindow win = new InputActionPasswordWindow(); if (win.ShowDialog() == true) { string ActionPassword = win.ActionPassword; if (MessageBox.Show("请确认要解锁玩家【" + player.UserLoginName + "】", "请确认", MessageBoxButton.OKCancel) == MessageBoxResult.OK) { App.PlayerVMObject.AsyncUnLockPlayerInfos(player.UserLoginName, ActionPassword); } } } } catch (Exception exc) { MyMessageBox.ShowInfo("解锁玩家异常。" + exc.Message); } }
private void btnLockPlayer_Click(object sender, RoutedEventArgs e) { try { if (this.datagridPlayerInfos.SelectedItem is PlayerInfoUIModel) { PlayerInfoUIModel player = this.datagridPlayerInfos.SelectedItem as PlayerInfoUIModel; if (player.IsLocked) { MyMessageBox.ShowInfo("该玩家已经被锁定"); return; } InputActionPasswordWindow win = new InputActionPasswordWindow(); if (win.ShowDialog() == true) { string ActionPassword = win.ActionPassword; InputValueWindow winInputValue = new InputValueWindow("请确认", "请输入要锁定玩家登录天数", 100, 1); if (winInputValue.ShowDialog() == true) { App.PlayerVMObject.AsyncLockPlayerInfos(player.UserLoginName, ActionPassword, (int)winInputValue.Value); } } } } catch (Exception exc) { MyMessageBox.ShowInfo("锁定玩家异常。" + exc.Message); } }
public void AsyncChangePlayerInfo(PlayerInfoUIModel player, string actionPassword) { if (GlobalData.Client.IsConnected) { App.BusyToken.ShowBusyWindow("正在保存玩家信息..."); GlobalData.Client.ChangePlayer(player.ParentObject, actionPassword); } }
private void btnViewPlayerLoginLogs_Click(object sender, RoutedEventArgs e) { try { if (this.datagridPlayerInfos.SelectedItem is PlayerInfoUIModel) { PlayerInfoUIModel player = this.datagridPlayerInfos.SelectedItem as PlayerInfoUIModel; ViewPlayerLoginLogsWindow win = new ViewPlayerLoginLogsWindow(player.UserID); win.ShowDialog(); } } catch (Exception exc) { } }
public EditPlayerStoneWindow(PlayerInfoUIModel player) { InitializeComponent(); this._player = player; this.txtCurrentFreezingStones.Text = _player.FreezingStones.ToString(); this.numChangedFreezingStones.Value = (double)_player.FreezingStones; this.txtCurrentSellableStones.Text = _player.SellableStones.ToString(); this.numChangedSellableStones.Value = (double)_player.SellableStones; this.txtCurrentStockOfStones.Text = _player.StockOfStones.ToString(); this.numChangedStockOfStones.Value = (double)_player.StockOfStones; this.txtCurrentStonesReserves.Text = _player.StonesReserves.ToString(); this.numChangedStonesReserves.Value = (double)_player.StonesReserves; this.numChangedStockOfStones.ValueChanged += numChangedStockOfStones_ValueChanged; this.numChangedFreezingStones.ValueChanged += numChangedFreezingStones_ValueChanged; }
private void btnAddNewRemoteServiceHandled_Click(object sender, RoutedEventArgs e) { try { if (this.datagridPlayerInfos.SelectedItem is PlayerInfoUIModel) { PlayerInfoUIModel player = this.datagridPlayerInfos.SelectedItem as PlayerInfoUIModel; EditPlayerRemoteServiceHandleWindow win = new EditPlayerRemoteServiceHandleWindow(); win.AddNewRecord(player.UserName); win.ShowDialog(); } } catch (Exception exc) { } }
private void btnEditPlayerInfo_Click(object sender, RoutedEventArgs e) { try { if (this.datagridPlayerInfos.SelectedItem is PlayerInfoUIModel) { PlayerInfoUIModel player = this.datagridPlayerInfos.SelectedItem as PlayerInfoUIModel; //GlobalData.Client.TransferPlayerToCompleted += Client_TransferPlayerToCompleted; //GlobalData.Client.TransferPlayerTo(player.ParentObject.SimpleInfo, player.ParentObject.FortuneInfo); EditPlayerWindow win = new EditPlayerWindow(player); win.ShowDialog(); } } catch (Exception exc) { } }
private void PlayerListContextMenu_ViewRemoteServiceHandleRecordItem_Click(object sender, RoutedEventArgs e) { try { if (this.datagridPlayerInfos.SelectedItem is PlayerInfoUIModel) { PlayerInfoUIModel player = this.datagridPlayerInfos.SelectedItem as PlayerInfoUIModel; if (player != null) { if (ViewPlayerRemoteServiceHandleRecords != null) { ViewPlayerRemoteServiceHandleRecords(player.UserName); } } } } catch (Exception exc) { MessageBox.Show(exc.Message); } }
void PlayerListContextMenu_ViewRechargeGoldCoinRecordItem_Click(object sender, RoutedEventArgs e) { try { if (this.datagridPlayerInfos.SelectedItem is PlayerInfoUIModel) { PlayerInfoUIModel player = this.datagridPlayerInfos.SelectedItem as PlayerInfoUIModel; if (player != null) { if (this.ViewPlayerBuyGoldCoinRecords != null) { this.ViewPlayerBuyGoldCoinRecords(player.UserName); } } } } catch (Exception exc) { MessageBox.Show(exc.Message); } }
//void Client_TransferPlayerToCompleted(object sender, Wcf.Clients.WebInvokeEventArgs<int> e) //{ // try // { // GlobalData.Client.TransferPlayerToCompleted -= Client_TransferPlayerToCompleted; // if (e.Error != null) // { // MessageBox.Show(e.Error.Message); // return; // } // MessageBox.Show(MetaData.OperResult.GetMsg(e.Result)); // } // catch (Exception exc) // { // MessageBox.Show(exc.Message); // } //} private void btnDeletePlayer_Click(object sender, RoutedEventArgs e) { try { if (this.datagridPlayerInfos.SelectedItem is PlayerInfoUIModel) { InputActionPasswordWindow win = new InputActionPasswordWindow(); if (win.ShowDialog() == true) { string ActionPassword = win.ActionPassword; PlayerInfoUIModel player = this.datagridPlayerInfos.SelectedItem as PlayerInfoUIModel; if (MessageBox.Show("删除玩家【" + player.UserName + "】?该操作不可恢复,请确认?", "请确认", MessageBoxButton.OKCancel) == MessageBoxResult.OK) { App.PlayerVMObject.AsyncDeletePlayerInfos(new string[] { player.UserName }, ActionPassword); } } } } catch (Exception exc) { } }