예제 #1
0
파일: MatchScore.cs 프로젝트: gbahns/Tennis
			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
파일: MatchScore.cs 프로젝트: gbahns/Tennis
		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
파일: Match.cs 프로젝트: gbahns/Tennis
		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
파일: MatchScore.cs 프로젝트: gbahns/Tennis
			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
파일: MatchScore.cs 프로젝트: gbahns/Tennis
		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);
		}