Exemplo n.º 1
0
		public static Match Get(SafeDataReader dr)
		{
			//Util.CheckReadAccess();
			Match item = new Match();
			item.Populate(dr);
			return item;
		}
Exemplo n.º 2
0
		public static List<PlayerMatch> GetListAll(SafeDataReader dr)
		{
			var list = new List<PlayerMatch>();
			while (dr.Read())
				list.Add(PlayerMatch.Get(dr));
			return list;
		}
Exemplo n.º 3
0
		public static List<PlayerOpponentSummary> GetList(SafeDataReader dr)
		{
			var list = new List<PlayerOpponentSummary>();
			while (dr.Read())
				list.Add(PlayerOpponentSummary.Get(dr));
			return list;
		}
Exemplo n.º 4
0
			internal void Fetch(SafeDataReader dr)
			{
				WGames = dr.GetByte();
				LGames = dr.GetByte();
				WTiebreak = dr.GetByte();
				LTiebreak = dr.GetByte();
			}
Exemplo n.º 5
0
		public static List<MatchSummary> GetList(SafeDataReader dr)
		{
			var list = new List<MatchSummary>();
			while (dr.Read())
				list.Add(MatchSummary.Get(dr));
			dr.Close();
			return list;
		}
Exemplo n.º 6
0
		public static List<PlayerMatch> GetListMostRecent(SafeDataReader dr, int n)
		{
			var list = new List<PlayerMatch>();
			while (dr.Read() && n-- > 0)
				list.Add(PlayerMatch.Get(dr));
			dr.Close();
			return list;
		}
Exemplo n.º 7
0
		private void Populate(SafeDataReader dr)
		{
			_ID = dr.GetInt32();
			_EventID = dr.GetInt32();
			_MatchDate = dr.GetDateTime();
			_WinnerID = dr.GetInt32();
			_LoserID = dr.GetInt32();
			_Score.Fetch(dr);

			ValidationRules.CheckRules();
		}
Exemplo n.º 8
0
		private void Fetch(SafeDataReader dr)
		{
			//todo: load object data from data reader 
			//_TennisEvent = TennisObjects.TennisEvent.GetTennisEvent() 
			_ID = dr.GetInt32();
			_Name = dr.GetString();
			_startDate = dr.GetDateTime();
			_endDate = dr.GetDateTime();
			_eventType = (EventTypeEnum)dr.GetInt16();
			_teamPlay = dr.GetBoolean();
			_classificationID = dr.GetInt32();
			_classification = dr.GetString();
			_firstMatchDate = dr.GetDateTime();
			_lastMatchDate = dr.GetDateTime();
			_Matches.Won = dr.GetInt32();
			_Matches.Lost = dr.GetInt32();
			_Sets.Won = dr.GetInt32();
			_Sets.Lost = dr.GetInt32();
			_Games.Won = dr.GetInt32();
			_Games.Lost = dr.GetInt32();
		}
Exemplo n.º 9
0
		public static MatchSummary Get(SafeDataReader dr)
		{
			MatchSummary item = new MatchSummary();
			item.Fetch(dr);
			return item;
		}
Exemplo n.º 10
0
		private void _Fetch(SafeDataReader dr)
		{
			_ID = dr.GetInt32();
			_Name = dr.GetString();
			_ClassificationID = dr.GetInt32();
			_BeginDate = dr.GetDateTime();
			_EndDate = dr.GetDateTime();
			_EventType = (EventTypeEnum)dr.GetInt16();
			_TeamPlay = dr.GetBoolean();
		}
Exemplo n.º 11
0
		private void Fetch(SafeDataReader dr)
		{
			//todo: load object data from data reader 
			//_TennisEvent = TennisObjects.TennisEvent.GetTennisEvent() 
			_ID = dr.GetInt32();
			_Name = dr.GetString();
			_Matches.Won = dr.GetInt32();
			_Matches.Lost = dr.GetInt32();
			_Sets.Won = dr.GetInt32();
			_Sets.Lost = dr.GetInt32();
			_Games.Won = dr.GetInt32();
			_Games.Lost = dr.GetInt32();
		}
