private void SavePlayer() { string error = null; if (_player == null) { error = "Invalid Player"; } else if (string.IsNullOrEmpty(_player.PlayerId)) { error = "Invalid PlayerID"; } else if (string.IsNullOrEmpty(_player.Name)) { error = "Player Name is required"; } if (!string.IsNullOrEmpty(error)) { var alert = new UIAlertView("Error", "Invalid Player - " + error, null, "Ok", null); alert.Show(); } else { SetModelData(); if (_newPlayer) { _playerListViewController.AddPlayer(_player); } if (_player.InGame && _player.FanValue != FanEnum.Unknown && !string.IsNullOrEmpty(_player.HeadsetId)) { try { var response = _playerService.AssignPlayer(new JsonHeadset(_player)); } catch (Exception e) { var alert = new UIAlertView("Error", e.Message, null, "Ok", null); alert.Show(); } } Console.WriteLine("Save Player"); NavigationController.PopViewController(true); } }