protected void Page_Load(object sender, EventArgs e) { // Connection string string connString = @"server=.\sql2012;database=AdventureWorks;Integrated Security=true"; //Query string query = @" SELECT Title, BirthDate FROM HumanResources.Employee"; DataTable dt = new DataTable(); try { SqlDataAdapter da = new SqlDataAdapter(query, connString); da.Fill(dt); } catch (Exception ex) { Response.Write(ex.Message.ToString()); } //Populate Repeater control with data RepData.DataSource = dt; RepData.DataBind(); }
public void PopulateRepList() { //Loads the full rep list with all the rep data objects to be sent to the game manager for use in player class foreach (string s in regionNames) { RepData temp = new RepData(); temp.setRep(50); temp.setName(s); fullRepList.Add(temp); } foreach (PlayerData p in gm.allPlayers) { RepData temp = new RepData(); temp.setRep(50); temp.setName(p.playerName); fullRepList.Add(temp); } RepData bmRep = new RepData(); bmRep.setRep(0); bmRep.setName("Black Market"); fullRepList.Add(bmRep); }
// Use this for initialization void Start() { RepData temp = new RepData(); temp.setName(name); temp.setRep(rep); GameObject.Find("RepManager").GetComponent <RepManager>().AddNewObjectToList(temp); }
public void RemoveRepObjectByName(string name) { //Searches for the object with the given name and removes it from the internal replist then sends it to gm to be removed from the players replists RepData temp = new RepData(); foreach (RepData r in fullRepList) { if (r.getName() == name) { temp = r; } } fullRepList.Remove(temp); }
public void AddNewObjectToList(RepData newRep) { //Adds a new rep object to the list and then sends that object to the gm to be added to the players rep lists Debug.Log(newRep.getName()); fullRepList.Add(newRep); }