Exemplo n.º 12
0
		private PlayerMatch(SafeDataReader dr)
		{
			_Fetch(dr);
		}
Exemplo n.º 13
0
		private void _Fetch(SafeDataReader dr)
		{
			_ID = dr.GetInt32();
			_MatchDate = dr.GetDateTime();
			_EventID = dr.GetInt32();
			_EventName = dr.GetString();
			_ClassID = dr.GetInt32();
			_ClassName = dr.GetString();
			_Result = dr.GetString();
			_OpponentID = dr.GetInt32();
			_OpponentName = dr.GetString();
			_Score.Fetch(dr);
			//Log.Info("Fetched PlayerMatch {0}", _ID);
		}
Exemplo n.º 14
0
		public static PlayerMatch Get(SafeDataReader dr)
		{
			return new PlayerMatch(dr);
		}
Exemplo n.º 15
0
		//protected override void DataPortal_Fetch(object Criteria)
		//{
		//    Criteria crit = (Criteria)Criteria;
		//    using (SafeDataReader dr = DbHelper.ExecuteReader("csla_get_event", crit.ID))
		//    {
		//        if (!dr.Read())
		//        {
		//            throw new RecordNotFoundException(string.Format("Event not found (ID:{0})", crit.ID));
		//        }
		//        _Fetch(dr);
		//    }
		//    MarkOld();
		//}

		//protected override void DataPortal_Insert()
		//{
		//    Util.CheckAddAccess();

		//    //insert or update object data into database 
		//    log.Debug("updating event " + ToString());

		//    DbResultsDictionary ret = DbHelper.ExecuteNonQuery("csla_save_event", Util.IDParam(_ID, IsNew), _Name, _ClassificationID, _BeginDate.DbValue, _EndDate.DbValue, _EventType, _TeamPlay);
		//    _ID = (int)ret["@ID"];
		//    log.Info(string.Format("New id is {0}", _ID));
		//}

		//protected override void DataPortal_Update()
		//{
		//    Util.CheckEditAccess();

		//    //insert or update object data into database 
		//    log.Debug("updating event " + ToString());

		//        DbResultsDictionary ret = DbHelper.ExecuteNonQuery("csla_save_event", Util.IDParam(_ID, IsNew), _Name, _ClassificationID, _BeginDate.DbValue, _EndDate.DbValue, _EventType, _TeamPlay);
		//        if (IsNew)
		//        {
		//            _ID = (int)ret["@ID"];
		//            log.Info(string.Format("New id is {0}", _ID));
		//        }
		//}

		//protected override void DataPortal_DeleteSelf()
		//{
		//    Util.CheckDeleteAccess();
		//    DbHelper.ExecuteNonQuery("csla_delete_event", ID);
		//}

		//protected override void DataPortal_Delete(object Criteria)
		//{
		//    Criteria crit = (Criteria)Criteria;
		//    DbHelper.ExecuteNonQuery("csla_delete_event", crit.ID);
		//}
		#endregion


		public static List<TennisEvent> GetList(SafeDataReader dr)
		{
			var list = new List<TennisEvent>();
			while (dr.Read())
				list.Add(TennisEvent.Get(dr));
			return list;
		}
Exemplo n.º 16
0
		internal void Fetch(SafeDataReader dr)
		{
			for (int i = 0; i <= 4; i++)
			{
				_Sets[i].Fetch(dr);
			}
			_LoserDefaulted = dr.GetBoolean();
		}
Exemplo n.º 17
0
		public static PlayerOpponentSummary Get(SafeDataReader dr)
		{
			PlayerOpponentSummary PlayerOpponentSummary = new PlayerOpponentSummary();
			PlayerOpponentSummary.Fetch(dr);
			return PlayerOpponentSummary;
		}
Exemplo n.º 18
0
		//public static TennisEvent Fetch(int ID)
		//{
		//    return (TennisEvent)DataPortal.Fetch(new Criteria(ID));
		//}

		public static TennisEvent Get(SafeDataReader dr)
		{
			TennisEvent item = new TennisEvent();
			item._Fetch(dr);
			item.MarkOld();
			return item;
		}