Пример #1
0
			internal void FromInfo(TennisObjects.Info.MatchScore.MatchSet source)
			{
				_LGames = source.LGames;
				_LTiebreak = source.LTiebreak;
				_WGames = source.WGames;
				_WTiebreak = source.WTiebreak;
			}
Пример #2
0
		public ActionResult Create(TennisObjects.Player player)
		{
			if (!ModelState.IsValid)
				return View(player);

			player.Save();
			return RedirectToAction("details", "player", new { id = player.ID });
		}
Пример #3
0
		void Match_Updated(TennisObjects.Match obj)
		{
			Log.Info("match updated: {0}", obj);
			PlayerMatchViewModel item = List.First(delegate(PlayerMatchViewModel param) { return param.ID == obj.ID; });
			int index = List.IndexOf(item);
			List.RemoveAt(index);
			List.Insert(index, new PlayerMatchViewModel(PlayerMatch.FromMatch(obj, 1)));
			//List.Insert(0, new PlayerMatchViewModel(PlayerMatch.FromMatch(obj, 1)));
		}
Пример #4
0
		internal static MatchScore FromEditable(TennisObjects.MatchScore source)
		{
			MatchScore item = new MatchScore();
			item._LoserDefaulted = source.LoserDefaulted;
			for (Int16 i = 0; i <= 4; i++)
			{
				item._Sets[i].FromEditable(source.Sets[i]);
			}
			return item;
		}
Пример #5
0
		public static Match FromInfo(TennisObjects.Info.Match from)
		{
			//Util.CheckReadAccess();
			Match item = new Match();
			item._EventID = from.EventID;
			item._ID = from.ID;
			item._LoserID = from.LoserID;
			item._MatchDate = from.MatchDate;
			item._Score.FromInfo(from.Score);
			//item.Score = from.Score;
			item._WinnerID = from.WinnerID;
			item.MarkOld();
			item.ValidationRules.CheckRules();
			return item;
		}
Пример #6
0
		private PlayerMatch(TennisObjects.Match Match, int PlayerID)
		{
			_ID = Match.ID;
			_MatchDate.Text = Match.MatchDate.ToShortDateString();

			//TennisEvent TennisEvent = Match.Events.Find(Match.EventID);
			TennisEvent TennisEvent = TennisEvent.Get(Match.EventID);
			_EventID = TennisEvent.ID;
			_EventName = TennisEvent.Name;
			_ClassID = TennisEvent.ClassificationID;
			_ClassName = "";

			_Result = (PlayerID == Match.WinnerID ? "W" : "L");
			_OpponentID = (PlayerID == Match.WinnerID ? Match.LoserID : Match.WinnerID);
			_OpponentName = Player.Get(_OpponentID).FullName;
			_Score = MatchScore.FromEditable(Match.Score);
		}
Пример #7
0
			internal void FromEditable(TennisObjects.MatchScore.MatchSet matchSet)
			{
				WGames = matchSet.WGames;
				LGames = matchSet.LGames;
				WTiebreak = matchSet.WTiebreak;
				LTiebreak = matchSet.LTiebreak;
			}
Пример #8
0
		void Match_Created(TennisObjects.Match obj)
		{
			Log.Info("new match created: {0}", obj);
			List.Insert(0, new PlayerMatchViewModel(PlayerMatch.FromMatch(obj, 1)));
		}
Пример #9
0
		internal void FromInfo(TennisObjects.Info.MatchScore from)
		{
			_LoserDefaulted = from.LoserDefaulted;
			for (int i = 0; i < _Sets.Length; i++)
				_Sets[i].FromInfo(from.Sets[i]);
		}
Пример #10
0
		public static PlayerMatch FromMatch(TennisObjects.Match Match, int PlayerID)
		{
			return new PlayerMatch(Match, PlayerID);
		}