partial void DeletePLAYER(PLAYER instance);
partial void InsertPLAYER(PLAYER instance);
partial void UpdatePLAYER(PLAYER instance);
private PLAYER GetPlayer(TableCell PlayerCell) { string playerName = string.Empty; int espnId = 0; if (PlayerCell.Links.Count == 1) { playerName = PlayerCell.Links[0].Text; int idIndex = PlayerCell.Links[0].URL.IndexOf("playerId="); if (idIndex != -1) { if (!int.TryParse(PlayerCell.Links[0].URL.Substring(idIndex + 9), out espnId)) { //can't cast string to int } } else { //"playerId=" not found in Url } } else { //no link found, lookup player by name? } PLAYER player = (from p in nflData.PLAYERs where p.EspnId == espnId select p).SingleOrDefault(); if (player == null) { player = new PLAYER(); player.FullName = playerName; player.EspnId = espnId; nflData.PLAYERs.InsertOnSubmit(player); nflData.SubmitChanges(); } return player; }