protected void Page_Load(object sender, EventArgs e) { if (ProfileUserID > 0) { _playerInfo = PlayerStrip.GetPlayerInfo(ProfileUserID); var items = PlayerStrip.GetMyNumbers(ProfileUserID); items.RemoveAll(delegate(Card un) { return un.IsActive; }); items.RemoveAll(delegate(Card un) { return !un.ArsenalPlayerGuid.HasValue; }); rptCard.DataSource = items; rptCard.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (ProfileUserID > 0) { _playerInfo = PlayerStrip.GetPlayerInfo(ProfileUserID); var list = PlayerStrip.GetMyCards(ProfileUserID) .FindAll( delegate(Card un) { return un.IsActive && un.ArsenalPlayerGuid.HasValue && un.ActiveDate.HasValue; }); list = SortUserNumberListByOrderClause(list, OrderClause); rptCard.DataSource = list; rptCard.DataBind(); } }
public static Gamer GetPlayerInfoByPlayerID(int playerID) { Gamer player = null; var sql = "SELECT * FROM dbo.AcnClub_Player WHERE [ID] = @playerID"; using (var con = SQLConn.GetConnection()) { var com = new SqlCommand(sql, con); com.Parameters.Add(new SqlParameter("@playerID", playerID)); var sda = new SqlDataAdapter(com); con.Open(); var dt = new DataTable(); sda.Fill(dt); //con.Close(); if (dt.Rows.Count != 0) { player = new Gamer(dt.Rows[0]); } } return player; }
public static List<Gamer> GetPlayers() { var list = new List<Gamer>(); var sql = "SELECT * FROM AcnClub_Player ORDER BY ID DESC"; using (var con = SQLConn.GetConnection()) { var com = new SqlCommand(sql, con); //com.Parameters.Add(new SqlParameter("@clubID", clubID)); var sda = new SqlDataAdapter(com); con.Open(); var dt = new DataTable(); sda.Fill(dt); //con.Close(); foreach (DataRow dr in dt.Rows) { var bh = new Gamer(dr); list.Add(bh); } } return list; }
public static List<Gamer> GetClubPlayers(int clubID) { var list = new List<Gamer>(); var sql = "SELECT p.* FROM AcnClub_Player p INNER JOIN AcnClub_RelationUserClub uc ON p.UserID = uc.UserID WHERE uc.ClubUID = @clubID AND uc.IsActive = 1 ORDER BY Shirt+Shorts+Sock DESC"; using (var con = SQLConn.GetConnection()) { var com = new SqlCommand(sql, con); com.Parameters.Add(new SqlParameter("@clubID", clubID)); var sda = new SqlDataAdapter(com); con.Open(); var dt = new DataTable(); sda.Fill(dt); //con.Close(); foreach (DataRow dr in dt.Rows) { var p = new Gamer(dr); list.Add(p); } } return list; }