public List <Inteligence> getStudentIntelli(string mail) { SqlConnection con = null; List <Inteligence> list = new List <Inteligence>(); try { con = connect("DBConnectionString"); // create a connection to the database using the connection String defined in the web config file String selectSTR = "select * from PointsInIntelligence where StudentEmail='" + mail + "'"; SqlCommand cmd = new SqlCommand(selectSTR, con); // get a reader SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); // CommandBehavior.CloseConnection: the connection will be closed after reading has reached the end while (dr.Read()) { // Read till the end of the data into a row Inteligence c = new Inteligence(); c.Points = Convert.ToInt32(dr["points"]); c.Name = dr["IntelligenceName"].ToString(); list.Add(c); } } catch (Exception ex) { // write to log throw (ex); } finally { if (con != null) { con.Close(); } } return(list); }
public override string ToString() { string stats = Health.ToString() + "\n" + Strength.ToString() + "\n" + Dexterity.ToString() + "\n" + Agility.ToString() + "\n" + Inteligence.ToString() + "\n" + Luck.ToString() + "\n" + Statpoints.ToString() + "\n" + Level.ToString() + "\n" + ExperiencePoints.ToString(); string hash = GetSha1("Blin113" + stats); //blin113 is just here to make sure you can't cheat without access to the code. stats += "\n" + hash; return(stats); }
static void Birthday(Inteligence v) { v.Knocking("Grandmother"); v.Welcoming("Grandmother"); }