public tea_issue() { InitializeComponent(); readacademy = SqlDbHelper.ExecuteReader(string.Format("select academy from stupasswordtable where account='{0}'", id)); readacademy.Read(); tealist = SqlDbHelper.ExecuteDataTable(string.Format("select * from teapasswordtable where academy='{0}'", readacademy[0].ToString())); for (int i = 0; i < teashow.Length; i++) { teashow[i] = new tea_show(tealist.Rows[i]); } }
public tea_issue(string getid) { InitializeComponent(); id = getid; readacademy = SqlDbHelper.ExecuteReader(string.Format("select academy from stupasswordtable where account='{0}'", id)); //获取当前用户所在学院 readacademy.Read(); tealist = SqlDbHelper.ExecuteDataTable(string.Format("select * from teapasswordtable where academy='{0}'", readacademy[0].ToString())); //获取当前学院导师 形成列表 for (int i = 0; i < tealist.Rows.Count; i++) { if (tealist.Rows.Count != 0) { teashow[i] = new tea_show(tealist.Rows[i]); } } mywill = SqlDbHelper.ExecuteDataTable(string.Format("select * from will where stuid='{0}'", id)); //读取当前用户的志愿信息 }