protected void rBTNAssign_Click(object sender, EventArgs e) { //var strPlayerGUID = rLBPlayer.SelectedValue; var strPlayerGUID = hddPlayerGUID.Value; Guid PlayerGuid = Guid.Parse(strPlayerGUID); if (rDDSeasonTeam.SelectedValue == "0") // Put player in recycle bin { SeasonPlayerDomainModel SP = new SeasonPlayerDomainModel(); SeasonPlayerBusinessLogic SPBLL = new SeasonPlayerBusinessLogic(); SP.SeasonID = Convert.ToInt32(rDDSeason.SelectedValue); SP.PlayerGUID = PlayerGuid; SPBLL.InsertSeasonPlayerRecycle(SP); } else { SeasonTeamPlayerDomainModel STP = new SeasonTeamPlayerDomainModel(); STP.SeasonID = Convert.ToInt32(rDDSeason.SelectedValue); STP.TeamID = Convert.ToInt32(rDDSeasonTeam.SelectedValue); STP.PlayerGUID = PlayerGuid; STP.Points = Convert.ToInt32(rNTBCurrBid.Value); DraftPlayerBLL.DraftPlayer(STP); } strPageState = "Pick"; ManageButtons(); RepaintScreen(); }
protected void rBTNEmptyRecycleBin_Click(object sender, EventArgs e) { SeasonPlayerDomainModel SP = new SeasonPlayerDomainModel(); SeasonPlayerBusinessLogic SPBLL = new SeasonPlayerBusinessLogic(); SP.SeasonID = Convert.ToInt32(rDDSeason.SelectedValue); SPBLL.DeleteSeasonRecyclePlayerAll(SP); }
public static void HandlePitcher(List <clsPitcher> colPitchers) { PlayerBusinessLogic pBLL = new PlayerBusinessLogic(); PlayerDomainModel player = new PlayerDomainModel(); PlayerPostiionBusinessLogic ppBLL = new PlayerPostiionBusinessLogic(); PlayerPositionDomainModel playerposition = new PlayerPositionDomainModel(); StatBusinessLogic sBLL = new StatBusinessLogic(); StatDomainModel stat = new StatDomainModel(); SeasonPlayerPositionStatBusinessLogic sppsBLL = new SeasonPlayerPositionStatBusinessLogic(); SeasonPlayerPositionStatDomainModel statValue = new SeasonPlayerPositionStatDomainModel(); SeasonPlayerBusinessLogic spBLL = new SeasonPlayerBusinessLogic(); SeasonPlayerDomainModel spDM = new SeasonPlayerDomainModel(); statValue.SeasonID = C_SeasonID; statValue.PlayerGUID = player.PlayerGUID; sppsBLL.DeleteAllStatsForPlayer(statValue); foreach (clsPitcher cPitcher in colPitchers) { player.PlayerName = cPitcher.FirstName.Trim() + " " + cPitcher.LastName.Trim(); pBLL.InsertPlayer(player); playerposition.PlayerGUID = player.PlayerGUID; playerposition.PrimaryPositionID = TransformPos(cPitcher.Pos); playerposition.SecondaryPostiionID = null; ppBLL.DeletePlayerPosition(playerposition); ppBLL.InsertPlayerPosition(playerposition); spDM.PlayerGUID = player.PlayerGUID; spDM.SeasonID = C_SeasonID; spBLL.InsertSeasonPlayer(spDM); BindingFlags flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; foreach (FieldInfo f in cPitcher.GetType().GetFields(flags)) { Console.WriteLine("{0} = {1}", f.Name, f.GetValue(cPitcher)); System.Diagnostics.Debug.WriteLine("{0} = {1}", f.Name, f.GetValue(cPitcher)); string fieldName = _getBackingFieldName(f.Name.ToUpper()); if (fieldName != "FIRSTNAME" && fieldName != "LASTNAME" && fieldName != "PT" && fieldName != "POS") { stat.StatName = fieldName; stat.PositionTypeID = 2; // 1 = hitter stat = sBLL.InsertStat(stat); statValue.SeasonID = C_SeasonID; statValue.PlayerGUID = player.PlayerGUID; statValue.PositionID = TransformPos(cPitcher.Pos); statValue.StatID = stat.StatID; if (f.GetValue(cPitcher) == null) { statValue.StatValue = null; } else { statValue.StatValue = f.GetValue(cPitcher).ToString(); } sppsBLL.InsertStatValue(statValue); } } } }